Commit 4717f7e5 authored by chen.weican's avatar chen.weican

【修改内容】去掉默认的ccuid

【提交人】陈伟灿
parent 128c5cb4
1.1.0
\ No newline at end of file
1.2.0
\ No newline at end of file
......@@ -41,7 +41,7 @@ static int _setDevice_Code(_IN_ char *device_code,int len)
strncpy(s_ccuid, device_code, len);
return len;
}
static void KK_Ccuid_init(void)
static int KK_Ccuid_init(void)
{
uint8_t ccuid[DEVICE_CODE_LEN] = {0};
uint8_t ccuidTmp[DEVICE_CODE_LEN] = {0};
......@@ -52,8 +52,10 @@ static void KK_Ccuid_init(void)
sprintf(ccuidTmp,"CCU_%s",ccuid);
_setDevice_Code(ccuidTmp,strlen(ccuidTmp)-1);//减一是因为最后有一个换行
}else{
_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
return -1;
}
return 0;
}
static int mqtt_start(void)
{
......@@ -99,7 +101,11 @@ int main(int argc, char* argv[])
int rc = 0;
openlog("kcloud",LOG_PID,LOG_USER);
/*set the callback to get the device date to cloud*/
KK_Ccuid_init();
rc = KK_Ccuid_init();
if(rc == -1){
ERROR_PRINT("CCUID GET FAIL!!!!!!!!!!!\n");
return 0;
}
kk_ipc_init(IPC_APP2MID,(ipc_cb*)KK_Data_FromDev,NULL,NULL);
kk_info_report_start();
again:
......
......@@ -276,6 +276,7 @@ int kk_lan_ctrl_ack(cJSON * nodeId,cJSON * opcode,cJSON * arg)
cJSON_AddItemToObject(msg, "opcode", tmp_opcode);
cJSON_AddStringToObject(msg, "status", "success");
cJSON_AddItemToObject(msg, "arg", tmp_arg);
//cJSON_AddStringToObject(msg, "ack", "true");
}
send_msg_to_module(msg);
......
......@@ -63,7 +63,7 @@ static void kk_lan_ccuid_init(void)
sprintf((char *)ccuidTmp,"CCU_%s",ccuid);
_setDevice_Code((char *)ccuidTmp,strlen((char *)ccuidTmp)-1);
}else{
_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
}
}
......
......@@ -100,7 +100,7 @@ static int _setDevice_Code(_IN_ char *device_code,int len)
strncpy(s_ccuid, device_code, len);
return len;
}
static void HAL_Ccuid_init(void)
static int HAL_Ccuid_init(void)
{
uint8_t ccuid[DEVICE_CODE_LEN] = {0};
uint8_t ccuidTmp[DEVICE_CODE_LEN] = {0};
......@@ -111,8 +111,10 @@ static void HAL_Ccuid_init(void)
sprintf(ccuidTmp,"CCU_%s",ccuid);
_setDevice_Code(ccuidTmp,strlen(ccuidTmp)-1);
}else{
_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
return -1;
}
return 0;
}
/************************************************************
*功能描述:过滤不需要下发给网关的消息
......@@ -1357,7 +1359,11 @@ int main(const int argc, const char **argv)
openlog("midware",LOG_PID,LOG_USER);
memset(mid_ctx, 0, sizeof(mid_ctx_t));
HAL_Ccuid_version();
HAL_Ccuid_init();
res = HAL_Ccuid_init();
if(res == -1){
ERROR_PRINT("CCUID GET FAIL!!!!!!!!!!!\n");
return 0;
}
kk_sqlite_init();
kk_tsl_api_init();
kk_ipc_init(IPC_MID2APP, mid_cb, NULL, NULL);
......
{
"productCode":"3091",
"operateType":"501",
"operateType":"512",
"channel":1,
"syn_type":1,
"syn_opcode":"DIMMABLE_LIGHT_STATUS",
......
{
"productCode":"3092",
"operateType":"501",
"operateType":"512",
"channel":2,
"syn_type":1,
"syn_opcode":"DIMMABLE_LIGHT_STATUS",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment