Commit dbefe3a6 authored by chen.weican's avatar chen.weican

【修改内容】修改多合一面板设置场景不起作用的BUG

【提交人】陈伟灿
parent 7fed2d98
1.2.0 1.3.0
\ No newline at end of file \ No newline at end of file
...@@ -108,7 +108,7 @@ int main(int argc, char* argv[]) ...@@ -108,7 +108,7 @@ int main(int argc, char* argv[])
return 0; return 0;
} }
kk_ipc_init(IPC_APP2MID,(ipc_cb*)KK_Data_FromDev,NULL,NULL); kk_ipc_init(IPC_APP2MID,(ipc_cb*)KK_Data_FromDev,NULL,NULL);
kk_info_report_start(); //kk_info_report_start();
again: again:
rc = kk_start_ccu_register(); rc = kk_start_ccu_register();
if(rc == 0){ if(rc == 0){
......
...@@ -35,6 +35,6 @@ int kk_room_update_armingstate(int state,const char *roomid); ...@@ -35,6 +35,6 @@ int kk_room_update_armingstate(int state,const char *roomid);
int kk_get_room_armingstate(const char* roomId); int kk_get_room_armingstate(const char* roomId);
int kk_get_roomId_by_deviceCode(const char* deviceCode,const char *epNum,char *roomId,int size); int kk_get_roomId_by_deviceCode(const char* deviceCode,const char *epNum,char *roomId,int size);
int kk_get_device_roomInfo(const char* deviceCode,int epNum,char *roomName,char *roomId); int kk_get_device_roomInfo(const char* deviceCode,int epNum,char *roomName,char *roomId);
int kk_room_reset_armingstate(void);
#endif #endif
...@@ -501,9 +501,11 @@ int dm_mgr_set_dev_onoffline(dm_mgr_dev_node_t *node,int isOffline) ...@@ -501,9 +501,11 @@ int dm_mgr_set_dev_onoffline(dm_mgr_dev_node_t *node,int isOffline)
int dm_mgr_check_heartbeat_timeout(time_t timestamp) int dm_mgr_check_heartbeat_timeout(time_t timestamp)
{ {
static unsigned int s_count = 0;
dm_mgr_ctx *ctx = _dm_mgr_get_ctx(); dm_mgr_ctx *ctx = _dm_mgr_get_ctx();
dm_mgr_dev_node_t *search_node = NULL; dm_mgr_dev_node_t *search_node = NULL;
_dm_mgr_mutex_lock(); _dm_mgr_mutex_lock();
s_count++;
list_for_each_entry(search_node, &ctx->dev_list, linked_list, dm_mgr_dev_node_t) { list_for_each_entry(search_node, &ctx->dev_list, linked_list, dm_mgr_dev_node_t) {
if(search_node->hb_timeout == 0){ if(search_node->hb_timeout == 0){
search_node->hb_timeout = DEFAULT_HEARTBEAT_TIMEOUT; search_node->hb_timeout = DEFAULT_HEARTBEAT_TIMEOUT;
...@@ -511,13 +513,14 @@ int dm_mgr_check_heartbeat_timeout(time_t timestamp) ...@@ -511,13 +513,14 @@ int dm_mgr_check_heartbeat_timeout(time_t timestamp)
if(search_node->devid == KK_DM_DEVICE_CCU_DEVICEID){ if(search_node->devid == KK_DM_DEVICE_CCU_DEVICEID){
continue; continue;
} }
#if 0 if(s_count >= 60)
printf("[%s][%d]search_node->productCode:%s\n",__FUNCTION__,__LINE__,search_node->productCode); {
printf("[%s][%d]search_node->hb_timeout:%d\n",__FUNCTION__,__LINE__,search_node->hb_timeout); INFO_PRINT("[%s][%d]search_node->productCode:%s\n",__FUNCTION__,__LINE__,search_node->productCode);
printf("[%s][%d]search_node->isOffline:%d\n",__FUNCTION__,__LINE__,search_node->isOffline); INFO_PRINT("[%s][%d]search_node->hb_timeout:%d\n",__FUNCTION__,__LINE__,search_node->hb_timeout);
printf("[%s][%d]search_node->timestamp:%d\n",__FUNCTION__,__LINE__,search_node->timestamp); INFO_PRINT("[%s][%d]search_node->isOffline:%d\n",__FUNCTION__,__LINE__,search_node->isOffline);
printf("[%s][%d]timestamp:%d\n",__FUNCTION__,__LINE__,timestamp); INFO_PRINT("[%s][%d]search_node->timestamp:%d\n",__FUNCTION__,__LINE__,search_node->timestamp);
#endif INFO_PRINT("[%s][%d]timestamp:%d\n",__FUNCTION__,__LINE__,timestamp);
}
if((timestamp - search_node->timestamp) >= search_node->hb_timeout){ if((timestamp - search_node->timestamp) >= search_node->hb_timeout){
if(search_node->isOffline != KK_DEV_OFFLINE){ if(search_node->isOffline != KK_DEV_OFFLINE){
dm_mgr_set_dev_onoffline(search_node,1); dm_mgr_set_dev_onoffline(search_node,1);
...@@ -530,6 +533,9 @@ int dm_mgr_check_heartbeat_timeout(time_t timestamp) ...@@ -530,6 +533,9 @@ int dm_mgr_check_heartbeat_timeout(time_t timestamp)
} }
} }
} }
if(s_count >= 60){
s_count = 0;
}
_dm_mgr_mutex_unlock(); _dm_mgr_mutex_unlock();
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
const char DM_MSG_REQUEST[] DM_READ_ONLY = "{\"msgId\":\"%s\",\"version\":\"%s\",\"params\":%s,\"time\":\"%lu\",\"method\":\"%s\"}"; const char DM_MSG_REQUEST[] DM_READ_ONLY = "{\"msgId\":\"%s\",\"version\":\"%s\",\"params\":%s,\"time\":\"%lu\",\"method\":\"%s\"}";
const char DM_MSG_INFO[] DM_READ_ONLY = "{\"msgtype\":\"%s\",\"productCode\":\"%s\",\"deviceCode\":\"%s\"}"; const char DM_MSG_INFO[] DM_READ_ONLY = "{\"msgtype\":\"%s\",\"productCode\":\"%s\",\"deviceCode\":\"%s\"}";
extern void kk_sendData2gw(void* data, int len, char* chalMark);
void kk_sendData2app(void *info, void *payload,int isAsync){ void kk_sendData2app(void *info, void *payload,int isAsync){
void *buf = NULL; void *buf = NULL;
cJSON *root=cJSON_CreateObject(); cJSON *root=cJSON_CreateObject();
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "kk_property_db.h" #include "kk_property_db.h"
#include "kk_product.h" #include "kk_product.h"
#include "kk_hal.h" #include "kk_hal.h"
#include "kk_history_db.h"
#define IOTX_LINKKIT_KEY_ID "id" #define IOTX_LINKKIT_KEY_ID "id"
#define IOTX_LINKKIT_KEY_CODE "code" #define IOTX_LINKKIT_KEY_CODE "code"
#define IOTX_LINKKIT_KEY_DEVID "devid" #define IOTX_LINKKIT_KEY_DEVID "devid"
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#define dm_log_info INFO_PRINT #define dm_log_info INFO_PRINT
extern void kk_sendData2gw(void* data, int len, char* chalMark);
static int s_gateway_add_flag = 0; static int s_gateway_add_flag = 0;
typedef struct { typedef struct {
......
...@@ -401,11 +401,9 @@ int kk_subDev_check_auth(int devType) ...@@ -401,11 +401,9 @@ int kk_subDev_check_auth(int devType)
char *zErrMsg = 0; char *zErrMsg = 0;
const char *searchCmd = "select * from SubDeviceInfo WHERE devType = '%d';"; const char *searchCmd = "select * from SubDeviceInfo WHERE devType = '%d';";
kk_subDb_ctx_t *ctx = _kk_subDb_get_ctx(); kk_subDb_ctx_t *ctx = _kk_subDb_get_ctx();
printf("------------------------------------------------------->111\n");
sqlCmd = sqlite3_mprintf(searchCmd,devType); sqlCmd = sqlite3_mprintf(searchCmd,devType);
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL); sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){ while(sqlite3_step(stmt) == SQLITE_ROW){
printf("------------------------------------------------------->222\n");
char *pDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE); char *pDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE);
char *pProductCode = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTCODE); char *pProductCode = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTCODE);
kk_msg_cloud_status_notify(pDeviceCode,pProductCode); kk_msg_cloud_status_notify(pDeviceCode,pProductCode);
...@@ -693,24 +691,15 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen ...@@ -693,24 +691,15 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL); sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
//INFO_PRINT("total_column = %d\n", sqlite3_column_count(stmt)); //INFO_PRINT("total_column = %d\n", sqlite3_column_count(stmt));
while(sqlite3_step(stmt) == SQLITE_ROW){ while(sqlite3_step(stmt) == SQLITE_ROW){
pDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE); pDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE);
res = dm_mgr_get_device_by_devicecode(pDeviceCode,&node); res = dm_mgr_get_device_by_devicecode(pDeviceCode,&node);
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
continue; continue;
} }
if(strcmp(typeArray[k],"air conditioning gateway") == 0){ if(strcmp(typeArray[k],"air conditioning gateway") == 0){
_kk_indoor_air_handle(pDeviceCode,sceneId,propertyName,propertyValue,type,delay,node->fatherDeviceCode); _kk_indoor_air_handle(pDeviceCode,sceneId,propertyName,propertyValue,type,delay,node->fatherDeviceCode);
continue; continue;
} }
#if 0
if(kk_subDev_check_scene_support(node->fatherDeviceCode) == 1){
gw_support_scene = 1;
}
else{
gw_support_scene = 0;
}
#endif
//if(!strcmp(typeArray[k],"switch")){
for(idx = 0; idx < node->dev_shadow->property_number; idx++){ for(idx = 0; idx < node->dev_shadow->property_number; idx++){
property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx); property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx);
if(property == NULL){ if(property == NULL){
...@@ -718,29 +707,37 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen ...@@ -718,29 +707,37 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen
} }
char *ptr = strstr(property->identifier,propertyName); char *ptr = strstr(property->identifier,propertyName);
if(ptr != NULL && (ptr-property->identifier==0) ){ if(ptr != NULL && (ptr-property->identifier==0) ){
//if(gw_support_scene){ kk_scene_action_detail_t info = {0};
kk_scene_action_detail_t info = {0}; memcpy(info.deviceCode,node->deviceCode,strlen(node->deviceCode));
memcpy(info.deviceCode,node->deviceCode,strlen(node->deviceCode)); memcpy(info.propertyName,property->identifier,strlen(property->identifier));
memcpy(info.propertyName,property->identifier,strlen(property->identifier)); memcpy(info.propertyValue,propertyValue,strlen(propertyValue));
memcpy(info.propertyValue,propertyValue,strlen(propertyValue)); //printf("------------------->property->identifier:%s\n",property->identifier);
//printf("------------------->property->identifier:%s\n",property->identifier); pStart = strstr(property->identifier,"_");
pStart = strstr(property->identifier,"_"); if(pStart != NULL){
if(pStart != NULL){ //printf("------------------->num:%s\n",pStart+1);
//printf("------------------->num:%s\n",pStart+1); info.epNum = atoi(pStart+1);
info.epNum = atoi(pStart+1); }else{
}else{ info.epNum = 1;
info.epNum = 1; }
} if(strcmp(node->productCode,"3098") == 0 && info.epNum != 1){ //风机盘管多合一只处理第一路
info.delay = delay; continue;
kk_scene_action_add(node->fatherDeviceCode,sceneId,info); }
res = kk_scene_insert_scene_action(type,node->deviceCode,info.epNum, else if(strcmp(node->productCode,"3097") == 0 && info.epNum != 2){//地暖多合一只处理第二路
property->identifier,propertyValue,info.delay,sceneId,node->fatherDeviceCode); continue;
if(res != SUCCESS_RETURN){ }
INFO_PRINT("kk_subDev_set_action_by_productType fail!!!\n"); else if(strcmp(node->productCode,"3099") == 0 && info.epNum != 3){//新风多合一只处理第三路
//return res; continue;
continue; }
} info.delay = delay;
//} kk_scene_action_add(node->fatherDeviceCode,sceneId,info);
res = kk_scene_insert_scene_action(type,node->deviceCode,info.epNum,
property->identifier,propertyValue,info.delay,sceneId,node->fatherDeviceCode);
if(res != SUCCESS_RETURN){
INFO_PRINT("kk_subDev_set_action_by_productType fail!!!\n");
//return res;
continue;
}
} }
} }
......
...@@ -936,18 +936,18 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -936,18 +936,18 @@ void kk_platMsg_handle(void* data, char* chalMark){
itemData->data_value.type == KK_TSL_DATA_TYPE_ENUM|| itemData->data_value.type == KK_TSL_DATA_TYPE_ENUM||
itemData->data_value.type == KK_TSL_DATA_TYPE_BOOL){ itemData->data_value.type == KK_TSL_DATA_TYPE_BOOL){
sprintf(valueBuf,"%d",itemDataIdentifier->valueint); sprintf(valueBuf,"%d",itemDataIdentifier->valueint);
//kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,&itemDataIdentifier->valueint,NULL); kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,&itemDataIdentifier->valueint,NULL);
} }
else if(itemData->data_value.type == KK_TSL_DATA_TYPE_FLOAT || else if(itemData->data_value.type == KK_TSL_DATA_TYPE_FLOAT ||
itemData->data_value.type == KK_TSL_DATA_TYPE_DOUBLE){ itemData->data_value.type == KK_TSL_DATA_TYPE_DOUBLE){
sprintf(valueBuf,"%f",itemDataIdentifier->valuedouble); sprintf(valueBuf,"%f",itemDataIdentifier->valuedouble);
//kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,&itemDataIdentifier->valuedouble,NULL); kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,&itemDataIdentifier->valuedouble,NULL);
} }
else if(itemData->data_value.type == KK_TSL_DATA_TYPE_TEXT || else if(itemData->data_value.type == KK_TSL_DATA_TYPE_TEXT ||
itemData->data_value.type == KK_TSL_DATA_TYPE_DATE){ itemData->data_value.type == KK_TSL_DATA_TYPE_DATE){
sprintf(valueBuf,"%s",itemDataIdentifier->valuestring); sprintf(valueBuf,"%s",itemDataIdentifier->valuestring);
//kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,NULL,itemDataIdentifier->valuestring); kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,tmpStr,NULL,itemDataIdentifier->valuestring);
} }
if(sensorDev){ if(sensorDev){
kk_alarm_notify_handle(node,itemData->identifier,valueBuf);//告警信息处理 kk_alarm_notify_handle(node,itemData->identifier,valueBuf);//告警信息处理
...@@ -1374,7 +1374,7 @@ int main(const int argc, const char **argv) ...@@ -1374,7 +1374,7 @@ int main(const int argc, const char **argv)
res = HAL_Ccuid_init(); res = HAL_Ccuid_init();
if(res == -1){ if(res == -1){
ERROR_PRINT("CCUID GET FAIL!!!!!!!!!!!\n"); ERROR_PRINT("CCUID GET FAIL!!!!!!!!!!!\n");
return 0; return -1;
} }
kk_sqlite_init(); kk_sqlite_init();
kk_tsl_api_init(); kk_tsl_api_init();
......
...@@ -1019,14 +1019,17 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat ...@@ -1019,14 +1019,17 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
} }
if(kk_subDev_check_scene_support(node->fatherDeviceCode) == 1 && ArmingStateFlag == 0){ if(kk_subDev_check_scene_support(node->fatherDeviceCode) == 1 && ArmingStateFlag == 0){
kk_scene_action_detail_t info = {0}; kk_scene_action_detail_t info = {0};
memset(propertyValueStr,0,sizeof(propertyValueStr)); memset(propertyValueStr,0,sizeof(propertyValueStr));
memcpy(info.deviceCode,node->deviceCode,strlen(node->deviceCode)); memcpy(info.deviceCode,node->deviceCode,strlen(node->deviceCode));
//多合一面板需要根据epnum重新设置propertyName
memcpy(info.propertyName,propertyName->valuestring,strlen(propertyName->valuestring)); if(strcmp(node->productCode,"3098") == 0 || strcmp(node->productCode,"3099") == 0 ||
strcmp(node->productCode,"3097") == 0){
sprintf(info.propertyName,"%s_%d",propertyName->valuestring,iepnum);
}else{
memcpy(info.propertyName,propertyName->valuestring,strlen(propertyName->valuestring));
}
if(propertyValue->type==cJSON_Number){ if(propertyValue->type==cJSON_Number){
snprintf(propertyValueStr,sizeof(propertyValueStr),"%d",propertyValue->valueint); snprintf(propertyValueStr,sizeof(propertyValueStr),"%d",propertyValue->valueint);
}else if(propertyValue->type==cJSON_String){ }else if(propertyValue->type==cJSON_String){
snprintf(propertyValueStr,sizeof(propertyValueStr),"%s",propertyValue->valuestring); snprintf(propertyValueStr,sizeof(propertyValueStr),"%s",propertyValue->valuestring);
...@@ -1041,12 +1044,14 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat ...@@ -1041,12 +1044,14 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
kk_scene_action_add(node->fatherDeviceCode,sceneId,info); kk_scene_action_add(node->fatherDeviceCode,sceneId,info);
res = kk_scene_insert_scene_action(type->valuestring,node->deviceCode,iepnum,
info.propertyName,propertyValueStr,idelay,sceneId,node->fatherDeviceCode);
}else{
res = kk_scene_insert_scene_action(type->valuestring,node->deviceCode,iepnum,
propertyName->valuestring,propertyValueStr,idelay,sceneId,node->fatherDeviceCode);
} }
res = kk_scene_insert_scene_action(type->valuestring,node->deviceCode,iepnum,
propertyName->valuestring,propertyValueStr,idelay,sceneId,node->fatherDeviceCode);
if(res != SUCCESS_RETURN){ if(res != SUCCESS_RETURN){
INFO_PRINT("kk_scene_insert_scene_action fail!!!\n"); INFO_PRINT("kk_scene_insert_scene_action fail!!!\n");
return res; return res;
......
...@@ -81,6 +81,6 @@ kk_tsl_t * kk_scene_shadow(void); ...@@ -81,6 +81,6 @@ kk_tsl_t * kk_scene_shadow(void);
int kk_scene_parse_updatescene(const cJSON* arg,char *sceneId); int kk_scene_parse_updatescene(const cJSON* arg,char *sceneId);
int kk_scene_parse_deletescene(char *sceneId); int kk_scene_parse_deletescene(char *sceneId);
int kk_scene_delete_send_to_gw(const char *sceneId); int kk_scene_delete_send_to_gw(const char *sceneId);
int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdate);
#endif #endif
...@@ -321,16 +321,13 @@ static int _kk_msg_set_object(kk_msg_set_type_t type, kk_tsl_t *dev_shadow, char ...@@ -321,16 +321,13 @@ static int _kk_msg_set_object(kk_msg_set_type_t type, kk_tsl_t *dev_shadow, char
lite_cjson_t lite_item_value; lite_cjson_t lite_item_value;
char *new_key = NULL; char *new_key = NULL;
int new_key_len = 0; int new_key_len = 0;
for (index = 0; index < root->size; index++) { for (index = 0; index < root->size; index++) {
res = lite_cjson_object_item_by_index(root, index, &lite_item_key, &lite_item_value); res = lite_cjson_object_item_by_index(root, index, &lite_item_key, &lite_item_value);
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
continue; continue;
} }
/* dm_log_debug("Current Key: %.*s, Value: %.*s", //printf("Current Key: %s, Value: %s,type:%d", lite_item_key.value,lite_item_value.value,lite_item_value.type);
lite_item_key.value_length, lite_item_key.value,
lite_item_value.value_length, lite_item_value.value); */
//new_key_len = lite_item_key.value_length + 1; //new_key_len = lite_item_key.value_length + 1;
new_key_len = ((key == NULL) ? (0) : (strlen(key) + 1)) + lite_item_key.value_length + 1; new_key_len = ((key == NULL) ? (0) : (strlen(key) + 1)) + lite_item_key.value_length + 1;
/* dm_log_debug("new_key_len: %d", new_key_len); */ /* dm_log_debug("new_key_len: %d", new_key_len); */
...@@ -361,7 +358,7 @@ static int _kk_msg_set_object(kk_msg_set_type_t type, kk_tsl_t *dev_shadow, char ...@@ -361,7 +358,7 @@ static int _kk_msg_set_object(kk_msg_set_type_t type, kk_tsl_t *dev_shadow, char
free(new_key); free(new_key);
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
return FAIL_RETURN; continue;
} }
} }
return SUCCESS_RETURN; return SUCCESS_RETURN;
...@@ -375,7 +372,6 @@ int _kk_msg_property_set(kk_tsl_t *dev_shadow, kk_msg_request_payload_t ...@@ -375,7 +372,6 @@ int _kk_msg_property_set(kk_tsl_t *dev_shadow, kk_msg_request_payload_t
if (request == NULL) { if (request == NULL) {
return INVALID_PARAMETER; return INVALID_PARAMETER;
} }
/* Parse Root */ /* Parse Root */
memset(&lite, 0, sizeof(lite_cjson_t)); memset(&lite, 0, sizeof(lite_cjson_t));
res = lite_cjson_parse(request->params.value, request->params.value_length, &lite); res = lite_cjson_parse(request->params.value, request->params.value_length, &lite);
...@@ -383,11 +379,9 @@ int _kk_msg_property_set(kk_tsl_t *dev_shadow, kk_msg_request_payload_t ...@@ -383,11 +379,9 @@ int _kk_msg_property_set(kk_tsl_t *dev_shadow, kk_msg_request_payload_t
return JSON_PARSE_FAILED; return JSON_PARSE_FAILED;
} }
/* dm_log_info("Property Set, Size: %d", lite.size); */ /* dm_log_info("Property Set, Size: %d", lite.size); */
if (lite_cjson_is_object(&lite)) { if (lite_cjson_is_object(&lite)) {
res = _kk_msg_set_object(KK_MSG_PROPERTY_SET, dev_shadow, NULL, &lite); res = _kk_msg_set_object(KK_MSG_PROPERTY_SET, dev_shadow, NULL, &lite);
} }
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
return FAIL_RETURN; return FAIL_RETURN;
} }
...@@ -1140,17 +1134,13 @@ int kk_tsl_property_set_by_shadow(kk_tsl_t* dev_shadow, const char *payload, uns ...@@ -1140,17 +1134,13 @@ int kk_tsl_property_set_by_shadow(kk_tsl_t* dev_shadow, const char *payload, uns
{ {
kk_msg_request_payload_t request; kk_msg_request_payload_t request;
int res = 0; int res = 0;
memset(&request, 0, sizeof(kk_msg_request_payload_t)); memset(&request, 0, sizeof(kk_msg_request_payload_t));
res = _kk_msg_request_parse((char *)payload, payload_len, &request); res = _kk_msg_request_parse((char *)payload, payload_len, &request);
if (res < SUCCESS_RETURN) { if (res < SUCCESS_RETURN) {
return res ; return res ;
} }
/* Operation */
res = _kk_msg_property_set(dev_shadow, &request); res = _kk_msg_property_set(dev_shadow, &request);
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
#if 0 #if 0
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"productType": "floorHeating", "productType": "floorHeating",
"version": "1.0", "version": "1.0",
"profile": { "profile": {
"heartbeat": "3000", "heartbeat": "300",
"productCode": "3097", "productCode": "3097",
"productName": "海顿系列.地暖多合一面板(KONKE)" "productName": "海顿系列.地暖多合一面板(KONKE)"
}, },
......
{ {
"schema": "https://iot-ap.ikonke.com/model/product_3098.json", "schema": "https://iot-ap.ikonke.com/model/product_3098.json",
"productType": "fan coil", "productType": "airConditioning",
"version": "1.0", "version": "1.0",
"profile": { "profile": {
"heartbeat": "3000", "heartbeat": "300",
"productCode": "3098", "productCode": "3098",
"productName": "海顿系列.风机盘管多合一面板(KONKE)" "productName": "海顿系列.风机盘管多合一面板(KONKE)"
}, },
......
1.1.1 1.3.1
\ No newline at end of file \ No newline at end of file
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