Commit d4fa60b3 authored by 陈伟灿's avatar 陈伟灿

Merge branch 'cwc' into 'master'

【修改内容】1,修改物模型;2,其他问题修改

See merge request chenweican/k-sdk!204
parents 38f01a95 282f3062
......@@ -204,6 +204,7 @@ char * g_filerToCloudTable[] =
(char *){"/thing/service/clientReport_reply"},
(char *){"/thing/service/clientOnlinePush"},
(char *){"/thing/service/getClientInfo_reply"},
(char *){"/thing/topo/change_reply"},
};
/************************************************************
*功能描述:过滤不需要下发给网关的消息
......
......@@ -1023,7 +1023,7 @@ void KK_Data_FromMid(void* str,int len, char* chalMark)
}else{
kk_lan_property_post_deal(deviceCode->valuestring,payload);
}
}else if(strstr(msgtype->valuestring,"/thing/topo/delete")!= NULL){
}else if(strstr(msgtype->valuestring,"/thing/topo/change_reply")!= NULL){
INFO_PRINT("topo delete handle!!!");
kk_lan_device_delete_notify(payload);
}else if(strstr(msgtype->valuestring,"/thing/status/online")!= NULL){
......
......@@ -424,7 +424,41 @@ int dm_mgr_get_device_by_devicecode(_IN_ char deviceCode[DEVICE_CODE_MAXLEN], _O
ERROR_PRINT("Device Not Found, deviceCode: %s\n", deviceCode);
return FAIL_RETURN;
}
char * g_TNBTable[] =
{
(char *){"3052"},
(char *){"3084"},
(char *){"3119"},
(char *){"3132"},
};
int kk_check_TNBDev(const char* productCode)
{
int i = 0,num = 0;
num = sizeof(g_TNBTable)/sizeof(char *);
for(i =0; i < num; i++){
if(strcmp(productCode,g_TNBTable[i]) == 0){
return 1;
}
}
return 0;
}
int dm_mgr_get_sensorNum(void)
{
dm_mgr_ctx *ctx = _dm_mgr_get_ctx();
dm_mgr_dev_node_t *search_node = NULL;
int num = 0;
list_for_each_entry(search_node, &ctx->dev_list, linked_list, dm_mgr_dev_node_t) {
if ((strlen(search_node->productType) == strlen("sensor")) &&
(memcmp(search_node->productType, "sensor", strlen("sensor")) == 0)) {
if(kk_check_TNBDev((const char*)search_node->productCode) == 1){
continue;
}
num++;
}
}
return num;
}
int dm_mgr_get_deviceNum_by_productType(_IN_ char *productType)
{
dm_mgr_ctx *ctx = _dm_mgr_get_ctx();
......
......@@ -130,4 +130,6 @@ int kk_get_pid(char *productId);
int dm_mgr_ccu_heartbeat_cloud(_IN_ int devid);
cJSON *dm_mgr_get_ccu_info(void);
int kk_is_mutiEp_device(const char *deviceCode);
int dm_mgr_get_sensorNum(void);
int kk_check_TNBDev(const char* productCode);
#endif
......@@ -60,6 +60,7 @@ typedef struct {
#define KK_THING_TOPO_DELETE_MSG "/thing/topo/delete"
#define KK_THING_TOPO_BATCH_DELETE_MSG "/thing/topo/batch_delete"
#define KK_THING_TOPO_CHANGE_MSG "/thing/topo/change"
#define KK_THING_TOPO_CHANGE_MSG_REPLY "/thing/topo/change_reply"
#define KK_THING_SERVICE_REBOOT "/thing/service/reboot"
#define KK_THING_SERVICE_ADDROOM "/thing/service/addRoom"
#define KK_THING_SERVICE_ADDROOM_REPLY "/thing/service/addRoom_reply"
......
......@@ -375,7 +375,7 @@ static int kk_topo_delete_report(cJSON *paramStr)
return FAIL_RETURN;
}
cJSON *info = cJSON_CreateObject();
cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_TOPO_DELETE_MSG);
cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_TOPO_CHANGE_MSG_REPLY);
cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, node->deviceCode);
cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, node->productCode);
char *infff=cJSON_Print(info);
......@@ -389,7 +389,7 @@ static int kk_topo_delete_report(cJSON *paramStr)
cJSON_AddStringToObject(paramsInfo, "productCode", productCode);
cJSON_AddItemToObject(payload, "params", paramsInfo);
cJSON_AddStringToObject(payload, "time", curTime);
cJSON_AddStringToObject(payload, "method", "thing.topo.delete");
cJSON_AddStringToObject(payload, "method", "thing.topo.change_reply");
char *payload11=cJSON_Print(payload);
kk_sendData2app(infff,payload11,0);
free(payload11);
......@@ -415,7 +415,7 @@ int kk_topo_delete_handle(cJSON *payload,cJSON *buf)
}
cJSON *paramStr = cJSON_GetObjectItem(payload, MSG_PARAMS_STR);
cJSON *state = cJSON_GetObjectItem(paramStr, MSG_TOPO_CHANGE_TYPE_STR);
//kk_topo_delete_report(paramStr);//主动报topo delete
kk_topo_delete_report(paramStr);//主动报topo delete
if(state != NULL && state->valueint == 1){
cJSON *deviceArray = cJSON_GetObjectItem(paramStr, MSG_TOPO_CHANGE_DEVICES_STR);
if(deviceArray == NULL){
......@@ -1706,7 +1706,7 @@ static int kk_service_getGuardSensors_handle(cJSON *param,cJSON *msgId)
cJSON_AddStringToObject(payload, "msgId", msgId->valuestring);
cJSON_AddStringToObject(payload, "method", "thing.service.getGuardSensors_reply");
cJSON *paramArray = cJSON_CreateArray();
num = dm_mgr_get_deviceNum_by_productType("sensor");
num = dm_mgr_get_sensorNum();
pList = (SensorType_t*)malloc(sizeof(SensorType_t)*num);
if(pList == NULL){
ERROR_PRINT("MALLOC ERROR!!!");
......
......@@ -237,6 +237,9 @@ static int kk_property_sendtogw_handle(cJSON *payload,cJSON *info_root,char *dev
cJSON * rootData=cJSON_CreateObject();
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode(deviceCode,&node);
if(res != SUCCESS_RETURN){
return res;
}
char *info_rootS=cJSON_Print(info_root);
char *payloadS = cJSON_Print(payload);
cJSON_AddItemToObject(rootData,MSG_INFO_STR, cJSON_Parse(info_rootS));
......
......@@ -1158,6 +1158,9 @@ int kk_subDev_getSensors_reply(SensorType_t*list)
ERROR_PRINT("ERROR res:%d\n",rc);
continue;
}
if(kk_check_TNBDev((const char*)node->productCode) == 1){//过滤环境检测设备
continue;
}
//printf("pDeviceCode:%s\n",pDeviceCode);
kk_property_db_get_value(pDeviceCode,"SensorType",&currentValue);
//printf("currentValue:%d\n",currentValue);
......@@ -1227,8 +1230,7 @@ static int _kk_check_screenDev_exist(const char* sId)
//INFO_PRINT("total_column = %d\n", sqlite3_column_count(stmt));
while(sqlite3_step(stmt) == SQLITE_ROW){
serialId = (char*)sqlite3_column_text(stmt, DB_SCREEN_SERIALID);
if(!strcmp(sId,serialId))
{
if(!strcmp(sId,serialId)){
isExist = 1;
break;
}
......
......@@ -56,6 +56,7 @@ int kk_LockUser_insert_db(char *keyId,char *keyType,char*keyRole,char *keyName,c
int kk_get_LockUser_list(LockKeyInfo_t *list,const char *deviceCode);
int kk_delete_LockUser_info(const char *deviceCode);
int kk_delete_LockUser_info_byId(const char *id);
enum{
DB_SUB_IDX = 0,
DB_SUB_ONLINE,
......
......@@ -360,17 +360,17 @@ static int kk_property_set_data_check(cJSON * payload,const char *deviceCode){
if(current_data->data_value.type != KK_TSL_DATA_TYPE_STRUCT){
if(current_data->data_value.type == KK_TSL_DATA_TYPE_INT){
value = propertyItem_1->valueint;
if(value < current_data->data_value.mix ||value > current_data->data_value.max ){
ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,current_data->data_value.mix,current_data->data_value.max);
return INVALID_PARAMETER;
}
//if(value < current_data->data_value.mix ||value > current_data->data_value.max ){
//ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,current_data->data_value.mix,current_data->data_value.max);
//return INVALID_PARAMETER;
//}
}
else if(current_data->data_value.type == KK_TSL_DATA_TYPE_TEXT){
if(strlen(propertyItem_1->valuestring) > current_data->data_value.length ){
//if(strlen(propertyItem_1->valuestring) > current_data->data_value.length ){
ERROR_PRINT("ERROR !!!strlen(propertyItem_1->valuestring):%d,current_data->data_value.length:%d\n",strlen(propertyItem_1->valuestring),current_data->data_value.length);
return INVALID_PARAMETER;
}
//ERROR_PRINT("ERROR !!!strlen(propertyItem_1->valuestring):%d,current_data->data_value.length:%d\n",strlen(propertyItem_1->valuestring),current_data->data_value.length);
//return INVALID_PARAMETER;
//}
}
}
else{
......@@ -387,17 +387,17 @@ static int kk_property_set_data_check(cJSON * payload,const char *deviceCode){
}
if(current_data_1->data_value.type == KK_TSL_DATA_TYPE_INT){
value = propertyItem_2->valueint;
if(value < current_data_1->data_value.mix ||value > current_data_1->data_value.max ){
ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,current_data_1->data_value.mix,current_data_1->data_value.max);
return INVALID_PARAMETER;
}
//if(value < current_data_1->data_value.mix ||value > current_data_1->data_value.max ){
//ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,current_data_1->data_value.mix,current_data_1->data_value.max);
//return INVALID_PARAMETER;
//}
}
else if(current_data_1->data_value.type == KK_TSL_DATA_TYPE_TEXT){
if(strlen(propertyItem_2->valuestring) > current_data_1->data_value.length ){
//if(strlen(propertyItem_2->valuestring) > current_data_1->data_value.length ){
ERROR_PRINT("ERROR !!!strlen(propertyItem_2->valuestring):%d,propertyItem_2->data_value.length:%d\n",strlen(propertyItem_2->valuestring),current_data_1->data_value.length);
return INVALID_PARAMETER;
}
//ERROR_PRINT("ERROR !!!strlen(propertyItem_2->valuestring):%d,propertyItem_2->data_value.length:%d\n",strlen(propertyItem_2->valuestring),current_data_1->data_value.length);
//return INVALID_PARAMETER;
//}
}
}
......@@ -408,29 +408,29 @@ static int kk_property_set_data_check(cJSON * payload,const char *deviceCode){
}
else if(property->data_value.type == KK_TSL_DATA_TYPE_INT){
value = propertyItem->valueint;
if(value < property->data_value.mix ||value > property->data_value.max ){
ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,property->data_value.mix,property->data_value.max);
return INVALID_PARAMETER;
}
//if(value < property->data_value.mix ||value > property->data_value.max ){
//ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,property->data_value.mix,property->data_value.max);
//return INVALID_PARAMETER;
//}
INFO_PRINT("-----------------KK_TSL_DATA_TYPE_INT-------------------\n");
cJSON_AddNumberToObject(params,property->identifier,propertyItem->valueint);
cJSON_DeleteItemFromObject(params, propertiesbuf[0]);
}
else if(property->data_value.type == KK_TSL_DATA_TYPE_FLOAT || property->data_value.type == KK_TSL_DATA_TYPE_DOUBLE){
value = propertyItem->valuedouble;
if(value < property->data_value.mix ||value > property->data_value.max ){
ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,property->data_value.mix,property->data_value.max);
return INVALID_PARAMETER;
}
//if(value < property->data_value.mix ||value > property->data_value.max ){
//ERROR_PRINT("ERROR !!!value:%d,mix:%d,max:%d\n",value,property->data_value.mix,property->data_value.max);
//return INVALID_PARAMETER;
//}
INFO_PRINT("-----------------KK_TSL_DATA_TYPE_DOUBLE-------------------\n");
cJSON_AddNumberToObject(params,property->identifier,propertyItem->valuedouble);
cJSON_DeleteItemFromObject(params, propertiesbuf[0]);
}
else if(property->data_value.type == KK_TSL_DATA_TYPE_TEXT){
if(strlen(propertyItem->valuestring) > property->data_value.length ){
ERROR_PRINT("ERROR !!!strlen(propertyItem->valuestring):%d,property->data_value.length:%d\n",strlen(propertyItem->valuestring),property->data_value.length );
return INVALID_PARAMETER;
}
//if(strlen(propertyItem->valuestring) > property->data_value.length ){
//ERROR_PRINT("ERROR !!!strlen(propertyItem->valuestring):%d,property->data_value.length:%d\n",strlen(propertyItem->valuestring),property->data_value.length );
//return INVALID_PARAMETER;
//}
INFO_PRINT("-----------------KK_TSL_DATA_TYPE_TEXT-------------------\n");
cJSON_AddStringToObject(params,property->identifier,propertyItem->valuestring);
cJSON_DeleteItemFromObject(params, propertiesbuf[0]);
......@@ -915,9 +915,7 @@ void mid_cb(void* data, int len){
json=cJSON_Parse(data);
if (!json) {
ERROR_PRINT("Error before: [%s]\n","cJSON_Parse");
}
else
{
}else{
info_root = cJSON_GetObjectItem(json, MSG_INFO_STR);
if (info_root == NULL){
ERROR_PRINT(" params [%s] can't find \n",MSG_INFO_STR);
......@@ -992,38 +990,17 @@ void mid_cb(void* data, int len){
ERROR_PRINT("\n\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\n");
//
}else{
#if 0
if(strcmp(gw_node->productType,KK_DM_AIR_SWITCH_GATEWAY_TYPE) == 0){
res = _kk_handle_airswitch_property(gw_node->fatherDeviceCode,info_root,payload);//空开epnum 传的是数组,无语
if(res != 0){
cJSON * rootData=cJSON_CreateObject();
char *info_rootS=cJSON_Print(info_root);
char *payloadS = cJSON_Print(payload);
cJSON_AddItemToObject(rootData,MSG_INFO_STR, cJSON_Parse(info_rootS));
cJSON_AddItemToObject(rootData,MSG_PAYLOAD_STR, cJSON_Parse(payloadS));
char *pnewout=cJSON_Print(rootData);
kk_sendData2gw(pnewout, strlen(pnewout), gw_node->fatherDeviceCode);//send to sub device
cJSON_Delete(rootData);
free(info_rootS);
free(payloadS);
free(pnewout);
}
}else
#endif
{
cJSON * rootData=cJSON_CreateObject();
char *info_rootS=cJSON_Print(info_root);
char *payloadS = cJSON_Print(payload);
cJSON_AddItemToObject(rootData,MSG_INFO_STR, cJSON_Parse(info_rootS));
cJSON_AddItemToObject(rootData,MSG_PAYLOAD_STR, cJSON_Parse(payloadS));
char *pnewout=cJSON_Print(rootData);
kk_sendData2gw(pnewout, strlen(pnewout), node->fatherDeviceCode);//send to sub device
cJSON_Delete(rootData);
free(info_rootS);
free(payloadS);
free(pnewout);
}
cJSON * rootData=cJSON_CreateObject();
char *info_rootS=cJSON_Print(info_root);
char *payloadS = cJSON_Print(payload);
cJSON_AddItemToObject(rootData,MSG_INFO_STR, cJSON_Parse(info_rootS));
cJSON_AddItemToObject(rootData,MSG_PAYLOAD_STR, cJSON_Parse(payloadS));
char *pnewout=cJSON_Print(rootData);
kk_sendData2gw(pnewout, strlen(pnewout), node->fatherDeviceCode);//send to sub device
cJSON_Delete(rootData);
free(info_rootS);
free(payloadS);
free(pnewout);
}
}
else{
......@@ -1059,7 +1036,6 @@ void mid2p_cb(void* data, int len, char* chalMark){
ERROR_PRINT("mid2p_cb malloc buf failed ");
return;
}
memcpy(buf, data, len);
queue_msg->data = buf;
memset(queue_msg->chalMark, 0, sizeof(queue_msg->chalMark));
......
......@@ -12,156 +12,8 @@
#include "kk_mutictrl_handle.h"
#include "kk_scene_handle.h"
mutictrl_timestamp_t g_mc_stamp = {0};
static int _kk_check_virtual_device(char *sceneId)
{
int res = 0;
char *sqlCmd = NULL;
char *pdeviceCode = NULL;
dm_mgr_dev_node_t *node = NULL;
sqlite3_stmt *stmt;
kk_scene_ctx_t *ctx = _kk_scene_get_ctx();
sqlCmd = sqlite3_mprintf("select * from SceneActionInfo WHERE sceneId= '%s' and type = '%s'",sceneId,"action/thing/group");//actice判断设备是否移入待分配
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
pdeviceCode = (char*)sqlite3_column_text(stmt,DB_SCENEACTION_DEVICECODE);
res = dm_mgr_get_device_by_devicecode((char*)pdeviceCode, &node);
if(strcmp(node->productCode,"5004") == 0){
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
return 1;
}
}
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
return 0;
}
int _kk_virtual_mutictrl_ctrl(char *sceneId,int val,char *deviceCode,int ep)
{
char *sqlCmd = NULL;
sqlite3_stmt *stmt;
char *pdeviceCode = NULL;
int res = 0;
int epNum = 0;
dm_mgr_dev_node_t *node = NULL;
kk_scene_ctx_t *ctx = _kk_scene_get_ctx();
if(_kk_check_virtual_device(sceneId) == 0){
return 0;
}
sqlCmd = sqlite3_mprintf("select * from SceneActionInfo WHERE sceneId= '%s' and type = '%s'",sceneId,"action/thing/group");//actice判断设备是否移入待分配
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
pdeviceCode = (char*)sqlite3_column_text(stmt,DB_SCENEACTION_DEVICECODE);
epNum = sqlite3_column_int(stmt, DB_SCENEACTION_EPNUM);
if(strcmp(pdeviceCode,deviceCode) == 0 && ep == epNum){
continue;
}
res = dm_mgr_get_device_by_devicecode((char*)pdeviceCode, &node);
cJSON *param = cJSON_CreateObject();
if(kk_is_mutiEp_device(pdeviceCode) == 1){
if(epNum == 1){
cJSON_AddNumberToObject(param, "PowerSwitch_1", val);
}else if(epNum == 2){
cJSON_AddNumberToObject(param, "PowerSwitch_2", val);
}else if(epNum == 3){
cJSON_AddNumberToObject(param, "PowerSwitch_3", val);
}else if(epNum == 4){
cJSON_AddNumberToObject(param, "PowerSwitch_4", val);
}else{
cJSON_Delete(param);
continue;
}
}else{
cJSON_AddNumberToObject(param, "PowerSwitch", val);
}
char *paramstr=cJSON_Print(param);
kk_msg_execute_property_set(node->productCode,node->deviceCode,paramstr,node->fatherDeviceCode);
free(paramstr);
cJSON_Delete(param);
}
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
return SUCCESS_RETURN;
}
void split(char *src,const char *separator,char **dest,int *num);
int kk_virtual_mutictrl_check(const char*deviceCode,cJSON *param)
{
char *sqlCmd = NULL;
sqlite3_stmt *stmt;
char *type = NULL;
char *sceneId = NULL;
int res = 0,idx = 0;
dm_mgr_dev_node_t *node = NULL;
kk_tsl_data_t *property = NULL;
cJSON *propertyItem = NULL;
int value = -1;
char scene_id_bak[64][16] = {0};
int i = 0,count = 0;
int repeat = 0;
int ep = 0,epNum = 0;
char *propertiesbuf[64] = {0};
char propertiesTmp[64] = {0};
int num = 0;
kk_scene_ctx_t *ctx = _kk_scene_get_ctx();
res = dm_mgr_get_device_by_devicecode((char*)deviceCode, &node);
for(idx = 0; idx < node->dev_shadow->property_number; idx++){
property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx);
if(property == NULL || strstr(property->identifier,"PowerSwitch") == NULL){
continue;
}
propertyItem = cJSON_GetObjectItem(param, property->identifier);
if(propertyItem != NULL){
if(strstr(property->identifier,"_") != NULL){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
memcpy(propertiesTmp,property->identifier,strlen(property->identifier));
split(propertiesTmp,"_",propertiesbuf,&num);
if(num == 2){
ep = atoi(propertiesbuf[1]);
}else{
ep = 1;
}
}else{
ep = 1;
}
value = propertyItem->valueint;
break;
}
}
if(value == -1){
return FAIL_RETURN;
}
sqlCmd = sqlite3_mprintf("select * from SceneActionInfo WHERE deviceCode= '%s' and active = '%d'",deviceCode,1);//actice判断设备是否移入待分配
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
repeat = 0;
type = (char*)sqlite3_column_text(stmt,DB_SCENEACTION_TYPE);
epNum = sqlite3_column_int(stmt, DB_SCENEACTION_EPNUM);
if(strcmp(type,"action/thing/group") != 0 || epNum != ep){
continue;
}
sceneId = (char*)sqlite3_column_text(stmt,DB_SCENEACTION_SCENEID);
for(i = 0; i < count; i++){//检测同个设备在同个场景中设置不同的动作,只需rebuild一次
if(strcmp(scene_id_bak[i],sceneId) == 0){
repeat = 1;
break;
}
}
if(repeat){
continue;
}
_kk_virtual_mutictrl_ctrl(sceneId,value,(char*)deviceCode,ep);
if(count < 64){
memcpy(scene_id_bak[count],sceneId,strlen(sceneId));
count++;
}
}
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
return SUCCESS_RETURN;
}
#if 1
void split(char *src,const char *separator,char **dest,int *num);
char * g_manualMutiCtrlDev[] =
{
(char *){"3062"},
......@@ -178,9 +30,14 @@ char * g_manualMutiCtrlDev[] =
static int _kk_check_manualMutiCtrlDev(const char* deviceCode)
{
int i = 0,num = 0;
int res = 0;
dm_mgr_dev_node_t *node = NULL;
num = sizeof(g_manualMutiCtrlDev)/sizeof(char *);
dm_mgr_get_device_by_devicecode((char*)deviceCode, &node);
res = dm_mgr_get_device_by_devicecode((char*)deviceCode, &node);
if(res != SUCCESS_RETURN){
INFO_PRINT("[%s][%d]\n",__FUNCTION__,__LINE__);
return -1;
}
for(i =0; i < num; i++){
if(strcmp(node->productCode,g_manualMutiCtrlDev[i]) == 0)
{
......@@ -232,7 +89,15 @@ static int _kk_manual_mutictrl_set(cJSON *param,char *setDeviceCode,int ep,char*
int offflag = 0;
cJSON *propertyItem = NULL;
res = dm_mgr_get_device_by_devicecode((char*)srcDeviceCode, &node);
if(res != SUCCESS_RETURN){
INFO_PRINT("[%s][%d]\n",__FUNCTION__,__LINE__);
return -1;
}
res = dm_mgr_get_device_by_devicecode((char*)setDeviceCode, &setDevnode);
if(res != SUCCESS_RETURN){
INFO_PRINT("[%s][%d]\n",__FUNCTION__,__LINE__);
return -1;
}
for(idx = 0; idx < node->dev_shadow->property_number; idx++){
offflag = 0;
......@@ -338,6 +203,9 @@ static int _kk_manual_mutictrl_ctrl(char *sceneId,char *deviceCode,int ep,cJSON
dm_mgr_dev_node_t *node = NULL;
kk_scene_ctx_t *ctx = _kk_scene_get_ctx();
isManualDev = _kk_check_manualMutiCtrlDev((const char*)deviceCode);//上报的设备是否是需要手动触发多控设备
if(isManualDev == -1){
return -1;
}
memset(g_mc_stamp.sceneId,0x0,sizeof(g_mc_stamp.sceneId));
memcpy(g_mc_stamp.sceneId,sceneId,strlen(sceneId));
g_mc_stamp.timestamp = HAL_Uptimes();
......@@ -394,6 +262,10 @@ int kk_manual_mutictrl_execute(const char*deviceCode,cJSON *param)
kk_scene_ctx_t *ctx = _kk_scene_get_ctx();
res = dm_mgr_get_device_by_devicecode((char*)deviceCode, &node);
if(res != SUCCESS_RETURN){
INFO_PRINT("[%s][%d]\n",__FUNCTION__,__LINE__);
return -1;
}
for(idx = 0; idx < node->dev_shadow->property_number; idx++){//解析当前设备上报的epnum
property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx);
propertyItem = cJSON_GetObjectItem(param, property->identifier);
......@@ -431,10 +303,10 @@ int kk_manual_mutictrl_execute(const char*deviceCode,cJSON *param)
INFO_PRINT("[%s][%d]\n",__FUNCTION__,__LINE__);
return -1;
}
if(strcmp(sceneId,g_mc_stamp.sceneId) == 0 && HAL_Uptimes() - g_mc_stamp.timestamp <= 2 ){
INFO_PRINT("muti ctrl alread exexute !!!\n");
//if(strcmp(sceneId,g_mc_stamp.sceneId) == 0 && HAL_Uptimes() - g_mc_stamp.timestamp <= 2 ){
//INFO_PRINT("muti ctrl alread exexute !!!\n");
//return -1;
}
//}
INFO_PRINT("sceneId:%s\n",sceneId);
_kk_manual_mutictrl_ctrl(sceneId,(char*)deviceCode,ep,param,isMutiEp);
......
......@@ -99,21 +99,7 @@
],
"events": [
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3016.json",
"productType": "sensor",
"version": "1.0",
"profile": {
"heartbeat": "1200",
"productCode": "3016",
"productName": "铂金系列.紧急呼叫按钮Z3S(KONKE)",
"sleepTime": "30000"
},
"services": [
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "get",
"inputData": [
"Battery"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
}
],
"properties": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"accessMode": "r",
"required": false,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "SensorType",
"name": "安防等级",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "在家安防",
"1": "室外安防",
"2": "24小时警戒",
"3": "无警戒"
}
}
}
],
"events": [
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
},
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "BatteryAlarm",
"method": "thing.event.BatteryAlarm.post",
"name": "BatteryAlarm",
"type": "alert",
"required": true,
"desc": "低电量告警"
}
]
}
{
"schema": "https://iot-ap.ikonke.com/model/product_3016.json",
"productType": "sensor",
"version": "1.2",
"profile": {
"heartbeat": "1200",
"productCode": "3016",
"productName": "铂金系列.紧急呼叫按钮Z3S(KONKE)",
"sleepTime": "30000"
},
"services": [
{
"outputData": [
],
"identifier": "set",
"inputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "get",
"inputData": [
"SosState",
"Battery"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
}
],
"properties": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"accessMode": "r",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"events": [
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
},
{
"outputData": [],
"identifier": "clearSosAlarm",
"method": "thing.event.clearSosAlarm.post",
"name": "clearSosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警解除"
},
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "BatteryAlarm",
"method": "thing.event.BatteryAlarm.post",
"name": "BatteryAlarm",
"type": "alert",
"required": true,
"desc": "低电量告警"
}
]
}
{
"schema": "https://iot-ap.ikonke.com/model/product_3052.json",
"productType": "sensor",
"version": "1.1",
"profile": {
"heartbeat": "1200",
"productCode": "3052",
"productName": "邦德系列.环境传感器(KONKE)",
"sleepTime": "1200"
},
"services": [
{
"outputData": [
{
"identifier": "Temperature",
"name": "当前温度",
"dataType": {
"type": "double",
"specs": {
"min": "-40",
"max": "100",
"unit": "°C",
"unitName": "摄氏度",
"step": "0.01"
}
}
},
{
"identifier": "Humidity",
"name": "当前湿度",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "Illuminance",
"name": "当前光照度检测值",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "5000",
"unit": "Lux",
"unitName": "照度",
"step": "1.0"
}
}
},
{
"identifier": "IlluminanceLevel",
"name": "当前光照度等级",
"dataType": {
"type": "enum",
"specs": {
"0": "黑夜",
"1": "昏暗",
"2": "正常",
"3": "明亮",
"4": "刺眼"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "get",
"inputData": [
"Temperature",
"Humidity",
"Illuminance",
"IlluminanceLevel",
"Battery"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
}
],
"properties": [
{
"identifier": "Temperature",
"name": "当前温度",
"accessMode": "r",
"required": false,
"dataType": {
"type": "double",
"specs": {
"min": "-40",
"max": "100",
"unit": "°C",
"unitName": "摄氏度",
"step": "0.01"
}
}
},
{
"identifier": "Humidity",
"name": "当前湿度",
"accessMode": "r",
"required": false,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "Illuminance",
"name": "当前光照度检测值",
"accessMode": "r",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "65535",
"unit": "Lux",
"unitName": "照度",
"step": "1.0"
}
}
},
{
"identifier": "IlluminanceLevel",
"name": "当前光照度等级",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "黑夜",
"1": "昏暗",
"2": "正常",
"3": "明亮",
"4": "刺眼"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"accessMode": "r",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "SensorType",
"name": "安防等级",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "在家安防",
"1": "室外安防",
"2": "24小时警戒",
"3": "无警戒"
}
}
}
],
"events": [
{
"outputData": [
{
"identifier": "Temperature",
"name": "当前温度",
"dataType": {
"type": "double",
"specs": {
"min": "-40",
"max": "100",
"unit": "°C",
"unitName": "摄氏度",
"step": "0.01"
}
}
},
{
"identifier": "Humidity",
"name": "当前湿度",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "Illuminance",
"name": "当前光照度检测值",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "65535",
"unit": "Lux",
"unitName": "照度",
"step": "1.0"
}
}
},
{
"identifier": "IlluminanceLevel",
"name": "当前光照度等级",
"dataType": {
"type": "enum",
"specs": {
"0": "黑夜",
"1": "昏暗",
"2": "正常",
"3": "明亮",
"4": "刺眼"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "BatteryAlarm",
"method": "thing.event.BatteryAlarm.post",
"name": "BatteryAlarm",
"type": "alert",
"required": true,
"desc": "低电量告警"
}
]
{
"schema": "https://iot-ap.ikonke.com/model/product_3052.json",
"productType": "sensor",
"version": "1.2",
"profile": {
"heartbeat": "1200",
"productCode": "3052",
"productName": "邦德系列.环境传感器(KONKE)",
"sleepTime": "1200"
},
"services": [
{
"outputData": [
{
"identifier": "Temperature",
"name": "当前温度",
"dataType": {
"type": "double",
"specs": {
"min": "-40",
"max": "100",
"unit": "°C",
"unitName": "摄氏度",
"step": "0.01"
}
}
},
{
"identifier": "Humidity",
"name": "当前湿度",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "Illuminance",
"name": "当前光照度检测值",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "5000",
"unit": "Lux",
"unitName": "照度",
"step": "1.0"
}
}
},
{
"identifier": "IlluminanceLevel",
"name": "当前光照度等级",
"dataType": {
"type": "enum",
"specs": {
"1": "黑夜",
"2": "昏暗",
"3": "正常",
"4": "明亮",
"5": "刺眼"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "get",
"inputData": [
"Temperature",
"Humidity",
"Illuminance",
"IlluminanceLevel",
"Battery"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
}
],
"properties": [
{
"identifier": "Temperature",
"name": "当前温度",
"accessMode": "r",
"required": false,
"dataType": {
"type": "double",
"specs": {
"min": "-40",
"max": "100",
"unit": "°C",
"unitName": "摄氏度",
"step": "0.01"
}
}
},
{
"identifier": "Humidity",
"name": "当前湿度",
"accessMode": "r",
"required": false,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "Illuminance",
"name": "当前光照度检测值",
"accessMode": "r",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "65535",
"unit": "Lux",
"unitName": "照度",
"step": "1.0"
}
}
},
{
"identifier": "IlluminanceLevel",
"name": "当前光照度等级",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"1": "黑夜",
"2": "昏暗",
"3": "正常",
"4": "明亮",
"5": "刺眼"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"accessMode": "r",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "SensorType",
"name": "安防等级",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "在家安防",
"1": "室外安防",
"2": "24小时警戒",
"3": "无警戒"
}
}
}
],
"events": [
{
"outputData": [
{
"identifier": "Temperature",
"name": "当前温度",
"dataType": {
"type": "double",
"specs": {
"min": "-40",
"max": "100",
"unit": "°C",
"unitName": "摄氏度",
"step": "0.01"
}
}
},
{
"identifier": "Humidity",
"name": "当前湿度",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "Illuminance",
"name": "当前光照度检测值",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "65535",
"unit": "Lux",
"unitName": "照度",
"step": "1.0"
}
}
},
{
"identifier": "IlluminanceLevel",
"name": "当前光照度等级",
"dataType": {
"type": "enum",
"specs": {
"1": "黑夜",
"2": "昏暗",
"3": "正常",
"4": "明亮",
"5": "刺眼"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0.0",
"max": "100.0",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "BatteryAlarm",
"method": "thing.event.BatteryAlarm.post",
"name": "BatteryAlarm",
"type": "alert",
"required": true,
"desc": "低电量告警"
}
]
}
\ No newline at end of file
{
"schema": "https://iot-ap.ikonke.com/model/product_3054.json",
"productType": "sensor",
"version": "1.1",
"profile": {
"heartbeat": "1200",
"productCode": "3054",
"productName": "邦德系列.SOS按钮(KONKE)",
"sleepTime": "30000"
},
"services": [
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "get",
"inputData": [
"Battery"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
}
],
"properties": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"accessMode": "r",
"required": false,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "SensorType",
"name": "安防等级",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "在家安防",
"1": "室外安防",
"2": "24小时警戒",
"3": "无警戒"
}
}
}
],
"events": [
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
},
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "BatteryAlarm",
"method": "thing.event.BatteryAlarm.post",
"name": "BatteryAlarm",
"type": "alert",
"required": true,
"desc": "低电量告警"
}
]
{
"schema": "https://iot-ap.ikonke.com/model/product_3054.json",
"productType": "sensor",
"version": "1.2",
"profile": {
"heartbeat": "1200",
"productCode": "3054",
"productName": "邦德系列.SOS按钮(KONKE)",
"sleepTime": "30000"
},
"services": [
{
"outputData": [
],
"identifier": "set",
"inputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "get",
"inputData": [
"SosState",
"Battery"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
}
],
"properties": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "Battery",
"name": "电池电量",
"accessMode": "r",
"required": false,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
},
{
"identifier": "SensorType",
"name": "安防等级",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "在家安防",
"1": "室外安防",
"2": "24小时警戒",
"3": "无警戒"
}
}
}
],
"events": [
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
},
{
"outputData": [],
"identifier": "clearSosAlarm",
"method": "thing.event.clearSosAlarm.post",
"name": "clearSosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警解除"
},
{
"outputData": [
{
"identifier": "Battery",
"name": "电池电量",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "0.01"
}
}
}
],
"identifier": "BatteryAlarm",
"method": "thing.event.BatteryAlarm.post",
"name": "BatteryAlarm",
"type": "alert",
"required": true,
"desc": "低电量告警"
}
]
}
\ No newline at end of file
......@@ -133,7 +133,7 @@
"dataType": {
"type": "double",
"specs": {
"min": "20",
"min": "16",
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
......@@ -499,7 +499,7 @@
"dataType": {
"type": "double",
"specs": {
"min": "20",
"min": "16",
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
......@@ -850,7 +850,7 @@
"dataType": {
"type": "double",
"specs": {
"min": "20",
"min": "16",
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
......@@ -1221,7 +1221,7 @@
"dataType": {
"type": "double",
"specs": {
"min": "20",
"min": "16",
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3124.json",
"productType": "sensor",
"version": "1.1",
"version": "1.2",
"profile": {
"heartbeat": "300",
"productCode": "3124",
"productName": "肖邦系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
},
"services": [
{
"outputData": [
],
"identifier": "set",
"inputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
......@@ -75,27 +99,22 @@
],
"events": [
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
},
{
"outputData": [],
"identifier": "clearSosAlarm",
"method": "thing.event.clearSosAlarm.post",
"name": "clearSosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警解除"
}
]
}
\ 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