add function:upload and download device file ,modify interface function fix memleak
This commit is contained in:
@@ -171,6 +171,21 @@ typedef struct {
|
||||
|
||||
bool get_xml_config_by_dev_type(const char* dev_type, XmlConfigC* out_cfg);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////文件控制请求参数
|
||||
typedef struct file_dir_req_t
|
||||
{
|
||||
struct file_dir_req_t *next;
|
||||
struct file_dir_req_t *prev;
|
||||
|
||||
char guid[128];
|
||||
char frontid[128];
|
||||
int processNo;
|
||||
char devid[128];
|
||||
int type;
|
||||
char path[256];
|
||||
time_t create_time;
|
||||
} file_dir_req_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1551,6 +1551,9 @@ void CheckAllConnectedChannel()
|
||||
|
||||
if(chnl_usr->m_state == CHANNEL_CONNECTED)
|
||||
{
|
||||
if(g_node_id == THREE_SECS_DATA_BASE_NODE_ID) {
|
||||
HandleFileDirReqForChannel(chnl_usr);//文件目录请求
|
||||
}
|
||||
|
||||
ChannelCheckIECReports(chnl_usr);//报告
|
||||
if ( (g_node_id == SOE_COMTRADE_BASE_NODE_ID) || (g_node_id == HIS_DATA_BASE_NODE_ID) || (g_node_id == NEW_HIS_DATA_BASE_NODE_ID) || (g_node_id == RECALL_HIS_DATA_BASE_NODE_ID) || (g_node_id == RECALL_ALL_DATA_BASE_NODE_ID))
|
||||
|
||||
@@ -1546,6 +1546,59 @@ ERR:
|
||||
}
|
||||
}
|
||||
|
||||
//***************************lnk20260309下发文件到装置*********************/
|
||||
ST_RET mms_putFile(MVL_NET_INFO *clientNetInfo,
|
||||
ST_CHAR *src_file,
|
||||
ST_CHAR *dest_file,
|
||||
ST_INT iTimeout)
|
||||
{
|
||||
MVL_REQ_PEND *reqCtrl = NULL;
|
||||
ST_RET ret = SD_FAILURE;
|
||||
|
||||
if (clientNetInfo == NULL)
|
||||
{
|
||||
printf("\n mms_putFile failed: clientNetInfo is NULL");
|
||||
return SD_FAILURE;
|
||||
}
|
||||
|
||||
if (src_file == NULL || src_file[0] == '\0')
|
||||
{
|
||||
printf("\n mms_putFile failed: src_file is NULL or empty");
|
||||
return SD_FAILURE;
|
||||
}
|
||||
|
||||
if (dest_file == NULL || dest_file[0] == '\0')
|
||||
{
|
||||
printf("\n mms_putFile failed: dest_file is NULL or empty");
|
||||
return SD_FAILURE;
|
||||
}
|
||||
|
||||
ret = mvla_obtfile(clientNetInfo, src_file, dest_file, &reqCtrl);
|
||||
if (ret == SD_SUCCESS)
|
||||
ret = waitReqDone(reqCtrl, iTimeout);
|
||||
|
||||
if (ret != SD_SUCCESS)
|
||||
{
|
||||
printf("\n mms_putFile failed, src='%s', dest='%s', ret=0x%X",
|
||||
src_file, dest_file, ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n mms_putFile OK, src='%s', dest='%s'",
|
||||
src_file, dest_file);
|
||||
}
|
||||
|
||||
if (reqCtrl != NULL)
|
||||
{
|
||||
mvl_free_req_ctrl(reqCtrl);
|
||||
reqCtrl = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
//************************************************************************/
|
||||
/* putFile */
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* init_mem */
|
||||
|
||||
@@ -532,6 +532,8 @@ int extract_timestamp_from_cfg_file(char *comtrade_fn,long long *start_tm,long l
|
||||
int parse_file_names_by_fltnum(int fltnum, char* domname, char** filenames, int filenum, int* cfg_idx, int* dat_idx, char* file_base_name, char* file_yyyymm);
|
||||
QVVR_t* find_qvvr_by_trig_tm(LD_info_t* LD_info,long long trig_tm);
|
||||
|
||||
void HandleFileDirReqForChannel(chnl_usr_t *chnl_usr);
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user