Commit d13e142a authored by 尹佳钦's avatar 尹佳钦

门锁事件打包上报

parent 49990487
......@@ -349,6 +349,8 @@ void KK_Data_FromDev(void* str,int len)
if(str == NULL){
return;
}
INFO_PRINT("KK_Data_FromDev--->\n%s\n",str);
root=cJSON_Parse((char*)str);
if(root == NULL){
ERROR_PRINT("[%s][%d] root is null \n",__FUNCTION__,__LINE__);
......
......@@ -1173,7 +1173,6 @@ int kk_property_db_update(const char *deviceCode)
}
return SUCCESS_RETURN;
}
/************************************************************
*功能描述:同步数据库里的数据到内存中,开机调用
......
......@@ -1586,6 +1586,13 @@ void kk_platMsg_handle(void* data, char* chalMark){
if(strstr(msgType->valuestring, eventItem->identifier) == NULL){
continue ;
}
//门锁特殊处理,打包事件上报
int pack = 0;
if(strcmp(eventItem->identifier,"LockOpenNotification") == 0 ||
strcmp(eventItem->identifier,"KeyAddNotification") == 0 ||
strcmp(eventItem->identifier,"KeyDeletedNotification") == 0 ){
pack = 1;
}
for(index = 0; index < eventItem->output_data_number;index++){
itemStr = cJSON_GetObjectItem(jsonPay, eventItem->identifier);
itemData = eventItem->output_datas + index;
......@@ -1613,12 +1620,18 @@ void kk_platMsg_handle(void* data, char* chalMark){
if(sensorDev){
kk_alarm_notify_handle(node,itemData->identifier,valueBuf);//告警信息处理
}
INFO_PRINT("kk_platMsg_handle data: event post\n");
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
kk_scene_iftt_check(info_dcode->valuestring,jsonPay);
if(pack==0){
INFO_PRINT("kk_platMsg_handle data: event post\n");
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
kk_scene_iftt_check(info_dcode->valuestring,jsonPay);
}
}
}
if(pack==1){
INFO_PRINT("kk_platMsg_handle data: event pack post\n");
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
kk_scene_iftt_check(info_dcode->valuestring,jsonPay);
}
}
else if(strcmp(eventItem->identifier,MSG_PROPERTY_STR) != 0 &&
eventItem->output_data_number == 0){
......
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