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

Merge branch 'cwc' into 'master'

Cwc

See merge request chenweican/k-sdk!160
parents fa827093 cb78b59c
1.3.0 1.4.1
\ No newline at end of file \ No newline at end of file
...@@ -25,5 +25,6 @@ int KK_Get_ccuid( char *device_code); ...@@ -25,5 +25,6 @@ int KK_Get_ccuid( char *device_code);
int kk_check_config_file(char* path,char **config); int kk_check_config_file(char* path,char **config);
int kk_cloud_get_pid(char *productId); int kk_cloud_get_pid(char *productId);
int kk_cloud_get_key(char *key); int kk_cloud_get_key(char *key);
int KK_Send_CloudHB2Mid(int state);
#endif #endif
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#define KK_CLOUDSTATE_MSG "/thing/ccu/cloudstate" #define KK_CLOUDSTATE_MSG "/thing/ccu/cloudstate"
#define KK_CLOUDSTATE_MSG_REPLY "/thing/ccu/cloudstate_reply" #define KK_CLOUDSTATE_MSG_REPLY "/thing/ccu/cloudstate_reply"
#define KK_CLOUDHB_MSG "/thing/ccu/cloudHB"
#define KK_CLOUDHB_MSG_REPLY "/thing/ccu/cloudHB_reply"
#define KK_TOPO_CHANGE_MSG_STR "/thing/topo/change" #define KK_TOPO_CHANGE_MSG_STR "/thing/topo/change"
#define KK_FILTER_SERVICE_CALL_TOPIC "/thing/service/" #define KK_FILTER_SERVICE_CALL_TOPIC "/thing/service/"
#define KK_FILTER_SERVICE_CALL_REPLY "_reply" #define KK_FILTER_SERVICE_CALL_REPLY "_reply"
...@@ -291,6 +293,11 @@ int _kk_sendto_cloud(cJSON *root) ...@@ -291,6 +293,11 @@ int _kk_sendto_cloud(cJSON *root)
free(topic); free(topic);
return RETURN_SUCCESS; return RETURN_SUCCESS;
} }
else if(strstr(msgTypeStr->valuestring,KK_CLOUDHB_MSG) != NULL){
KK_Send_CloudHB2Mid(1);
free(topic);
return RETURN_SUCCESS;
}
//if(kk_check_need_split(info)){ //if(kk_check_need_split(info)){
//kk_split_send_data(pData,topic); //kk_split_send_data(pData,topic);
//} //}
...@@ -630,6 +637,48 @@ int KK_Send_CloudState(int state) ...@@ -630,6 +637,48 @@ int KK_Send_CloudState(int state)
free(out); free(out);
return RETURN_SUCCESS; return RETURN_SUCCESS;
} }
const char DM_MSG_CLOUDHB[] = "{\"msgId\":\"1\",\"version\":\"1.0\",\"params\":{\"heartbeat\":\"%d\"},\"method\":\"thing.ccu.cloudHB_reply\"}";
int KK_Send_CloudHB2Mid(int state)
{
char *infoStr = NULL;
char *payloadStr = NULL;
int infoStr_len = 0;
int payloadStr_len = 0;
cJSON *root;
char *out;
infoStr_len = strlen(DM_MSG_TO_MIDDWARE)+strlen(KK_CLOUDHB_MSG_REPLY)+10;
infoStr = malloc(infoStr_len);
if(infoStr == NULL){
ERROR_PRINT("infoStr == NULL\n");
return RETURN_FAIL;
}
memset(infoStr,0x0,infoStr_len);
snprintf(infoStr,infoStr_len,DM_MSG_TO_MIDDWARE,KK_CLOUDHB_MSG_REPLY,"","");
payloadStr_len = strlen(DM_MSG_CLOUDHB) + 10;
payloadStr = malloc(payloadStr_len);
if(payloadStr == NULL){
ERROR_PRINT("payloadStr == NULL\n");
return RETURN_FAIL;
}
memset(payloadStr,0x0,payloadStr_len);
snprintf(payloadStr,payloadStr_len,DM_MSG_CLOUDHB,state);
root=cJSON_CreateObject();
cJSON* infoObj = cJSON_Parse(infoStr);
cJSON* payloadObj = cJSON_Parse(payloadStr);
cJSON_AddItemToObject(root, MSG_INFO_STR, infoObj);
cJSON_AddItemToObject(root, MSG_PAYLOAD_STR,payloadObj);
out=cJSON_Print(root);
kk_ipc_send(IPC_APP2MID, out, strlen(out)+1);
cJSON_Delete(root);
free(payloadStr);
free(infoStr);
INFO_PRINT("%s\n",out);
free(out);
return RETURN_SUCCESS;
}
/************************************************************ /************************************************************
*功能描述:发送数据给Midware *功能描述:发送数据给Midware
*输入参数: topic:主题; *输入参数: topic:主题;
......
...@@ -88,31 +88,6 @@ static int KK_Ccuid_init(void) ...@@ -88,31 +88,6 @@ static int KK_Ccuid_init(void)
char s_pid[PRODUCT_CODE_LEN] = {0}; char s_pid[PRODUCT_CODE_LEN] = {0};
static int kk_cloud_pid_init(void) static int kk_cloud_pid_init(void)
{ {
#ifdef CONFIG_A133_PLATFORM
uint8_t data[128] = {0};
int data_len = 0;
char *pstart = NULL;
char *pEnd = NULL;
HAL_Execel_cmd(GET_CCUID_CMD,(char *)data,sizeof(data),&data_len);
printf("---GET_CCUID_CMD:%s\n",data);
if(data_len > 0 && data_len <= 128){
pstart = data;
pEnd = strstr(data,"pid_");
if(pstart != NULL && pEnd != NULL){
memcpy(s_pid,pEnd+4,data_len-1-(pEnd-pstart+4));
INFO_PRINT("kk_cloud_pid_init s_pid:%s\n",s_pid);
}else{
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
INFO_PRINT("KK_Ccuid_init get ccuid error\n");
return -1;
}
}else{
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
INFO_PRINT("KK_Ccuid_init get ccuid error\n");
return -1;
}
#else
char pid[PRODUCT_CODE_LEN] = {0}; char pid[PRODUCT_CODE_LEN] = {0};
int pid_len = 0; int pid_len = 0;
HAL_Execel_cmd(GET_PRODUCTID_CMD,(char *)pid,sizeof(pid),&pid_len); HAL_Execel_cmd(GET_PRODUCTID_CMD,(char *)pid,sizeof(pid),&pid_len);
...@@ -122,7 +97,6 @@ static int kk_cloud_pid_init(void) ...@@ -122,7 +97,6 @@ static int kk_cloud_pid_init(void)
}else{ }else{
return -1; return -1;
} }
#endif
return 0; return 0;
} }
int kk_cloud_get_pid(char *productId) int kk_cloud_get_pid(char *productId)
...@@ -142,10 +116,10 @@ static int kk_cloud_key_init(void) ...@@ -142,10 +116,10 @@ static int kk_cloud_key_init(void)
HAL_Execel_cmd(GET_CCUID_CMD,(char *)key,sizeof(key),&key_len); HAL_Execel_cmd(GET_CCUID_CMD,(char *)key,sizeof(key),&key_len);
printf("---productSecret:%s\n",key); printf("---productSecret:%s\n",key);
if(key_len > 0 && key_len <= 128){ if(key_len > 0 && key_len <= 128){
pstart = strstr(key,"key_");; pstart = key;
pEnd = strstr(key,"-pid_"); pEnd = strstr(key,"key_");
if(pstart != NULL && pEnd != NULL){ if(pEnd != NULL){
memcpy(s_key,pstart+4,pEnd-pstart+4); memcpy(s_key,pEnd+4,key_len -1-(pEnd-pstart+4));
INFO_PRINT("kk_cloud_key_init s_key:%s\n",s_key); INFO_PRINT("kk_cloud_key_init s_key:%s\n",s_key);
}else{ }else{
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID)); //_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
...@@ -273,11 +247,6 @@ int main(int argc, char* argv[]) ...@@ -273,11 +247,6 @@ int main(int argc, char* argv[])
kk_cloud_pid_init(); kk_cloud_pid_init();
kk_cloud_key_init(); kk_cloud_key_init();
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();
//
#ifdef CONFIG_NX5_PLATFORM
//adlakdlkf
#endif
#if 1 #if 1
kk_dl_config(); kk_dl_config();
again: again:
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "mqtt_api.h" #include "mqtt_api.h"
const char KK_URI_SYS_PREFIX[] = "biz/newkk/%s/%s/thing/service/property/set"; const char KK_URI_SYS_PREFIX[] = "biz/newkk/%s/%s/thing/service/property/set";
const char KK_URI_SYS_PREFIX_GET[] = "biz/newkk/%s/%s/thing/service/property/get";
const char KK_URI_SYS_PREFIX_SERVICE[] = "biz/newkk/%s/%s/thing/service/+"; const char KK_URI_SYS_PREFIX_SERVICE[] = "biz/newkk/%s/%s/thing/service/+";
const char KK_URI_SYS_PREFIX_TOPO_CHANGE[] = "biz/newkk/%s/%s/thing/topo/change"; const char KK_URI_SYS_PREFIX_TOPO_CHANGE[] = "biz/newkk/%s/%s/thing/topo/change";
const char KK_URI_SYS_PREFIX_EX[] = "biz/newkk/%s/%s"; const char KK_URI_SYS_PREFIX_EX[] = "biz/newkk/%s/%s";
...@@ -59,6 +60,11 @@ int KK_Subdev_Subscribe(const cJSON *root) ...@@ -59,6 +60,11 @@ int KK_Subdev_Subscribe(const cJSON *root)
INFO_PRINT("ota [%s][%d] URL:%s\n",__FUNCTION__,__LINE__,url); INFO_PRINT("ota [%s][%d] URL:%s\n",__FUNCTION__,__LINE__,url);
res = KK_MQTT_SubTopic(url); res = KK_MQTT_SubTopic(url);
memset(url, 0, url_len);
snprintf(url, url_len, KK_URI_SYS_PREFIX_GET, productCode->valuestring, deviceCode->valuestring);
INFO_PRINT("sys [%s][%d] URL:%s\n",__FUNCTION__,__LINE__,url);
res = KK_MQTT_SubTopic(url);
memset(url, 0, url_len); memset(url, 0, url_len);
snprintf(url, url_len, KK_URI_SYS_PREFIX, productCode->valuestring, deviceCode->valuestring); snprintf(url, url_len, KK_URI_SYS_PREFIX, productCode->valuestring, deviceCode->valuestring);
INFO_PRINT("sys [%s][%d] URL:%s\n",__FUNCTION__,__LINE__,url); INFO_PRINT("sys [%s][%d] URL:%s\n",__FUNCTION__,__LINE__,url);
......
...@@ -36,13 +36,11 @@ static int kk_findccu_ack(int sockfd,struct sockaddr_in *addr){ ...@@ -36,13 +36,11 @@ static int kk_findccu_ack(int sockfd,struct sockaddr_in *addr){
cJSON_AddItemToObject(json, "arg", args); cJSON_AddItemToObject(json, "arg", args);
#ifdef CONFIG_A133_PLATFORM #ifdef CONFIG_A133_PLATFORM
cJSON_AddStringToObject(args, "zkid", ccuid); cJSON_AddStringToObject(args, "zkid", ccuid);
cJSON_AddStringToObject(args, "zk", KK_CCU_NAME);
HAL_Get_IP(s_IP,"eth0");
#else #else
cJSON_AddStringToObject(args, "zkid", &ccuid[4]); cJSON_AddStringToObject(args, "zkid", &ccuid[4]);
cJSON_AddStringToObject(args, "zk", KK_CCU_NAME);
HAL_Get_IP(s_IP,NULL);
#endif #endif
cJSON_AddStringToObject(args, "zk", KK_CCU_NAME);
HAL_Get_IP(s_IP,NULL);
cJSON_AddStringToObject(args, "ip", s_IP); cJSON_AddStringToObject(args, "ip", s_IP);
cJSON_AddBoolToObject(args, "ssl", FALSE); cJSON_AddBoolToObject(args, "ssl", FALSE);
} }
......
...@@ -54,28 +54,6 @@ static int _setDevice_Code(_IN_ char *device_code,int len) ...@@ -54,28 +54,6 @@ static int _setDevice_Code(_IN_ char *device_code,int len)
char s_pid[PRODUCT_CODE_LEN] = {0}; char s_pid[PRODUCT_CODE_LEN] = {0};
static int kk_lan_pid_init(void) static int kk_lan_pid_init(void)
{ {
#ifdef CONFIG_A133_PLATFORM
uint8_t data[128] = {0};
int data_len = 0;
uint8_t uuid[32] = {0};
char *pstart = NULL;
char *pEnd = NULL;
HAL_Execel_cmd(GET_CCUID_CMD,(char *)data,sizeof(data),&data_len);
printf("GET_CCUID_CMD:%s\n",data);
if(data_len > 0 && data_len <= 128){
pstart = data;
pEnd = strstr(data,"pid_");
if(pstart != NULL && pEnd != NULL){
memcpy(s_pid,pEnd+4,data_len-1-(pEnd-pstart+4));
INFO_PRINT("s_pid:%s\n",s_pid);
}else{
return -1;
}
}else{
return -1;
}
#else
char pid[PRODUCT_CODE_LEN] = {0}; char pid[PRODUCT_CODE_LEN] = {0};
int pid_len = 0; int pid_len = 0;
HAL_Execel_cmd(GET_PRODUCTID_CMD,(char *)pid,sizeof(pid),&pid_len); HAL_Execel_cmd(GET_PRODUCTID_CMD,(char *)pid,sizeof(pid),&pid_len);
...@@ -85,7 +63,6 @@ static int kk_lan_pid_init(void) ...@@ -85,7 +63,6 @@ static int kk_lan_pid_init(void)
}else{ }else{
return -1; return -1;
} }
#endif
return 0; return 0;
} }
int kk_lan_get_pid(_OU_ char *productId) int kk_lan_get_pid(_OU_ char *productId)
...@@ -97,6 +74,27 @@ int kk_lan_get_pid(_OU_ char *productId) ...@@ -97,6 +74,27 @@ int kk_lan_get_pid(_OU_ char *productId)
static void kk_lan_ccuid_init(void) static void kk_lan_ccuid_init(void)
{ {
#ifdef CONFIG_A133_PLATFORM
uint8_t data[128] = {0};
int data_len = 0;
uint8_t uuid[32] = {0};
char *pstart = NULL;
char *pEnd = NULL;
HAL_Execel_cmd(GET_CCUID_CMD,(char *)data,sizeof(data),&data_len);
printf("GET_CCUID_CMD:%s\n",data);
if(data_len > 0 && data_len <= 128){
pstart = data;
pEnd = strstr(data,"-");
if(pstart != NULL && pEnd != NULL){
memcpy(uuid,pstart,pEnd-pstart);
_setDevice_Code(uuid,pEnd-pstart);
}else{
return;
}
}else{
return ;
}
#else
uint8_t ccuid[DEVICE_CODE_LEN] = {0}; uint8_t ccuid[DEVICE_CODE_LEN] = {0};
uint8_t ccuidTmp[DEVICE_CODE_LEN] = {0}; uint8_t ccuidTmp[DEVICE_CODE_LEN] = {0};
int ccuid_len = 0; int ccuid_len = 0;
...@@ -108,6 +106,7 @@ static void kk_lan_ccuid_init(void) ...@@ -108,6 +106,7 @@ static void kk_lan_ccuid_init(void)
}else{ }else{
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID)); //_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
} }
#endif
} }
int prg_run_singleton(const char *prg) int prg_run_singleton(const char *prg)
...@@ -211,11 +210,11 @@ int main(int argc, char* argv[]) ...@@ -211,11 +210,11 @@ int main(int argc, char* argv[])
struct sigaction sa; struct sigaction sa;
/* setup alarm signal handler */ /* setup alarm signal handler */
#ifdef CONFIG_NX5_PLATFORM //#ifdef CONFIG_NX5_PLATFORM
for(int i=1;i<32;i++){ for(int i=1;i<32;i++){
signal(i, handler); signal(i, handler);
} }
#endif //#endif
//signal(SIGPIPE, SIG_IGN); //signal(SIGPIPE, SIG_IGN);
......
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
#define KK_CCU_VERSION "1.3.0" #define KK_CCU_VERSION "1.3.0"
#ifdef CONFIG_A133_PLATFORM
#define KK_VERSION_FILE_PATH "/data/local/kk/etc/VERSION"
#else
#define KK_VERSION_FILE_PATH "/app/ccuApps/VERSION" #define KK_VERSION_FILE_PATH "/app/ccuApps/VERSION"
#endif
#endif #endif
...@@ -483,7 +483,6 @@ void HAL_Reboot(void) ...@@ -483,7 +483,6 @@ void HAL_Reboot(void)
#define ROUTER_INFO_PATH "/proc/net/route" #define ROUTER_INFO_PATH "/proc/net/route"
#define ROUTER_RECORD_SIZE 256 #define ROUTER_RECORD_SIZE 256
static char *_get_default_routing_ifname(char *ifname, int ifname_size) static char *_get_default_routing_ifname(char *ifname, int ifname_size)
{ {
FILE *fp = NULL; FILE *fp = NULL;
...@@ -513,9 +512,11 @@ static char *_get_default_routing_ifname(char *ifname, int ifname_size) ...@@ -513,9 +512,11 @@ static char *_get_default_routing_ifname(char *ifname, int ifname_size)
perror("sscanf"); perror("sscanf");
continue; continue;
} }
/*default route */ /*default route */
if ((destination == 0) && (mask == 0)) { #ifndef CONFIG_A133_PLATFORM
if ((destination == 0) && (mask == 0))
#endif
{
strncpy(ifname, iface, ifname_size - 1); strncpy(ifname, iface, ifname_size - 1);
result = ifname; result = ifname;
break; break;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define KK_DEVICE_MAP_FILE_PATH "/data/local/kk/map/device_%s.json" #define KK_DEVICE_MAP_FILE_PATH "/data/local/kk/map/device_%s.json"
#define GET_CCUID_CMD "getprop ro.ccuinfo" #define GET_CCUID_CMD "getprop ro.ccuinfo"
#define GET_KEY_CMD "getprop ro.ccuinfo" #define GET_KEY_CMD "getprop ro.ccuinfo"
#define GET_PRODUCTID_CMD "getprop ro.product.ccu.pid"
#define KK_DB_FILE "/data/local/kk/etc/kk_database.db" #define KK_DB_FILE "/data/local/kk/etc/kk_database.db"
#define TSL_SUBDEVICE_PATH_FILE "/data/local/kk/tsl/product_%s.json" #define TSL_SUBDEVICE_PATH_FILE "/data/local/kk/tsl/product_%s.json"
#define TSL_GATEWAY_PATH_FILE "/data/local/kk/tsl/gateway_%s.json" #define TSL_GATEWAY_PATH_FILE "/data/local/kk/tsl/gateway_%s.json"
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
#define OTA_IMG_FILE "/data/local/OTA/app_squashfs.img" #define OTA_IMG_FILE "/data/local/OTA/app_squashfs.img"
#define OTA_IMG_FILE_MD5 "/data/local/OTA/app_squashfs.img.md5" #define OTA_IMG_FILE_MD5 "/data/local/OTA/app_squashfs.img.md5"
#define KK_CONFIG_FILE_PATH "/data/local/kk/kk_cloud_conf.json" #define KK_CONFIG_FILE_PATH "/data/local/kk/kk_cloud_conf.json"
#define KK_DEFAULT_CONFIG_FILE_PATH "/data/local/kk/cloud_default_config.json" #define KK_DEFAULT_CONFIG_FILE_PATH "/data/local/kk/etc/cloud_default_config.json"
#define KK_AUTH_CONFIG_FILE_PATH "/data/local/kk/auth_conf.json" #define KK_AUTH_CONFIG_FILE_PATH "/data/local/kk/auth_conf.json"
#else #else
#define KK_DEVICESECRET_PATH "/data/kk/kk_deviceSecret.txt" #define KK_DEVICESECRET_PATH "/data/kk/kk_deviceSecret.txt"
......
...@@ -115,7 +115,7 @@ int kk_area_init(void) ...@@ -115,7 +115,7 @@ int kk_area_init(void)
if(res != SUCCESS_RETURN){ if(res != SUCCESS_RETURN){
ERROR_PRINT("[%s][%d]kk_area_init FAIL!!!\n",__FUNCTION__,__LINE__); ERROR_PRINT("[%s][%d]kk_area_init FAIL!!!\n",__FUNCTION__,__LINE__);
} }
//kk_floor_add("默认","1");//创建默认楼层 kk_floor_add("默认","0");//创建默认楼层
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
static int kk_check_room_exist(const char *roomId) static int kk_check_room_exist(const char *roomId)
...@@ -157,7 +157,7 @@ static int _kk_room_add(const char *name,const char *roomId) ...@@ -157,7 +157,7 @@ static int _kk_room_add(const char *name,const char *roomId)
_kk_area_lock(); _kk_area_lock();
ctx->roomNum++; ctx->roomNum++;
sqlCmd = sqlite3_mprintf(insertCmd,name,roomId,-1,"1","默认"); sqlCmd = sqlite3_mprintf(insertCmd,name,roomId,-1,"0","默认");
res = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg); res = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( res != SQLITE_OK ){ if( res != SQLITE_OK ){
ERROR_PRINT("SQL error: %s\n", zErrMsg); ERROR_PRINT("SQL error: %s\n", zErrMsg);
...@@ -226,29 +226,29 @@ int kk_room_add(const char *name,const char *roomId) ...@@ -226,29 +226,29 @@ int kk_room_add(const char *name,const char *roomId)
} }
} }
int kk_get_roomname_by_id(const char *roomid,char *roomname,int len) int kk_get_floorname_by_id(const char *floorid,char *floorname,int len)
{ {
int isExist = 0; int isExist = 0;
sqlite3_stmt *stmt; sqlite3_stmt *stmt;
char *pRoomname = NULL; char *pFloorname = NULL;
kk_area_ctx_t *ctx = _kk_area_get_ctx(); kk_area_ctx_t *ctx = _kk_area_get_ctx();
char *sqlCmd = NULL; char *sqlCmd = NULL;
int tlen = 0; int tlen = 0;
if(roomname == NULL){ if(floorid == NULL){
return -1; return -1;
} }
_kk_area_lock(); _kk_area_lock();
sqlCmd = sqlite3_mprintf("select * from AreaInfo WHERE roomId= '%s'",roomid); sqlCmd = sqlite3_mprintf("select * from floorInfo WHERE floorId= '%s'",floorid);
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){
pRoomname = (char*)sqlite3_column_text(stmt, DB_ROOM_NAME); pFloorname = (char*)sqlite3_column_text(stmt, DB_FLOOR_NAME);
} if(pFloorname != NULL && strlen(pFloorname) > 0){
if(pRoomname != NULL && strlen(pRoomname) > 0){ tlen = strlen(pFloorname) > len?len:strlen(pFloorname);
tlen = strlen(pRoomname) > len?len:strlen(pRoomname); memcpy(floorname,pFloorname,strlen(pFloorname));
strncpy(roomname,pRoomname,tlen); }else{
}else{ memcpy(floorname,"",len);
strcpy(roomname,""); }
} }
sqlite3_finalize(stmt); sqlite3_finalize(stmt);
sqlite3_free(sqlCmd); sqlite3_free(sqlCmd);
...@@ -330,10 +330,13 @@ int kk_room_set_floor_info(const char*floorId,const char* floorName,const char * ...@@ -330,10 +330,13 @@ int kk_room_set_floor_info(const char*floorId,const char* floorName,const char *
int rc = 0; int rc = 0;
char *zErrMsg = 0; char *zErrMsg = 0;
kk_area_ctx_t *ctx = _kk_area_get_ctx(); kk_area_ctx_t *ctx = _kk_area_get_ctx();
if(strcmp(floorName,"") == 0){
_kk_area_lock(); char floorNameBuf[128] = {0};
printf("----------------------floorId:%s,floorName:%s,roomid:%s\n",floorId,floorName,roomid); kk_get_floorname_by_id(floorId,floorNameBuf,sizeof(floorNameBuf));
sqlCmd = sqlite3_mprintf("UPDATE AreaInfo SET floorId='%s',floorName='%s' WHERE roomId= '%s'",floorId,floorName,roomid); sqlCmd = sqlite3_mprintf("UPDATE AreaInfo SET floorId='%s',floorName='%s' WHERE roomId= '%s'",floorId,floorNameBuf,roomid);
}else{
sqlCmd = sqlite3_mprintf("UPDATE AreaInfo SET floorId='%s',floorName='%s' WHERE roomId= '%s'",floorId,floorName,roomid);
}
rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg); rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( rc != SQLITE_OK ){ if( rc != SQLITE_OK ){
ERROR_PRINT("SQL error: %s\n", zErrMsg); ERROR_PRINT("SQL error: %s\n", zErrMsg);
...@@ -342,7 +345,6 @@ int kk_room_set_floor_info(const char*floorId,const char* floorName,const char * ...@@ -342,7 +345,6 @@ int kk_room_set_floor_info(const char*floorId,const char* floorName,const char *
INFO_PRINT("Table updata data successfully\n"); INFO_PRINT("Table updata data successfully\n");
} }
sqlite3_free(sqlCmd); sqlite3_free(sqlCmd);
_kk_area_unlock();
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
int kk_set_floor_to_default(const char*floorId) int kk_set_floor_to_default(const char*floorId)
...@@ -353,7 +355,7 @@ int kk_set_floor_to_default(const char*floorId) ...@@ -353,7 +355,7 @@ int kk_set_floor_to_default(const char*floorId)
kk_area_ctx_t *ctx = _kk_area_get_ctx(); kk_area_ctx_t *ctx = _kk_area_get_ctx();
_kk_area_lock(); _kk_area_lock();
sqlCmd = sqlite3_mprintf("UPDATE AreaInfo SET floorId='%s',floorName='%s' WHERE floorId= '%s'","1","默认",floorId); sqlCmd = sqlite3_mprintf("UPDATE AreaInfo SET floorId='%s',floorName='%s' WHERE floorId= '%s'","0","默认",floorId);
rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg); rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( rc != SQLITE_OK ){ if( rc != SQLITE_OK ){
ERROR_PRINT("SQL error: %s\n", zErrMsg); ERROR_PRINT("SQL error: %s\n", zErrMsg);
......
...@@ -116,7 +116,15 @@ int iotx_dm_ccu_cloud_check(void) ...@@ -116,7 +116,15 @@ int iotx_dm_ccu_cloud_check(void)
_dm_api_unlock(); _dm_api_unlock();
return res; return res;
} }
int iotx_dm_ccu_cloudHB_check(void)
{
int res = 0;
_dm_api_lock();
res = dm_mgr_ccu_heartbeat_cloud(0);
_dm_api_unlock();
return res;
}
int iotx_dm_dev_online(_IN_ int devid) int iotx_dm_dev_online(_IN_ int devid)
{ {
int res = 0; int res = 0;
......
...@@ -140,12 +140,12 @@ static int _dm_init_tsl_params(kk_tsl_t * dev_shadow,char *deviceCode) ...@@ -140,12 +140,12 @@ static int _dm_init_tsl_params(kk_tsl_t * dev_shadow,char *deviceCode)
} }
/*******set MAC*************/ /*******set MAC*************/
HAL_Get_mac(s_mac); //HAL_Get_mac(s_mac);
res = kk_tsl_set_value(kk_tsl_set_property_value,dev_shadow,KK_TSL_GATAWAY_MAC_IDENTIFIER,NULL,s_mac); //res = kk_tsl_set_value(kk_tsl_set_property_value,dev_shadow,KK_TSL_GATAWAY_MAC_IDENTIFIER,NULL,s_mac);
if(res != SUCCESS_RETURN) //if(res != SUCCESS_RETURN)
{ //{
ERROR_PRINT("[%s][%d] res:%d\n",__FUNCTION__,__LINE__,res); //ERROR_PRINT("[%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
} //}
int wanState = 0; int wanState = 0;
res = kk_tsl_set_value(kk_tsl_set_property_value,dev_shadow,KK_TSL_CCU_WANSTATE_IDENTIFIER,&wanState,NULL); res = kk_tsl_set_value(kk_tsl_set_property_value,dev_shadow,KK_TSL_CCU_WANSTATE_IDENTIFIER,&wanState,NULL);
...@@ -161,12 +161,12 @@ static int _dm_init_tsl_params(kk_tsl_t * dev_shadow,char *deviceCode) ...@@ -161,12 +161,12 @@ static int _dm_init_tsl_params(kk_tsl_t * dev_shadow,char *deviceCode)
ERROR_PRINT("[%s][%d] res:%d\n",__FUNCTION__,__LINE__,res); ERROR_PRINT("[%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
} }
/*******set sn*************/ /*******set sn*************/
HAL_Get_SN(s_SN); //HAL_Get_SN(s_SN);
res = kk_tsl_set_value(kk_tsl_set_property_value,dev_shadow,KK_TSL_GATAWAY_SN_IDENTIFIER,NULL,s_SN); //res = kk_tsl_set_value(kk_tsl_set_property_value,dev_shadow,KK_TSL_GATAWAY_SN_IDENTIFIER,NULL,s_SN);
if(res != SUCCESS_RETURN) //if(res != SUCCESS_RETURN)
{ //{
ERROR_PRINT("[%s][%d] res:%d\n",__FUNCTION__,__LINE__,res); //ERROR_PRINT("[%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
} //}
char currentValue[16] = {0}; char currentValue[16] = {0};
kk_property_db_get_value(deviceCode,KK_TSL_CCU_ARMINGSTATE_IDENTIFIER,currentValue); kk_property_db_get_value(deviceCode,KK_TSL_CCU_ARMINGSTATE_IDENTIFIER,currentValue);
if(strlen(currentValue) == 0){ if(strlen(currentValue) == 0){
...@@ -257,6 +257,9 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA ...@@ -257,6 +257,9 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA
if (devid) { if (devid) {
*devid = node->devid; *devid = node->devid;
} }
if (mac != NULL) {
memcpy(node->mac, mac, strlen(mac));
}
return TSL_ALREADY_EXIST; return TSL_ALREADY_EXIST;
} }
...@@ -447,7 +450,6 @@ int dm_mgr_update_timestamp_by_devicecode(_IN_ char deviceCode[DEVICE_CODE_MAXLE ...@@ -447,7 +450,6 @@ int dm_mgr_update_timestamp_by_devicecode(_IN_ char deviceCode[DEVICE_CODE_MAXLE
{ {
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();
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 ((strlen(search_node->deviceCode) == strlen(deviceCode)) && if ((strlen(search_node->deviceCode) == strlen(deviceCode)) &&
...@@ -594,51 +596,7 @@ static void _dm_mgr_destroy_devlist(void) ...@@ -594,51 +596,7 @@ static void _dm_mgr_destroy_devlist(void)
free(del_node); free(del_node);
} }
} }
char s_pid[PRODUCT_CODE_LEN] = {0};
static int kk_pid_init(void)
{
#ifdef CONFIG_A133_PLATFORM
uint8_t data[128] = {0};
int data_len = 0;
char *pstart = NULL;
char *pEnd = NULL;
HAL_Execel_cmd(GET_CCUID_CMD,(char *)data,sizeof(data),&data_len);
printf("---GET_CCUID_CMD:%s\n",data);
if(data_len > 0 && data_len <= 128){
pstart = data;
pEnd = strstr(data,"pid_");
if(pstart != NULL && pEnd != NULL){
memcpy(s_pid,pEnd+4,data_len-1-(pEnd-pstart+4));
INFO_PRINT("kk_cloud_pid_init s_pid:%s\n",s_pid);
}else{
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
INFO_PRINT("KK_Ccuid_init get ccuid error\n");
return -1;
}
}else{
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
INFO_PRINT("KK_Ccuid_init get ccuid error\n");
return -1;
}
#else
char pid[PRODUCT_CODE_LEN] = {0};
int pid_len = 0;
HAL_Execel_cmd(GET_PRODUCTID_CMD,(char *)pid,sizeof(pid),&pid_len);
if(pid_len > 0 && pid_len <= PRODUCT_CODE_LEN){
memcpy(s_pid,pid,pid_len-1);
INFO_PRINT("s_pid:%s\n",s_pid);
}else{
return -1;
}
#endif
return 0;
}
int kk_get_pid(char *productId)
{
strncpy(productId, s_pid, strlen(s_pid));
printf("kk_lan_get_ccuid:%s\n",s_pid);
return strlen(s_pid);
}
extern char *kk_sync_get_info(); extern char *kk_sync_get_info();
int dm_mgr_init(void) int dm_mgr_init(void)
{ {
...@@ -646,10 +604,9 @@ int dm_mgr_init(void) ...@@ -646,10 +604,9 @@ int dm_mgr_init(void)
dm_mgr_ctx *ctx = _dm_mgr_get_ctx(); dm_mgr_ctx *ctx = _dm_mgr_get_ctx();
char mac[DEVICE_MAC_MAXLEN]= {0}; char mac[DEVICE_MAC_MAXLEN]= {0};
char ccuid[32] = {0}; char ccuid[32] = {0};
char pid[32] = {0};
int devId = 0,heartbeat = 0; int devId = 0,heartbeat = 0;
memset(ctx, 0, sizeof(dm_mgr_ctx)); memset(ctx, 0, sizeof(dm_mgr_ctx));
/* Create Mutex */ /* Create Mutex */
ctx->mutex = kk_MutexCreate(); ctx->mutex = kk_MutexCreate();
if (ctx->mutex == NULL) { if (ctx->mutex == NULL) {
...@@ -658,21 +615,19 @@ int dm_mgr_init(void) ...@@ -658,21 +615,19 @@ int dm_mgr_init(void)
/* Init Device Id*/ /* Init Device Id*/
ctx->global_devid = 1; ctx->global_devid = 1;
kk_property_db_init(); kk_property_db_init();
HAL_Get_ccuid(ccuid); HAL_Get_ccuid(ccuid);
kk_pid_init(); kk_get_pid(pid);
/* Init Device List */ /* Init Device List */
INIT_LIST_HEAD(&ctx->dev_list); INIT_LIST_HEAD(&ctx->dev_list);
HAL_Get_mac(mac); HAL_Get_mac(mac);
kk_sync_init(); kk_sync_init();
//kk_sync_get_info(); //kk_sync_get_info();
res = dm_mgr_device_create(KK_DM_DEVICE_CCU,s_pid,ccuid,mac,"",KK_DEV_UNKNOW,&devId,&heartbeat); res = dm_mgr_device_create(KK_DM_DEVICE_CCU,pid,ccuid,mac,"",KK_DEV_UNKNOW,&devId,&heartbeat);
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
goto ERROR; goto ERROR;
} }
else{ else{
kk_property_db_update(ccuid); kk_property_db_update(ccuid);
} }
return SUCCESS_RETURN; return SUCCESS_RETURN;
...@@ -1329,7 +1284,57 @@ int dm_mgr_upstream_thing_list_found(_IN_ int devid) ...@@ -1329,7 +1284,57 @@ int dm_mgr_upstream_thing_list_found(_IN_ int devid)
return res; return res;
} }
const char DM_URI_HB_CLOUD[] = "/thing/ccu/cloudHB";
int dm_mgr_ccu_heartbeat_cloud(_IN_ int devid)
{
int res = 0;
dm_mgr_dev_node_t *node = NULL;
//dm_mgr_dev_node_t *gw_node = NULL;
dm_msg_request_t request;
char msgId[MSG_MAX_LEN] = {0};
if (devid < 0) {
return INVALID_PARAMETER;
}
memset(&request, 0, sizeof(dm_msg_request_t));
res = dm_mgr_search_dev_by_devid(devid, &node);
if (res != SUCCESS_RETURN) {
return FAIL_RETURN;
}
memcpy(request.productCode,node->productCode,strlen(node->productCode));
memcpy(request.deviceCode,node->deviceCode,strlen(node->deviceCode));
request.msgTypeStr = (char*)DM_URI_HB_CLOUD;
/* Get Params And Method */
res = dm_msg_heartbeat_cloud( node->productCode, node->deviceCode, &request);
if (res != SUCCESS_RETURN) {
return FAIL_RETURN;
}
/* Get Msg ID */
iotx_report_id(msgId);
//sprintf(msgId,"%d",iotx_report_id());
memcpy(request.msgid,msgId,strlen(msgId));
/* Get Dev ID */
request.devid = devid;
/* Callback */
//request.callback = dm_client_combine_login_reply;
/* Send Message To Cloud */
res = dm_msg_request(&request,0);
free(request.params);
return res;
}
const char DM_URI_STATUS_CLOUD[] = "/thing/ccu/cloudstate"; const char DM_URI_STATUS_CLOUD[] = "/thing/ccu/cloudstate";
int dm_mgr_ccu_status_cloud(_IN_ int devid) int dm_mgr_ccu_status_cloud(_IN_ int devid)
{ {
......
...@@ -124,5 +124,7 @@ int dm_mgr_subdev_delete(_IN_ char deviceCode[DEVICE_CODE_MAXLEN]); ...@@ -124,5 +124,7 @@ int dm_mgr_subdev_delete(_IN_ char deviceCode[DEVICE_CODE_MAXLEN]);
int dm_msg_thing_property_post_all(char *deviceCode); int dm_msg_thing_property_post_all(char *deviceCode);
int dm_mgr_get_gw_deviceCode(_OU_ dm_mgr_dev_node_t **node); int dm_mgr_get_gw_deviceCode(_OU_ dm_mgr_dev_node_t **node);
void dm_mgr_resubscribe(void); void dm_mgr_resubscribe(void);
int kk_get_pid(char *productId); int kk_get_pid(char *productId);
int dm_mgr_ccu_heartbeat_cloud(_IN_ int devid);
#endif #endif
...@@ -13,6 +13,7 @@ const char DM_MSG_INFO[] DM_READ_ONLY = "{\"msgtype\":\"%s\",\"productCode\":\"% ...@@ -13,6 +13,7 @@ const char DM_MSG_INFO[] DM_READ_ONLY = "{\"msgtype\":\"%s\",\"productCode\":\"%
extern void kk_sendData2gw(void* data, int len, char* chalMark); 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;
int res = 0;
cJSON *root=cJSON_CreateObject(); cJSON *root=cJSON_CreateObject();
cJSON* infoObj = cJSON_Parse(info); cJSON* infoObj = cJSON_Parse(info);
cJSON* payloadObj = cJSON_Parse(payload); cJSON* payloadObj = cJSON_Parse(payload);
...@@ -24,7 +25,7 @@ void kk_sendData2app(void *info, void *payload,int isAsync){ ...@@ -24,7 +25,7 @@ void kk_sendData2app(void *info, void *payload,int isAsync){
dm_queue_msg_insert4(buf); dm_queue_msg_insert4(buf);
}else{ }else{
kk_ipc_send(IPC_MID2APP, buf, strlen(buf)+1 ); res = kk_ipc_send(IPC_MID2APP, buf, strlen(buf)+1 );
free(buf); free(buf);
} }
cJSON_Delete(root); cJSON_Delete(root);
...@@ -260,7 +261,39 @@ int dm_msg_thing_topo_delete(_IN_ char deviceCode[DEVICE_CODE_MAXLEN],_OU_ dm_ms ...@@ -260,7 +261,39 @@ int dm_msg_thing_topo_delete(_IN_ char deviceCode[DEVICE_CODE_MAXLEN],_OU_ dm_ms
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
const char DM_MSG_HB_CLOUD_METHOD[] DM_READ_ONLY = "thing.ccu.cloudHB";
const char DM_MSG_HB_CLOUD[] DM_READ_ONLY =
"{\"deviceCode\":\"%s\"}";
int dm_msg_heartbeat_cloud(_IN_ char productCode[PRODUCT_CODE_MAXLEN],
_IN_ char deviceCode[DEVICE_CODE_MAXLEN], _OU_ dm_msg_request_t *request)
{
char *params = NULL;
int params_len = 0;
if (request == NULL ||
deviceCode == NULL || productCode == NULL ||
(strlen(deviceCode) >= DEVICE_CODE_MAXLEN) ||
(strlen(productCode) >= PRODUCT_CODE_MAXLEN) ||
(strlen(request->deviceCode) >= DEVICE_CODE_MAXLEN)) {
return INVALID_PARAMETER;
}
/* Params */
request->method = (char *)DM_MSG_HB_CLOUD_METHOD;
params_len = strlen(DM_MSG_HB_CLOUD) + strlen(deviceCode) + 1;
params = malloc(params_len);
if (params == NULL) {
return DM_MEMORY_NOT_ENOUGH;
}
memset(params, 0, params_len);
HAL_Snprintf(params, params_len, DM_MSG_HB_CLOUD,deviceCode);
request->params = params;
request->params_len = strlen(request->params);
return SUCCESS_RETURN;
}
const char DM_MSG_STATUS_CLOUD_METHOD[] DM_READ_ONLY = "thing.ccu.cloudstate"; const char DM_MSG_STATUS_CLOUD_METHOD[] DM_READ_ONLY = "thing.ccu.cloudstate";
const char DM_MSG_STATUS_CLOUD[] DM_READ_ONLY = const char DM_MSG_STATUS_CLOUD[] DM_READ_ONLY =
"{\"deviceCode\":\"%s\"}"; "{\"deviceCode\":\"%s\"}";
......
...@@ -49,8 +49,10 @@ typedef struct { ...@@ -49,8 +49,10 @@ typedef struct {
#define KK_ONLINE_TOPIC_REPLY "/thing/status/online_reply" #define KK_ONLINE_TOPIC_REPLY "/thing/status/online_reply"
#define KK_THING_SERVICE_PROPERTY_SET "/thing/service/property/set" #define KK_THING_SERVICE_PROPERTY_SET "/thing/service/property/set"
#define KK_THING_SERVICE_PROPERTY_GET "/thing/service/property/get" #define KK_THING_SERVICE_PROPERTY_GET "/thing/service/property/get"
#define KK_THING_SERVICE_PROPERTY_GET_REPLY "/thing/service/property/get_reply"
#define KK_THING_OTA_DEVICE_UPGRADE "/thing/service/upgrade" #define KK_THING_OTA_DEVICE_UPGRADE "/thing/service/upgrade"
#define KK_THING_CLOUDSTATE_MSG "/thing/ccu/cloudstate_reply" #define KK_THING_CLOUDSTATE_MSG "/thing/ccu/cloudstate_reply"
#define KK_THING_CLOUDHB_MSG "/thing/ccu/cloudHB_reply"
#define KK_THING_TOPO_ADD_MSG "/thing/topo/add" #define KK_THING_TOPO_ADD_MSG "/thing/topo/add"
#define KK_THING_TOPO_BATCH_ADD_MSG "/thing/topo/batch_add" #define KK_THING_TOPO_BATCH_ADD_MSG "/thing/topo/batch_add"
#define KK_THING_PROPERTY_POST "property/post" #define KK_THING_PROPERTY_POST "property/post"
...@@ -60,8 +62,10 @@ typedef struct { ...@@ -60,8 +62,10 @@ typedef struct {
#define KK_THING_SERVICE_REBOOT "/thing/service/reboot" #define KK_THING_SERVICE_REBOOT "/thing/service/reboot"
#define KK_THING_SERVICE_ADDROOM "/thing/service/addRoom" #define KK_THING_SERVICE_ADDROOM "/thing/service/addRoom"
#define KK_THING_SERVICE_ADDROOM_REPLY "/thing/service/addRoom_reply" #define KK_THING_SERVICE_ADDROOM_REPLY "/thing/service/addRoom_reply"
#define KK_THING_SERVICE_UPDATEROOM "/thing/service/updateRoomName" #define KK_THING_SERVICE_UPDATEROOM "/thing/service/updateRoom"
#define KK_THING_SERVICE_UPDATEROOM_REPLY "/thing/service/updateRoomName_reply" #define KK_THING_SERVICE_UPDATEROOM_REPLY "/thing/service/updateRoom_reply"
#define KK_THING_SERVICE_UPDATEROOMNAME "/thing/service/updateRoomName"
#define KK_THING_SERVICE_UPDATEROOMNAME_REPLY "/thing/service/updateRoomName_reply"
#define KK_THING_SERVICE_DELETEROOM "/thing/service/deleteRoom" #define KK_THING_SERVICE_DELETEROOM "/thing/service/deleteRoom"
#define KK_THING_SERVICE_DELETEROOM_REPLY "/thing/service/deleteRoom_reply" #define KK_THING_SERVICE_DELETEROOM_REPLY "/thing/service/deleteRoom_reply"
#define KK_THING_SERVICE_ADDDEVICETOROOM "/thing/service/addDeviceToRoom" #define KK_THING_SERVICE_ADDDEVICETOROOM "/thing/service/addDeviceToRoom"
...@@ -182,6 +186,8 @@ int dm_msg_thing_syncinfopush_reply(void); ...@@ -182,6 +186,8 @@ int dm_msg_thing_syncinfopush_reply(void);
void kk_split(char *src,const char *separator,char **dest,int *num); void kk_split(char *src,const char *separator,char **dest,int *num);
int kk_msg_cloud_status_notify(char *deviceCode,const char *productCode); int kk_msg_cloud_status_notify(char *deviceCode,const char *productCode);
int dm_msg_thing_syncdeviceinfo_reply(cJSON *msgId); int dm_msg_thing_syncdeviceinfo_reply(cJSON *msgId);
int dm_msg_heartbeat_cloud(_IN_ char productCode[PRODUCT_CODE_MAXLEN],
_IN_ char deviceCode[DEVICE_CODE_MAXLEN], _OU_ dm_msg_request_t *request);
//const char DM_URI_SYS_PREFIX[] DM_READ_ONLY = "/sys/%s/%s/"; //const char DM_URI_SYS_PREFIX[] DM_READ_ONLY = "/sys/%s/%s/";
......
...@@ -219,7 +219,6 @@ int dm_queue_msg_insert(void *data) ...@@ -219,7 +219,6 @@ int dm_queue_msg_insert(void *data)
if (data == NULL) { if (data == NULL) {
return INVALID_PARAMETER; return INVALID_PARAMETER;
} }
_dm_queue_lock(); _dm_queue_lock();
if (ctx->msg_list.size >= ctx->msg_list.max_size) { if (ctx->msg_list.size >= ctx->msg_list.max_size) {
printf("dm queue list full"); printf("dm queue list full");
...@@ -251,9 +250,7 @@ int dm_queue_msg_next(void **data) ...@@ -251,9 +250,7 @@ int dm_queue_msg_next(void **data)
if (data == NULL || *data != NULL) { if (data == NULL || *data != NULL) {
return INVALID_PARAMETER; return INVALID_PARAMETER;
} }
_dm_queue_lock(); _dm_queue_lock();
if (list_empty(&ctx->msg_list.message_list)) { if (list_empty(&ctx->msg_list.message_list)) {
_dm_queue_unlock(); _dm_queue_unlock();
return FAIL_RETURN; return FAIL_RETURN;
......
...@@ -283,7 +283,6 @@ static void _iotx_linkkit_upstream_callback_remove(int msgid, int code) ...@@ -283,7 +283,6 @@ static void _iotx_linkkit_upstream_callback_remove(int msgid, int code)
#endif #endif
static int s_CloudStatus = 0; static int s_CloudStatus = 0;
static int s_CloudStatusRecv = 0; static int s_CloudStatusRecv = 0;
/************************************************************ /************************************************************
*功能描述:获取连云状态 *功能描述:获取连云状态
*输入参数:无 *输入参数:无
...@@ -433,7 +432,7 @@ static int kk_service_addRoom_reply(cJSON *param,cJSON *msgId,char *roomid,int t ...@@ -433,7 +432,7 @@ static int kk_service_addRoom_reply(cJSON *param,cJSON *msgId,char *roomid,int t
if( type == 0){ if( type == 0){
cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_SERVICE_ADDROOM_REPLY); cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_SERVICE_ADDROOM_REPLY);
}else{ }else{
cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_SERVICE_UPDATEROOM_REPLY); cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_SERVICE_UPDATEROOMNAME_REPLY);
} }
cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, deviceCode->valuestring); cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, deviceCode->valuestring);
cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, productCode->valuestring); cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, productCode->valuestring);
...@@ -484,13 +483,58 @@ static int kk_service_addRoom_handle(const char *deviceCode, cJSON *params,cJSON ...@@ -484,13 +483,58 @@ static int kk_service_addRoom_handle(const char *deviceCode, cJSON *params,cJSON
if(roomInfoStr == NULL){ if(roomInfoStr == NULL){
return FAIL_RETURN; return FAIL_RETURN;
} }
cJSON *floorId = cJSON_GetObjectItem(params, MSG_AREA_ROOM_FLOOR_ID);
if(floorId == NULL){
//return FAIL_RETURN;
}
//memcpy(roomId,roomIdStr->valuestring,strlen(roomIdStr->valuestring)); //memcpy(roomId,roomIdStr->valuestring,strlen(roomIdStr->valuestring));
HAL_GetTime_s((char*)roomId); HAL_GetTime_s((char*)roomId);
kk_room_add(roomInfoStr->valuestring,roomId); kk_room_add(roomInfoStr->valuestring,roomId);
kk_service_addRoom_reply(inforoot,msgid,roomId,0); kk_service_addRoom_reply(inforoot,msgid,roomId,0);
kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_AREA_ADDROOM_NOTIFICATION_ROOMID,NULL,roomId); kk_tsl_set_value(kk_tsl_set_event_output_value,node->dev_shadow,MSG_AREA_ADDROOM_NOTIFICATION_ROOMID,NULL,roomId);
if(floorId != NULL){
kk_room_set_floor_info(floorId->valuestring,"",roomId);
}
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
static int kk_service_common_reply(cJSON *param,cJSON *msgId,char *msgType)
{
int res = 0;
int i = 0,num = 0;
SensorType_t *pList = NULL;
char version[VERSION_MAXLEN] = {0};
if(param == NULL || msgId == NULL){
return INVALID_PARAMETER;
}
cJSON *deviceCode = cJSON_GetObjectItem(param, MSG_DEVICE_CODE_STR);
if(deviceCode == NULL){
return FAIL_RETURN;
}
cJSON *productCode = cJSON_GetObjectItem(param, MSG_PRODUCT_CODE_STR);
if(productCode == NULL){
return FAIL_RETURN;
}
cJSON *info = cJSON_CreateObject();
cJSON_AddStringToObject(info, MSG_TYPE_STR, msgType);
cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, deviceCode->valuestring);
cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, productCode->valuestring);
char *infff=cJSON_Print(info);
cJSON *payload = cJSON_CreateObject();
cJSON_AddStringToObject(payload, "desc", "success");
cJSON_AddStringToObject(payload, "version", "1.0");
cJSON_AddStringToObject(payload, "code", "0");
cJSON_AddStringToObject(payload, "msgId", msgId->valuestring);
cJSON *Item = cJSON_CreateObject();
cJSON_AddItemToObject(payload, "params", Item);
char *payload11=cJSON_Print(payload);
kk_sendData2app(infff,payload11,0);
free(payload11);
free(infff);
cJSON_Delete(payload);
cJSON_Delete(info);
return res;
}
/************************************************************ /************************************************************
*功能描述:更新房间处理函数 *功能描述:更新房间处理函数
*输入参数:params:云端传下来JSON数据,主要包含房间名称 *输入参数:params:云端传下来JSON数据,主要包含房间名称
...@@ -514,8 +558,15 @@ static int kk_service_updateRoom_handle(const char *deviceCode, cJSON *params,cJ ...@@ -514,8 +558,15 @@ static int kk_service_updateRoom_handle(const char *deviceCode, cJSON *params,cJ
//memcpy(roomId,roomIdStr->valuestring,strlen(roomIdStr->valuestring)); //memcpy(roomId,roomIdStr->valuestring,strlen(roomIdStr->valuestring));
//INFO_PRINT(" update room 111!!! %s.%s\n",roomInfoStr->valuestring,roomIdStr->valuestring); //INFO_PRINT(" update room 111!!! %s.%s\n",roomInfoStr->valuestring,roomIdStr->valuestring);
kk_room_add(roomInfoStr->valuestring,roomIdStr->valuestring); kk_room_add(roomInfoStr->valuestring,roomIdStr->valuestring);
cJSON *floorId = cJSON_GetObjectItem(params, MSG_AREA_ROOM_FLOOR_ID);
if(floorId == NULL){
kk_service_addRoom_reply(inforoot,msgid,roomIdStr->valuestring,1);
}else{
kk_room_set_floor_info(floorId->valuestring,"",roomIdStr->valuestring);
kk_service_common_reply(inforoot,msgid,KK_THING_SERVICE_UPDATEROOM_REPLY);
}
//INFO_PRINT(" update room 111!!!\n"); //INFO_PRINT(" update room 111!!!\n");
kk_service_addRoom_reply(inforoot,msgid,roomIdStr->valuestring,1);
//INFO_PRINT(" update room 111!!!\n"); //INFO_PRINT(" update room 111!!!\n");
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
...@@ -815,7 +866,7 @@ static int kk_service_setFloor_handle(cJSON *params) ...@@ -815,7 +866,7 @@ static int kk_service_setFloor_handle(cJSON *params)
if(roomid == NULL){ if(roomid == NULL){
return INVALID_PARAMETER; return INVALID_PARAMETER;
} }
kk_room_set_floor_info(floorId->valuestring,name->valuestring,roomid->valuestring); kk_room_set_floor_info(floorId->valuestring,"",roomid->valuestring);
itemroom = itemroom->next; itemroom = itemroom->next;
} }
item = item->next; item = item->next;
...@@ -1076,13 +1127,29 @@ static int kk_service_client_online_push(cJSON *param,cJSON *msgId,char *serialI ...@@ -1076,13 +1127,29 @@ static int kk_service_client_online_push(cJSON *param,cJSON *msgId,char *serialI
*返 回 值: 0:成功;其他:失败 *返 回 值: 0:成功;其他:失败
*其他说明: *其他说明:
*************************************************************/ *************************************************************/
static void kk_strdel(char* s,char del_x)
{
char *p;
char *q;
for(p=s,q=s;*p!='\0';p++)
if(*p!=del_x)
*q++=*p;
*q=*p;
}
static int kk_service_addScreen_handle(cJSON *info,cJSON *msgId,cJSON *params) static int kk_service_addScreen_handle(cJSON *info,cJSON *msgId,cJSON *params)
{ {
char str_mac[32] = {0};
if(params == NULL){ if(params == NULL){
return INVALID_PARAMETER; return INVALID_PARAMETER;
} }
cJSON *mac = cJSON_GetObjectItem(params,MSG_DEVICE_MAC); cJSON *mac = cJSON_GetObjectItem(params,MSG_DEVICE_MAC);
if(mac == NULL) return INVALID_PARAMETER; if(mac == NULL) return INVALID_PARAMETER;
strcpy(str_mac,mac->valuestring);
kk_strdel(str_mac,':');
cJSON *ip = cJSON_GetObjectItem(params,MSG_DEVICE_IP); cJSON *ip = cJSON_GetObjectItem(params,MSG_DEVICE_IP);
if(ip == NULL) return INVALID_PARAMETER; if(ip == NULL) return INVALID_PARAMETER;
cJSON *version = cJSON_GetObjectItem(params,MSG_DEVICE_VERSION); cJSON *version = cJSON_GetObjectItem(params,MSG_DEVICE_VERSION);
...@@ -1090,11 +1157,13 @@ static int kk_service_addScreen_handle(cJSON *info,cJSON *msgId,cJSON *params) ...@@ -1090,11 +1157,13 @@ static int kk_service_addScreen_handle(cJSON *info,cJSON *msgId,cJSON *params)
cJSON *serialid = cJSON_GetObjectItem(params,MSG_DEVICE_SERIALID); cJSON *serialid = cJSON_GetObjectItem(params,MSG_DEVICE_SERIALID);
if(serialid == NULL) return INVALID_PARAMETER; if(serialid == NULL) return INVALID_PARAMETER;
cJSON *devtype = cJSON_GetObjectItem(params,MSG_DEVICE_TYPE); cJSON *devtype = cJSON_GetObjectItem(params,MSG_DEVICE_TYPE);
if(devtype == NULL) return INVALID_PARAMETER; if(devtype == NULL) return INVALID_PARAMETER;
cJSON *expand = cJSON_GetObjectItem(params,MSG_DEVICE_EXPAND); kk_service_addScreen_handle_reply(info,msgId,serialid->valuestring);
if(expand == NULL) return INVALID_PARAMETER; #ifdef CONFIG_A133_PLATFORM
kk_service_addScreen_handle_reply(info,msgId,serialid->valuestring); kk_screenDev_insert_db(devtype->valueint,serialid->valuestring,ip->valuestring,str_mac,version->valuestring,"");
kk_screenDev_insert_db(devtype->valueint,serialid->valuestring,ip->valuestring,mac->valuestring,version->valuestring,expand->valuestring); #else
kk_screenDev_insert_db(devtype->valueint,serialid->valuestring,ip->valuestring,&str_mac[4],version->valuestring,"");
#endif
kk_service_client_online_push(info,msgId,serialid->valuestring); kk_service_client_online_push(info,msgId,serialid->valuestring);
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
...@@ -1108,18 +1177,23 @@ static int kk_service_addScreen_handle(cJSON *info,cJSON *msgId,cJSON *params) ...@@ -1108,18 +1177,23 @@ static int kk_service_addScreen_handle(cJSON *info,cJSON *msgId,cJSON *params)
*************************************************************/ *************************************************************/
static int kk_service_addScreenToRoom_handle(cJSON *params) static int kk_service_addScreenToRoom_handle(cJSON *params)
{ {
char str_mac[32] = {0};
if(params == NULL){ if(params == NULL){
return INVALID_PARAMETER; return INVALID_PARAMETER;
} }
cJSON *serialid = cJSON_GetObjectItem(params,MSG_DEVICE_DEVICEINFO); cJSON *mac = cJSON_GetObjectItem(params,MSG_DEVICE_DEVICEINFO);
if(serialid == NULL) return INVALID_PARAMETER; if(mac == NULL) return INVALID_PARAMETER;
strcpy(str_mac,mac->valuestring);
cJSON *roomname = cJSON_GetObjectItem(params,MSG_AREA_ADDROOM_ROOMNAME); cJSON *roomname = cJSON_GetObjectItem(params,MSG_AREA_ADDROOM_ROOMNAME);
if(roomname == NULL) return INVALID_PARAMETER; if(roomname == NULL) return INVALID_PARAMETER;
cJSON *roomId = cJSON_GetObjectItem(params,MSG_AREA_ROOM_CCUROOMID); cJSON *roomId = cJSON_GetObjectItem(params,MSG_AREA_ROOM_CCUROOMID);
if(roomId == NULL) return INVALID_PARAMETER; if(roomId == NULL) return INVALID_PARAMETER;
cJSON *name = cJSON_GetObjectItem(params,MSG_AREA_ADDROOM_DEVICENAME); cJSON *name = cJSON_GetObjectItem(params,MSG_AREA_ADDROOM_DEVICENAME);
if(name == NULL) return INVALID_PARAMETER; if(name == NULL) return INVALID_PARAMETER;
kk_screenDev_update_room(serialid->valuestring,roomId->valuestring,roomname->valuestring,name->valuestring); #ifdef CONFIG_A133_PLATFORM
#else
kk_screenDev_update_room(str_mac,roomId->valuestring,roomname->valuestring,name->valuestring);
#endif
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
/************************************************************ /************************************************************
...@@ -1522,44 +1596,7 @@ static int kk_service_getCCUVersion_handle(cJSON *param,cJSON *msgId) ...@@ -1522,44 +1596,7 @@ static int kk_service_getCCUVersion_handle(cJSON *param,cJSON *msgId)
cJSON_Delete(info); cJSON_Delete(info);
return res; return res;
} }
static int kk_service_common_reply(cJSON *param,cJSON *msgId,char *msgType)
{
int res = 0;
int i = 0,num = 0;
SensorType_t *pList = NULL;
char version[VERSION_MAXLEN] = {0};
if(param == NULL || msgId == NULL){
return INVALID_PARAMETER;
}
cJSON *deviceCode = cJSON_GetObjectItem(param, MSG_DEVICE_CODE_STR);
if(deviceCode == NULL){
return FAIL_RETURN;
}
cJSON *productCode = cJSON_GetObjectItem(param, MSG_PRODUCT_CODE_STR);
if(productCode == NULL){
return FAIL_RETURN;
}
cJSON *info = cJSON_CreateObject();
cJSON_AddStringToObject(info, MSG_TYPE_STR, msgType);
cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, deviceCode->valuestring);
cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, productCode->valuestring);
char *infff=cJSON_Print(info);
cJSON *payload = cJSON_CreateObject();
cJSON_AddStringToObject(payload, "desc", "success");
cJSON_AddStringToObject(payload, "version", "1.0");
cJSON_AddStringToObject(payload, "code", "0");
cJSON_AddStringToObject(payload, "msgId", msgId->valuestring);
cJSON *Item = cJSON_CreateObject();
cJSON_AddItemToObject(payload, "params", Item);
char *payload11=cJSON_Print(payload);
kk_sendData2app(infff,payload11,0);
free(payload11);
free(infff);
cJSON_Delete(payload);
cJSON_Delete(info);
return res;
}
/************************************************************ /************************************************************
*功能描述:获取主机版本信息 *功能描述:获取主机版本信息
*输入参数:params:云端下发数据,包含场景Id等 *输入参数:params:云端下发数据,包含场景Id等
...@@ -1878,13 +1915,15 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data) ...@@ -1878,13 +1915,15 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
} }
kk_service_arming_set(state->valuestring); kk_service_arming_set(state->valuestring);
} }
}else if (strstr(typeJson->valuestring,KK_THING_CLOUDSTATE_MSG)){ }
else if (strstr(typeJson->valuestring,KK_THING_CLOUDSTATE_MSG)){
INFO_PRINT("cloud state notify \n"); INFO_PRINT("cloud state notify \n");
char ccuid[32] = {0}; char ccuid[32] = {0};
static time_t s_last_notify_time = 0;
s_CloudStatusRecv = 1; s_CloudStatusRecv = 1;
cJSON *paramStr = cJSON_GetObjectItem(payload, MSG_PARAMS_STR); cJSON *paramStr = cJSON_GetObjectItem(payload, MSG_PARAMS_STR);
cJSON *state = cJSON_GetObjectItem(paramStr, MSG_IOTClOUDSTATE_STR); cJSON *state = cJSON_GetObjectItem(paramStr, MSG_IOTClOUDSTATE_STR);
s_CloudStatus = atoi(state->valuestring);
dm_mgr_dev_node_t *node = NULL; dm_mgr_dev_node_t *node = NULL;
dm_mgr_search_dev_by_devid(KK_DM_DEVICE_CCU_DEVICEID,&node); dm_mgr_search_dev_by_devid(KK_DM_DEVICE_CCU_DEVICEID,&node);
...@@ -1901,8 +1940,11 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data) ...@@ -1901,8 +1940,11 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
} }
HAL_Get_ccuid(ccuid); HAL_Get_ccuid(ccuid);
kk_property_db_update(ccuid); kk_property_db_update(ccuid);
if(s_CloudStatus == 1){
if(s_CloudStatus != atoi(state->valuestring) && atoi(state->valuestring) == 1){ if((HAL_Uptimes() - s_last_notify_time <= 60 && s_last_notify_time != 0)){
ERROR_PRINT("[%s][%d] ignore this notify\n",__FUNCTION__,__LINE__);
goto directReturn;
}
node->isOffline = KK_DEV_ONLINE; node->isOffline = KK_DEV_ONLINE;
dm_mgr_upstream_thing_sub_register(KK_DM_DEVICE_CCU_DEVICEID); dm_mgr_upstream_thing_sub_register(KK_DM_DEVICE_CCU_DEVICEID);
iotx_dm_dev_online(KK_DM_DEVICE_CCU_DEVICEID);//first online,report the online status iotx_dm_dev_online(KK_DM_DEVICE_CCU_DEVICEID);//first online,report the online status
...@@ -1910,8 +1952,8 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data) ...@@ -1910,8 +1952,8 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
kk_subDev_check_auth(KK_DM_DEVICE_GATEWAY); kk_subDev_check_auth(KK_DM_DEVICE_GATEWAY);
dm_msg_ccu_property_post(node); dm_msg_ccu_property_post(node);
dm_mgr_resubscribe(); dm_mgr_resubscribe();
s_last_notify_time = HAL_Uptimes();
} }
s_CloudStatus = atoi(state->valuestring);
}else if (strcmp(typeJson->valuestring,"/upgrade") == 0){ }else if (strcmp(typeJson->valuestring,"/upgrade") == 0){
INFO_PRINT("ota upgrade... \n"); INFO_PRINT("ota upgrade... \n");
char tmp[256] = {0}; char tmp[256] = {0};
...@@ -1944,6 +1986,13 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data) ...@@ -1944,6 +1986,13 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
kk_service_updateRoom_handle(deviceCode->valuestring,paramStr,info_root,msgId); kk_service_updateRoom_handle(deviceCode->valuestring,paramStr,info_root,msgId);
//dm_msg_thing_event_post(deviceCode->valuestring,MSG_AREA_ADDROOM_NOTIFICATION,msgId->valuestring); //dm_msg_thing_event_post(deviceCode->valuestring,MSG_AREA_ADDROOM_NOTIFICATION,msgId->valuestring);
} }
else if(strcmp(typeJson->valuestring,KK_THING_SERVICE_UPDATEROOMNAME) == 0){
INFO_PRINT(" update roomname!!!\n");
cJSON *paramStr = cJSON_GetObjectItem(payload, MSG_PARAMS_STR);
cJSON *msgId = cJSON_GetObjectItem(payload, MSG_COMMON_MSGID);
kk_service_updateRoom_handle(deviceCode->valuestring,paramStr,info_root,msgId);
//dm_msg_thing_event_post(deviceCode->valuestring,MSG_AREA_ADDROOM_NOTIFICATION,msgId->valuestring);
}
else if(strcmp(typeJson->valuestring,KK_THING_SERVICE_DELETEROOM) == 0){ else if(strcmp(typeJson->valuestring,KK_THING_SERVICE_DELETEROOM) == 0){
INFO_PRINT(" delete room \n"); INFO_PRINT(" delete room \n");
cJSON *paramStr = cJSON_GetObjectItem(payload, MSG_PARAMS_STR); cJSON *paramStr = cJSON_GetObjectItem(payload, MSG_PARAMS_STR);
......
/************************************************************
*版权所有 (C)2020,公司(或个人)名称
*
*文件名称: kk_property_get_handle.c
*内容摘要: 数据get处理相关
*其他说明:
*当前版本:
*************************************************************/
#include <stdio.h>
#include <string.h>
#include "kk_tsl_api.h"
#include "kk_sync_data.h"
#include "kk_dm_mng.h"
#include "kk_scene_handle.h"
#include "kk_scene_db.h"
#include "sqlite3.h"
#include "kk_log.h"
#include "cJSON.h"
#include "kk_property_db.h"
#include "kk_tsl_api.h"
#include "kk_sub_db.h"
#include "kk_hal.h"
#include "kk_dm_msg.h"
#include "kk_linkkit.h"
static int kk_service_get_reply(char *deviceCode,char *productCode,char *msgId,double param1,double param2,double param3,int epNum,char *type)
{
if(deviceCode == NULL || productCode == NULL){
return INVALID_PARAMETER;
}
cJSON *info = cJSON_CreateObject();
cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_SERVICE_PROPERTY_GET_REPLY);
cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, deviceCode);
cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, productCode);
char *infff=cJSON_Print(info);
cJSON *payload = cJSON_CreateObject();
cJSON_AddStringToObject(payload, "desc", "success");
cJSON_AddStringToObject(payload, "version", "1.0");
cJSON_AddStringToObject(payload, "code", "0");
cJSON_AddStringToObject(payload, "msgId", msgId);
cJSON *paramInfo = cJSON_CreateObject();
if(strcmp(type,"ColorTempSwitch") == 0){
cJSON_AddNumberToObject(paramInfo, "ColorTempSwitch", (int)param1);
}else if(strcmp(type,"FadeTime") == 0){
cJSON_AddNumberToObject(paramInfo, "FadeTime", (int)param1);
cJSON_AddNumberToObject(paramInfo, "LowBrightness", (int)param2);
cJSON_AddNumberToObject(paramInfo, "HighBrightness", (int)param3);
}else if(strcmp(type,"Power") == 0){
cJSON_AddNumberToObject(paramInfo, "data", (double)param1);
}else if(strcmp(type,"ChildLockState") == 0){
cJSON_AddNumberToObject(paramInfo, "ChildLockState", (int)param1);
}else if(strcmp(type,"PowerDownSave") == 0){
cJSON_AddNumberToObject(paramInfo, "PowerMemory", (int)param1);
cJSON_AddNumberToObject(paramInfo, "Mode", (int)1);
}else if(strcmp(type,"Screensaver") == 0){
cJSON_AddNumberToObject(paramInfo, "Screensaver", (int)param1);
}else if(strcmp(type,"TripTime") == 0){
cJSON_AddNumberToObject(paramInfo, "TripTime", (int)param1);
}else if(strcmp(type,"SwapState") == 0){
cJSON_AddNumberToObject(paramInfo, "SwapState", (int)param1);
}else if(strcmp(type,"remoteOpenDoor") == 0){
cJSON_AddNumberToObject(paramInfo, "RemoteOpenDoor", (int)param1);
}
cJSON_AddNumberToObject(paramInfo, "epNum", epNum);
cJSON_AddItemToObject(payload, "params", paramInfo);
char *payload11=cJSON_Print(payload);
kk_sendData2app(infff,payload11,0);
free(payload11);
free(infff);
cJSON_Delete(payload);
cJSON_Delete(info);
return SUCCESS_RETURN;
}
static int kk_check_muti_device(dm_mgr_dev_node_t *node)
{
int idx = 0;
int num = 0;
int mutiDev = 0;
kk_tsl_data_t *property = NULL;
char *propertiesbuf[64] = {0};
char propertiesTmp[64] = {0};
for(idx = 0; idx < node->dev_shadow->property_number; idx++){
property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx);
if(property == NULL){
continue;
}
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
memcpy(propertiesTmp,property->identifier,strlen(property->identifier));
kk_split(propertiesTmp,"_",propertiesbuf,&num);
if(num == 2){
return 1;
}
break;
}
return 0;
}
static int kk_property_FadeAndRange_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int FadeTime = 0;
int LowBrightness = 0;
dm_mgr_dev_node_t *node = NULL;
int HighBrightness = 0;
char propertiesTmp[64] = {0};
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"FadeTime_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&FadeTime);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"LowBrightness_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&LowBrightness);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"HighBrightness_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&HighBrightness);
}else{
kk_property_db_get_value(deviceCode,"FadeTime",&FadeTime);
kk_property_db_get_value(deviceCode,"LowBrightness",&LowBrightness);
kk_property_db_get_value(deviceCode,"HighBrightness",&HighBrightness);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,FadeTime,LowBrightness,HighBrightness,epNum,"FadeTime");
return SUCCESS_RETURN;
}
static int kk_property_LightProperty_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int ColorTempSwitch = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"ColorTempSwitch_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&ColorTempSwitch);
}else{
kk_property_db_get_value(deviceCode,"ColorTempSwitch",&ColorTempSwitch);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,ColorTempSwitch,-1,-1,epNum,"ColorTempSwitch");
return SUCCESS_RETURN;
}
static int kk_property_AirSwitchConfig_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int OverloadCurrent = 0;
int ExcessiveTemperature = 0;
int SwitchEnable = 0;
int BreakTime = 0;
int RatedVoltage = 0;
int RatedCurrent = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"OverloadCurrent_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&OverloadCurrent);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"ExcessiveTemperature_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&ExcessiveTemperature);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"SwitchEnable_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&SwitchEnable);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"BreakTime_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&BreakTime);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"RatedVoltage_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&RatedVoltage);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"RatedCurrent_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&RatedCurrent);
}else{
kk_property_db_get_value(deviceCode,"OverloadCurrent",&OverloadCurrent);
kk_property_db_get_value(deviceCode,"ExcessiveTemperature",&ExcessiveTemperature);
kk_property_db_get_value(deviceCode,"SwitchEnable",&SwitchEnable);
kk_property_db_get_value(deviceCode,"BreakTime",&BreakTime);
kk_property_db_get_value(deviceCode,"RatedVoltage",&RatedVoltage);
kk_property_db_get_value(deviceCode,"RatedCurrent",&RatedCurrent);
}
cJSON *info = cJSON_CreateObject();
cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_SERVICE_PROPERTY_GET_REPLY);
cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, deviceCode);
cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, node->productCode);
char *infff=cJSON_Print(info);
cJSON *payload = cJSON_CreateObject();
cJSON_AddStringToObject(payload, "desc", "success");
cJSON_AddStringToObject(payload, "version", "1.0");
cJSON_AddStringToObject(payload, "code", "0");
cJSON_AddStringToObject(payload, "msgId", msgid);
cJSON *paramInfo = cJSON_CreateObject();
cJSON_AddNumberToObject(paramInfo, "OverloadCurrent", OverloadCurrent);
cJSON_AddNumberToObject(paramInfo, "ExcessiveTemperature", ExcessiveTemperature);
cJSON_AddNumberToObject(paramInfo, "SwitchEnable", SwitchEnable);
cJSON_AddNumberToObject(paramInfo, "BreakTime", BreakTime);
cJSON_AddNumberToObject(paramInfo, "RatedVoltage", RatedVoltage);
cJSON_AddNumberToObject(paramInfo, "RatedCurrent", RatedCurrent);
cJSON_AddStringToObject(paramInfo, "DevModel", "UNKNOWN");
cJSON_AddStringToObject(paramInfo, "DevVersion", "1.0.0");
cJSON_AddNumberToObject(paramInfo, "epNum", epNum);
cJSON_AddItemToObject(payload, "params", paramInfo);
char *payload11=cJSON_Print(payload);
kk_sendData2app(infff,payload11,0);
free(payload11);
free(infff);
cJSON_Delete(payload);
cJSON_Delete(info);
return SUCCESS_RETURN;
}
static int kk_property_SocketRealTimePower_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
double Power = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"Power_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&Power);
}else{
kk_property_db_get_value(deviceCode,"Power",&Power);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,Power,-1,-1,epNum,"Power");
return SUCCESS_RETURN;
}
static int kk_property_DeviceStatus_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int WorkMode = 0;
int WindSpeed = 0;
int PowerSwitch = 0;
int StrainerAlarmTime = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"WorkMode_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&WorkMode);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"WindSpeed_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&WindSpeed);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"PowerSwitch_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&PowerSwitch);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"StrainerAlarmTime_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&StrainerAlarmTime);
}else{
kk_property_db_get_value(deviceCode,"WorkMode",&WorkMode);
kk_property_db_get_value(deviceCode,"WindSpeed",&WindSpeed);
kk_property_db_get_value(deviceCode,"PowerSwitch",&PowerSwitch);
kk_property_db_get_value(deviceCode,"StrainerAlarmTime",&StrainerAlarmTime);
}
cJSON *info = cJSON_CreateObject();
cJSON_AddStringToObject(info, MSG_TYPE_STR, KK_THING_SERVICE_PROPERTY_GET_REPLY);
cJSON_AddStringToObject(info, MSG_DEVICE_CODE_STR, deviceCode);
cJSON_AddStringToObject(info, MSG_PRODUCT_CODE_STR, node->productCode);
char *infff=cJSON_Print(info);
cJSON *payload = cJSON_CreateObject();
cJSON_AddStringToObject(payload, "desc", "success");
cJSON_AddStringToObject(payload, "version", "1.0");
cJSON_AddStringToObject(payload, "code", "0");
cJSON_AddStringToObject(payload, "msgId", msgid);
cJSON *paramInfo = cJSON_CreateObject();
cJSON_AddNumberToObject(paramInfo, "WorkMode", WorkMode);
cJSON_AddNumberToObject(paramInfo, "WindSpeed", WindSpeed);
cJSON_AddNumberToObject(paramInfo, "PowerSwitch", PowerSwitch);
cJSON_AddNumberToObject(paramInfo, "StrainerAlarmTime", StrainerAlarmTime);
cJSON_AddNumberToObject(paramInfo, "epNum", epNum);
cJSON_AddItemToObject(payload, "params", paramInfo);
char *payload11=cJSON_Print(payload);
kk_sendData2app(infff,payload11,0);
free(payload11);
free(infff);
cJSON_Delete(payload);
cJSON_Delete(info);
return SUCCESS_RETURN;
}
static int kk_property_ChildLockState_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int ChildLockState = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"ChildLockState_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&ChildLockState);
}else{
kk_property_db_get_value(deviceCode,"ChildLockState",&ChildLockState);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,ChildLockState,-1,-1,epNum,"ChildLockState");
return SUCCESS_RETURN;
}
static int kk_property_WaterValveArgs_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int PowerDownSave = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"PowerDownSave_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&PowerDownSave);
}else{
kk_property_db_get_value(deviceCode,"PowerDownSave",&PowerDownSave);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,PowerDownSave,1,-1,epNum,"PowerDownSave");
return SUCCESS_RETURN;
}
static int kk_property_Screensaver_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int Screensaver = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"Screensaver_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&Screensaver);
}else{
kk_property_db_get_value(deviceCode,"Screensaver",&Screensaver);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,Screensaver,-1,-1,epNum,"Screensaver");
return SUCCESS_RETURN;
}
static int kk_property_RunTime_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int TripTime = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"TripTime_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&TripTime);
}else{
kk_property_db_get_value(deviceCode,"TripTime",&TripTime);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,TripTime,-1,-1,epNum,"TripTime");
return SUCCESS_RETURN;
}
static int kk_property_SwapState_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int SwapState = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"SwapState_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&SwapState);
}else{
kk_property_db_get_value(deviceCode,"SwapState",&SwapState);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,SwapState,-1,-1,epNum,"SwapState");
return SUCCESS_RETURN;
}
static int kk_property_remoteOpenDoor_handle(char *deviceCode,int epNum,char *msgid)
{
int res = 0;
int mutiDev = 0;
int remoteOpenDoor = 0;
char propertiesTmp[64] = {0};
dm_mgr_dev_node_t *node = NULL;
res = dm_mgr_get_device_by_devicecode((char*)deviceCode,&node);
if (res != SUCCESS_RETURN) {
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return FAIL_RETURN;
}
mutiDev = kk_check_muti_device(node);
if(mutiDev){
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
sprintf(propertiesTmp,"remoteOpenDoorSwitch_%d",epNum);
kk_property_db_get_value(deviceCode,propertiesTmp,&remoteOpenDoor);
}else{
kk_property_db_get_value(deviceCode,"remoteOpenDoorSwitch",&remoteOpenDoor);
}
kk_service_get_reply(deviceCode,node->productCode,msgid,remoteOpenDoor,-1,-1,epNum,"remoteOpenDoor");
return SUCCESS_RETURN;
}
int kk_property_get_handle(cJSON * payload,char *deviceCode)
{
cJSON *params = NULL;
cJSON *propertyItem = NULL;
cJSON *epNum = NULL;
cJSON *msgId = NULL;
int epNumInt = 1;
int res = 0;
int idx = 0;
int value = 0;
int iCnt = 0;
if(payload == NULL || deviceCode == NULL){
return FAIL_RETURN;
}
msgId = cJSON_GetObjectItem(payload, MSG_COMMON_MSGID);
if(msgId == NULL){
return FAIL_RETURN;
}
params = cJSON_GetObjectItem(payload, MSG_PARAMS_STR);
if(params != NULL){
epNum = cJSON_GetObjectItem(params, "epNum");
if(epNum != NULL){
epNumInt = epNum->valueint;
}else{
epNumInt = 1;
}
cJSON* propertyIdentifier = cJSON_GetObjectItem(params, "propertyIdentifier");
if(propertyIdentifier == NULL){
return FAIL_RETURN;
}
int array_size = cJSON_GetArraySize(propertyIdentifier);
for( iCnt = 0 ; iCnt < array_size ; iCnt ++ ){
cJSON * pSub = cJSON_GetArrayItem(propertyIdentifier, iCnt);
if(NULL == pSub ){ continue ; }
if(strcmp(pSub->valuestring,"FadeAndRange") == 0){
kk_property_FadeAndRange_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"LightProperty") == 0){
kk_property_LightProperty_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"AirSwitchConfig") == 0){
kk_property_AirSwitchConfig_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"SocketRealTimePower") == 0){
kk_property_SocketRealTimePower_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"DeviceStatus") == 0){
kk_property_DeviceStatus_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"ChildLockState") == 0){
kk_property_ChildLockState_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"WaterValveArgs") == 0){
kk_property_WaterValveArgs_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"Screensaver") == 0){
kk_property_Screensaver_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"RunTime") == 0){
kk_property_RunTime_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"SwapState") == 0){
kk_property_SwapState_handle(deviceCode,epNumInt,msgId->valuestring);
}else if(strcmp(pSub->valuestring,"remoteOpenDoor") == 0){
kk_property_remoteOpenDoor_handle(deviceCode,epNumInt,msgId->valuestring);
}
}
}
return SUCCESS_RETURN;
}
\ No newline at end of file
#ifndef _KK_PROPERTY_GET_H_
#define _KK_PROPERTY_GET_H_
int kk_property_get_handle(cJSON * payload,char *deviceCode);
#endif
\ No newline at end of file
...@@ -686,7 +686,6 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room ...@@ -686,7 +686,6 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
int size = 0; int size = 0;
char *pStart = NULL; char *pStart = NULL;
int allRoom = (strcmp(roomId,"-1")==0)?1:0; int allRoom = (strcmp(roomId,"-1")==0)?1:0;
if(productType == NULL){ if(productType == NULL){
ERROR_PRINT("ERROR [%s][%d]\n",__FUNCTION__,__LINE__); ERROR_PRINT("ERROR [%s][%d]\n",__FUNCTION__,__LINE__);
return INVALID_PARAMETER; return INVALID_PARAMETER;
...@@ -741,7 +740,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room ...@@ -741,7 +740,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
} }
if(allRoom==0){ if(allRoom==0){
char roomName[256] = {0}; char roomName[256] = {0};
char roomIdStr[10] = {0}; char roomIdStr[16] = {0};
if(kk_get_device_roomInfo(pDeviceCode,info.epNum,roomName,roomIdStr)==0){ if(kk_get_device_roomInfo(pDeviceCode,info.epNum,roomName,roomIdStr)==0){
continue; continue;
} }
...@@ -769,7 +768,6 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room ...@@ -769,7 +768,6 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
//return res; //return res;
continue; continue;
} }
} }
} }
} }
...@@ -859,6 +857,40 @@ static int _kk_check_screenDev_exist(const char* sId) ...@@ -859,6 +857,40 @@ static int _kk_check_screenDev_exist(const char* sId)
} }
/************************************************************ /************************************************************
*功能描述:更新设备信息到数据库
*输入参数:devType:设备类型
serialId:产品Id
ip:设备ip
mac: mac地址
version:版本号
expand:预留
*输出参数:无
*返 回 值:0:成功;其他:失败
*其他说明:
*************************************************************/
int kk_screenDev_update(int devType,char *serialId, \
char *ip,char *mac,char *version)
{
char *sqlCmd = NULL;
int rc = 0;
char *zErrMsg = 0;
kk_subDb_ctx_t *ctx = _kk_subDb_get_ctx();
_kk_subDb_lock();
sqlCmd = sqlite3_mprintf("UPDATE ScreenDeviceInfo SET deviceIp= '%s',mac ='%s',version = '%s' WHERE serialId= '%s'",ip,mac,version,serialId);
rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( rc != SQLITE_OK ){
ERROR_PRINT("SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}else{
INFO_PRINT("Table updata data successfully\n");
}
sqlite3_free(sqlCmd);
_kk_subDb_unlock();
return SUCCESS_RETURN;
}
/************************************************************
*功能描述:保存设备信息到数据库 *功能描述:保存设备信息到数据库
*输入参数:devType:设备类型 *输入参数:devType:设备类型
serialId:产品Id serialId:产品Id
...@@ -884,11 +916,15 @@ int kk_screenDev_insert_db(int devType,char *serialId, \ ...@@ -884,11 +916,15 @@ int kk_screenDev_insert_db(int devType,char *serialId, \
if(_kk_check_screenDev_exist((const char*)serialId) == 1) if(_kk_check_screenDev_exist((const char*)serialId) == 1)
{ {
WARNING_PRINT("[%s][%d] DATA ALREADY EXIST!!!\n",__FUNCTION__,__LINE__); kk_screenDev_update(devType,serialId,ip,mac,version);
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
_kk_subDb_lock(); _kk_subDb_lock();
sqlCmd = sqlite3_mprintf(insertCmd,1,devType,serialId,ip,"MOOR4C",mac,version,"","",expand); #ifdef CONFIG_A133_PLATFORM
sqlCmd = sqlite3_mprintf(insertCmd,1,devType,serialId,ip,"MOOR4S",mac,version,"","",expand);
#else
sqlCmd = sqlite3_mprintf(insertCmd,1,devType,serialId,ip,"MOOR4C",mac,version,"","",expand);
#endif
rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg); rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( rc != SQLITE_OK ){ if( rc != SQLITE_OK ){
...@@ -914,15 +950,26 @@ int kk_screenDev_insert_db(int devType,char *serialId, \ ...@@ -914,15 +950,26 @@ int kk_screenDev_insert_db(int devType,char *serialId, \
*返 回 值:0:成功;其他:失败 *返 回 值:0:成功;其他:失败
*其他说明: *其他说明:
*************************************************************/ *************************************************************/
int kk_screenDev_update_room(char *serialId,char *roomid,char *roomname,char* name) void str_trans(char c[]) {
int i;
for(i=0;c[i];i++)
if(c[i]>='A'&&c[i]<='Z')
c[i]=(c[i]-'A')+'a';
/*以下注释内容为小写转大写,如不需要可删除*/
/*else if(c[i]<='z' && c[i]>='a')
c[i]=(c[i]-'a')+'A';*/
}
int kk_screenDev_update_room(char *mac,char *roomid,char *roomname,char* name)
{ {
char *sqlCmd = NULL; char *sqlCmd = NULL;
int rc = 0; int rc = 0;
char *zErrMsg = 0; char *zErrMsg = 0;
kk_subDb_ctx_t *ctx = _kk_subDb_get_ctx(); kk_subDb_ctx_t *ctx = _kk_subDb_get_ctx();
str_trans(mac);
_kk_subDb_lock(); _kk_subDb_lock();
sqlCmd = sqlite3_mprintf("UPDATE ScreenDeviceInfo SET roomId= '%s',roomName ='%s',deviceName = '%s' WHERE serialId= '%s'",roomid,roomname,name,serialId); sqlCmd = sqlite3_mprintf("UPDATE ScreenDeviceInfo SET roomId= '%s',roomName ='%s',deviceName = '%s' WHERE mac= '%s'",roomid,roomname,name,mac);
rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg); rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( rc != SQLITE_OK ){ if( rc != SQLITE_OK ){
ERROR_PRINT("SQL error: %s\n", zErrMsg); ERROR_PRINT("SQL error: %s\n", zErrMsg);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "dm_ota.h" #include "dm_ota.h"
#include "ccu_ver.h" #include "ccu_ver.h"
#include "kk_area_handle.h" #include "kk_area_handle.h"
#include "kk_property_get_handle.h"
int g_timezone = 8; int g_timezone = 8;
char * g_filerToPlatTable[] = char * g_filerToPlatTable[] =
...@@ -49,6 +50,7 @@ char * g_filerToPlatTable[] = ...@@ -49,6 +50,7 @@ char * g_filerToPlatTable[] =
(char *){KK_LOGIN_TOPIC_REPLY}, (char *){KK_LOGIN_TOPIC_REPLY},
(char *){KK_THING_SERVICE_PROPERTY_GET}, (char *){KK_THING_SERVICE_PROPERTY_GET},
(char *){KK_THING_CLOUDSTATE_MSG}, (char *){KK_THING_CLOUDSTATE_MSG},
(char *){KK_THING_CLOUDHB_MSG},
(char *){KK_THING_SERVICE_ADDSCENC}, (char *){KK_THING_SERVICE_ADDSCENC},
(char *){KK_THING_SERVICE_UPDATESCENC}, (char *){KK_THING_SERVICE_UPDATESCENC},
(char *){KK_THING_SERVICE_DELETESCENC}, (char *){KK_THING_SERVICE_DELETESCENC},
...@@ -62,6 +64,26 @@ char * g_filerToPlatTable[] = ...@@ -62,6 +64,26 @@ char * g_filerToPlatTable[] =
}; };
static char s_ccuid[DEVICE_CODE_LEN] = {0}; static char s_ccuid[DEVICE_CODE_LEN] = {0};
static char s_Version[VERSION_MAXLEN] = {0}; static char s_Version[VERSION_MAXLEN] = {0};
char s_pid[PRODUCT_CODE_LEN] = {0};
static int kk_pid_init(void)
{
char pid[PRODUCT_CODE_LEN] = {0};
int pid_len = 0;
HAL_Execel_cmd(GET_PRODUCTID_CMD,(char *)pid,sizeof(pid),&pid_len);
if(pid_len > 0 && pid_len <= PRODUCT_CODE_LEN){
memcpy(s_pid,pid,pid_len-1);
INFO_PRINT("s_pid:%s\n",s_pid);
}else{
return -1;
}
return 0;
}
int kk_get_pid(char *productId)
{
strncpy(productId, s_pid, strlen(s_pid));
printf("kk_get_pid:%s\n",s_pid);
return strlen(s_pid);
}
static void HAL_Ccuid_version(void) static void HAL_Ccuid_version(void)
{ {
FILE *fp; FILE *fp;
...@@ -463,9 +485,15 @@ void mid_cb(void* data, int len){ ...@@ -463,9 +485,15 @@ void mid_cb(void* data, int len){
cJSON_Delete(json); cJSON_Delete(json);
return; return;
} }
} }
if (strcmp(type->valuestring, KK_THING_SERVICE_PROPERTY_GET)==0){
res = kk_property_get_handle(payload,deviceCode->valuestring);
if(res != SUCCESS_RETURN){
ERROR_PRINT(" kk_property_get_handle error \n");
}
cJSON_Delete(json);
return;
}
int devType = 0; int devType = 0;
dm_mgr_get_devicetype_by_devicecode(deviceCode->valuestring,&devType); dm_mgr_get_devicetype_by_devicecode(deviceCode->valuestring,&devType);
//主机的device或过滤的 //主机的device或过滤的
...@@ -881,10 +909,14 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -881,10 +909,14 @@ void kk_platMsg_handle(void* data, char* chalMark){
goto error; goto error;
} }
if (chalMark != NULL){ //if (chalMark != NULL){
dm_mgr_update_timestamp_by_devicecode(chalMark,HAL_Uptimes()); //if(strcmp(msgType->valuestring,"/thing/service/property/set_reply") != 0){
} //dm_mgr_update_timestamp_by_devicecode(chalMark,HAL_Uptimes());
if(strcmp(msgType->valuestring,"/thing/service/property/get_reply") != 0){ //}
//}
//printf("msgType->valuestring:%s [%s][%d]\n",msgType->valuestring,__FUNCTION__,__LINE__);
if(strcmp(msgType->valuestring,"/thing/service/property/get_reply") != 0 &&
strcmp(msgType->valuestring,"/thing/service/property/set_reply") != 0){
dm_mgr_update_timestamp_by_devicecode(info_dcode->valuestring,HAL_Uptimes()); dm_mgr_update_timestamp_by_devicecode(info_dcode->valuestring,HAL_Uptimes());
} }
...@@ -1358,11 +1390,7 @@ void *udp_dispatch_yield(void *args){ ...@@ -1358,11 +1390,7 @@ void *udp_dispatch_yield(void *args){
memset(host_ip, 0, sizeof(host_ip)); memset(host_ip, 0, sizeof(host_ip));
memset(mac, 0, sizeof(mac)); memset(mac, 0, sizeof(mac));
memset(szOut, 0, sizeof(szOut)); memset(szOut, 0, sizeof(szOut));
#ifdef CONFIG_A133_PLATFORM
HAL_Get_IP(host_ip,"eth0");
#else
HAL_Get_IP(host_ip,NULL); HAL_Get_IP(host_ip,NULL);
#endif
HAL_Get_ccuid(device_code); HAL_Get_ccuid(device_code);
// printf("[%s][%d]inet_ntoa(from.sin_addr):%s\n",__FUNCTION__,__LINE__,inet_ntoa(from.sin_addr)); // printf("[%s][%d]inet_ntoa(from.sin_addr):%s\n",__FUNCTION__,__LINE__,inet_ntoa(from.sin_addr));
// printf("[%s][%d]host_ip:%s\n",__FUNCTION__,__LINE__,host_ip); // printf("[%s][%d]host_ip:%s\n",__FUNCTION__,__LINE__,host_ip);
...@@ -1426,11 +1454,7 @@ void *ccu_property_monitor(void *args) ...@@ -1426,11 +1454,7 @@ void *ccu_property_monitor(void *args)
dm_mgr_search_dev_by_devid(KK_DM_DEVICE_CCU_DEVICEID,&node); dm_mgr_search_dev_by_devid(KK_DM_DEVICE_CCU_DEVICEID,&node);
//dm_mgr_update_timestamp_by_devicecode(node->deviceCode,HAL_GetTime()); //dm_mgr_update_timestamp_by_devicecode(node->deviceCode,HAL_GetTime());
node->timestamp = HAL_Uptimes(); node->timestamp = HAL_Uptimes();
#ifdef CONFIG_A133_PLATFORM
HAL_Get_IP(s_IP,"eth0");
#else
HAL_Get_IP(s_IP,NULL); HAL_Get_IP(s_IP,NULL);
#endif
res = kk_tsl_get_value(kk_tsl_get_property_value,node->dev_shadow,KK_TSL_CCU_WANIP_IDENTIFIER,s_IP_TSL,NULL); res = kk_tsl_get_value(kk_tsl_get_property_value,node->dev_shadow,KK_TSL_CCU_WANIP_IDENTIFIER,s_IP_TSL,NULL);
if(res != SUCCESS_RETURN){ if(res != SUCCESS_RETURN){
ERROR_PRINT("kk_tsl_get_value Failed\n"); ERROR_PRINT("kk_tsl_get_value Failed\n");
...@@ -1438,21 +1462,18 @@ void *ccu_property_monitor(void *args) ...@@ -1438,21 +1462,18 @@ void *ccu_property_monitor(void *args)
else{ else{
if(strcmp(s_IP,s_IP_TSL)){ if(strcmp(s_IP,s_IP_TSL)){
kk_tsl_set_value(kk_tsl_set_property_value,node->dev_shadow,KK_TSL_CCU_WANIP_IDENTIFIER,NULL,s_IP); kk_tsl_set_value(kk_tsl_set_property_value,node->dev_shadow,KK_TSL_CCU_WANIP_IDENTIFIER,NULL,s_IP);
kk_tsl_set_value(kk_tsl_set_property_value,node->dev_shadow,KK_TSL_CCU_LANIP_IDENTIFIER,NULL,s_IP);
INFO_PRINT("current ip:%s,before ip:%s\n",s_IP,s_IP_TSL); INFO_PRINT("current ip:%s,before ip:%s\n",s_IP,s_IP_TSL);
kk_property_db_update(node->deviceCode); kk_property_db_update(node->deviceCode);
needReport = 1;
} }
} }
char *postStr = kk_tsl_get_post_property_str(node->dev_shadow,NULL);
if(needReport&&(kk_get_cloudstatus() == 1)){ if(postStr != NULL){
needReport = 0; dm_mgr_upstream_thing_property_post(node->devid, postStr, strlen(postStr),0);
char *postStr = kk_tsl_get_post_property_str(node->dev_shadow,NULL); free(postStr);
if(postStr != NULL){ postStr = NULL;
dm_mgr_upstream_thing_property_post(node->devid, postStr, strlen(postStr),0);
free(postStr);
postStr = NULL;
}
} }
//iotx_dm_ccu_cloudHB_check();
sleep(time_second); sleep(time_second);
} }
return NULL; return NULL;
...@@ -1498,6 +1519,7 @@ int main(const int argc, const char **argv) ...@@ -1498,6 +1519,7 @@ int main(const int argc, const char **argv)
openlog("midware",LOG_PID,LOG_USER); openlog("midware",LOG_PID,LOG_USER);
memset(mid_ctx, 0, sizeof(mid_ctx_t)); memset(mid_ctx, 0, sizeof(mid_ctx_t));
HAL_Ccuid_version(); HAL_Ccuid_version();
kk_pid_init();
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");
......
...@@ -111,7 +111,9 @@ static int kk_scene_tsl_load(void) ...@@ -111,7 +111,9 @@ static int kk_scene_tsl_load(void)
char *tsl_str = NULL; char *tsl_str = NULL;
int heartTime = 0; int heartTime = 0;
char isDormancyDev = 0; char isDormancyDev = 0;
tsl_str = kk_load_json("15", KK_DEVICE_TSL_TYPE); char pid[32] = {0};
kk_get_pid(pid);
tsl_str = kk_load_json(pid, KK_DEVICE_TSL_TYPE);
if(tsl_str != NULL) if(tsl_str != NULL)
{ {
res = kk_tsl_create(tsl_str,strlen(tsl_str),&s_scene_shadow,&heartTime,(int*)&isDormancyDev); res = kk_tsl_create(tsl_str,strlen(tsl_str),&s_scene_shadow,&heartTime,(int*)&isDormancyDev);
...@@ -1175,6 +1177,9 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat ...@@ -1175,6 +1177,9 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
productType = cJSON_GetObjectItem(item,MSG_PRODUCT_TYPE_STR); productType = cJSON_GetObjectItem(item,MSG_PRODUCT_TYPE_STR);
roomId = cJSON_GetObjectItem(item,MSG_AREA_ROOM_CCUROOMID); roomId = cJSON_GetObjectItem(item,MSG_AREA_ROOM_CCUROOMID);
if(productType != NULL){ if(productType != NULL){
if(roomId == NULL){
roomId = cJSON_GetObjectItem(item,MSG_AREA_ROOM_ROOMID);
}
delay = cJSON_GetObjectItem(item,MSG_SCENE_DELAY); delay = cJSON_GetObjectItem(item,MSG_SCENE_DELAY);
if(delay == NULL) return FAIL_RETURN; if(delay == NULL) return FAIL_RETURN;
int idelay = delay->valueint; int idelay = delay->valueint;
...@@ -1233,11 +1238,16 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat ...@@ -1233,11 +1238,16 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
if(strcmp(node->productCode,"3098") == 0 || strcmp(node->productCode,"3099") == 0 || if(strcmp(node->productCode,"3098") == 0 || strcmp(node->productCode,"3099") == 0 ||
strcmp(node->productCode,"3097") == 0){ strcmp(node->productCode,"3097") == 0){
sprintf(info.propertyName,"%s_%d",propertyName->valuestring,iepnum); sprintf(info.propertyName,"%s_%d",propertyName->valuestring,iepnum);
}else if(strcmp(node->productCode,"5004") == 0){
if(strstr(propertyName->valuestring,"_") == NULL){
sprintf(info.propertyName,"%s_%d",propertyName->valuestring,iepnum);
}else{
memcpy(info.propertyName,propertyName->valuestring,strlen(propertyName->valuestring));
}
}else{ }else{
memcpy(info.propertyName,propertyName->valuestring,strlen(propertyName->valuestring)); 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);
......
...@@ -72,11 +72,11 @@ ...@@ -72,11 +72,11 @@
#define KK_TSL_SPECIAL_EVENT_POST_IDENTIFIER "post" #define KK_TSL_SPECIAL_EVENT_POST_IDENTIFIER "post"
#define KK_TSL_SPECIAL_EVENT_POST_METHOD "thing.event.property.post" #define KK_TSL_SPECIAL_EVENT_POST_METHOD "thing.event.property.post"
#define KK_TSL_VERSION_IDENTIFIER "Version" #define KK_TSL_VERSION_IDENTIFIER "version"
#define KK_TSL_CCU_LANIP_IDENTIFIER "LanIPAddress" #define KK_TSL_CCU_LANIP_IDENTIFIER "lanIPAddress"
#define KK_TSL_CCU_WANIP_IDENTIFIER "WanIPAddress" #define KK_TSL_CCU_WANIP_IDENTIFIER "wanIPAddress"
#define KK_TSL_CCU_WANSTATE_IDENTIFIER "WanState" #define KK_TSL_CCU_WANSTATE_IDENTIFIER "wanState"
#define KK_TSL_CCU_IOTCLOUD_IDENTIFIER "IOTCloudState" #define KK_TSL_CCU_IOTCLOUD_IDENTIFIER "iotCloudState"
#define KK_TSL_CCU_ARMINGSTATE_IDENTIFIER "ArmingState" #define KK_TSL_CCU_ARMINGSTATE_IDENTIFIER "ArmingState"
#define KK_TSL_GATAWAY_VERSION_IDENTIFIER "Version" #define KK_TSL_GATAWAY_VERSION_IDENTIFIER "Version"
......
...@@ -13,9 +13,10 @@ char* kk_load_json(const char *productCode,int type) ...@@ -13,9 +13,10 @@ char* kk_load_json(const char *productCode,int type)
char *tslPath = NULL; char *tslPath = NULL;
int path_len = 0; int path_len = 0;
unsigned int filesize; unsigned int filesize;
char pid[32] = {0};
kk_get_pid(pid);
if(type == KK_DM_DEVICE_CCU){ if(type == KK_DM_DEVICE_CCU){
path_len = strlen(TSL_CCU_PATH_FILE)+strlen("12")+1; path_len = strlen(TSL_CCU_PATH_FILE)+strlen(pid)+1;
} }
else if(type == KK_DM_DEVICE_GATEWAY){ else if(type == KK_DM_DEVICE_GATEWAY){
path_len = strlen(TSL_GATEWAY_PATH_FILE)+strlen("2")+1; path_len = strlen(TSL_GATEWAY_PATH_FILE)+strlen("2")+1;
...@@ -33,7 +34,7 @@ char* kk_load_json(const char *productCode,int type) ...@@ -33,7 +34,7 @@ char* kk_load_json(const char *productCode,int type)
memset(tslPath,0x0,path_len); memset(tslPath,0x0,path_len);
if(type == KK_DM_DEVICE_CCU){ if(type == KK_DM_DEVICE_CCU){
snprintf(tslPath,path_len,TSL_CCU_PATH_FILE,"12"); snprintf(tslPath,path_len,TSL_CCU_PATH_FILE,pid);
} }
else if(type == KK_DM_DEVICE_GATEWAY){ else if(type == KK_DM_DEVICE_GATEWAY){
snprintf(tslPath,path_len,TSL_GATEWAY_PATH_FILE,"2"); snprintf(tslPath,path_len,TSL_GATEWAY_PATH_FILE,"2");
......
{ {
"version": "1.4", "version": "1.4",
"update": "2021-09-06", "update": "2021-09-06",
"devices": [ "devices": [
{ {
"pid": "00068611", "pid": "00068611",
"name": "XC Wall switch 1G", "name": "XC Wall switch 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3001, "b_pid": 3001,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00068612", "pid": "00068612",
"name": "XC Wall switch 2G", "name": "XC Wall switch 2G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3002, "b_pid": 3002,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00068613", "pid": "00068613",
"name": "XC Wall switch 3G", "name": "XC Wall switch 3G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3003, "b_pid": 3003,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00048611", "pid": "00048611",
"name": "XC Scene Panel 4G", "name": "XC Scene Panel 4G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3004, "b_pid": 3004,
"productType": "scene", "productType": "scene",
"eps": [ "eps": [
{ {
"zid": "0004", "zid": "0004",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00038611", "pid": "00038611",
"name": "XC Curtain Panel 1G", "name": "XC Curtain Panel 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3005, "b_pid": 3005,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00038612", "pid": "00038612",
"name": "XC Curtain Panel 2G", "name": "XC Curtain Panel 2G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3006, "b_pid": 3006,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00038613", "pid": "00038613",
"name": "XC Dry Contact Curtain Panel 1G", "name": "XC Dry Contact Curtain Panel 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3007, "b_pid": 3007,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00038614", "pid": "00038614",
"name": "XC Dry Contact Curtain Panel 2G", "name": "XC Dry Contact Curtain Panel 2G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3008, "b_pid": 3008,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00068601", "pid": "00068601",
"name": "BJ Wall switch 1G", "name": "BJ Wall switch 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3009, "b_pid": 3009,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00068602", "pid": "00068602",
"name": "BJ Wall switch 2G", "name": "BJ Wall switch 2G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3010, "b_pid": 3010,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00068603", "pid": "00068603",
"name": "BJ Wall switch 3G", "name": "BJ Wall switch 3G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3011, "b_pid": 3011,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00038601", "pid": "00038601",
"name": "BJ Curtain Panel 1G", "name": "BJ Curtain Panel 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3012, "b_pid": 3012,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00048601", "pid": "00048601",
"name": "BJ Scene Panel 3G", "name": "BJ Scene Panel 3G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3013, "b_pid": 3013,
"productType": "scene", "productType": "scene",
"eps": [ "eps": [
{ {
"zid": "0004", "zid": "0004",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00048602", "pid": "00048602",
"name": "BJ Quick Panel 3G", "name": "BJ Quick Panel 3G",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3014, "b_pid": 3014,
"productType": "scene", "productType": "scene",
"eps": [ "eps": [
{ {
"zid": "0004", "zid": "0004",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "0402812C", "pid": "0402812C",
"name": "BJ SOS Button", "name": "BJ SOS Button",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3015, "b_pid": 3015,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"zid": "0402", "zid": "0402",
"zone_type":"002C", "zone_type":"002C",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "0402802C", "pid": "0402802C",
"name": "BJ SOS Panel", "name": "BJ SOS Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3016, "b_pid": 3016,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"zid": "0402", "zid": "0402",
"zone_type":"002C", "zone_type":"002C",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "00038603", "pid": "00038603",
"name": "BJ Open Window Panel 1G", "name": "BJ Open Window Panel 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3017, "b_pid": 3017,
"productType": "actuator", "productType": "actuator",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "01018601", "pid": "01018601",
"name": "BJ DimmerLight Panel", "name": "BJ DimmerLight Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3018, "b_pid": 3018,
"productType": "lightPanel", "productType": "lightPanel",
"eps": [ "eps": [
{ {
"zid": "0101", "zid": "0101",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0008" "server": "0000:0003:0004:0005:0006:0008"
} }
} }
] ]
}, },
{ {
"pid": "00518610", "pid": "00518610",
"name": "BJ Plug Panel 10A", "name": "BJ Plug Panel 10A",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3019, "b_pid": 3019,
"productType": "outlet", "productType": "outlet",
"eps": [ "eps": [
{ {
"zid": "0051", "zid": "0051",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0b04:0702" "server": "0000:0003:0004:0005:0006:0b04:0702"
} }
} }
] ]
}, },
{ {
"pid": "00518616", "pid": "00518616",
"name": "BJ Plug Panel 16A", "name": "BJ Plug Panel 16A",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3020, "b_pid": 3020,
"productType": "outlet", "productType": "outlet",
"eps": [ "eps": [
{ {
"zid": "0051", "zid": "0051",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0b04:0702" "server": "0000:0003:0004:0005:0006:0b04:0702"
} }
} }
] ]
}, },
{ {
"pid": "00038602", "pid": "00038602",
"name": "BJ Dry Contact Curtain Panel 1G", "name": "BJ Dry Contact Curtain Panel 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3021, "b_pid": 3021,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00068621", "pid": "00068621",
"name": "XB Wall switch 1G", "name": "XB Wall switch 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3022, "b_pid": 3022,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00068622", "pid": "00068622",
"name": "XB Wall switch 2G", "name": "XB Wall switch 2G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3023, "b_pid": 3023,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00068623", "pid": "00068623",
"name": "XB Wall switch 3G", "name": "XB Wall switch 3G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3024, "b_pid": 3024,
"productType":"switch", "productType":"switch",
"eps": [ "eps": [
{ {
"zid": "0103", "zid": "0103",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00048621", "pid": "00048621",
"name": "XB Scene Panel 4G", "name": "XB Scene Panel 4G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3025, "b_pid": 3025,
"productType": "scene", "productType": "scene",
"eps": [ "eps": [
{ {
"zid": "0004", "zid": "0004",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "00038621", "pid": "00038621",
"name": "XB Curtain Panel 1G", "name": "XB Curtain Panel 1G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3026, "b_pid": 3026,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00038622", "pid": "00038622",
"name": "XB Curtain Panel 2G", "name": "XB Curtain Panel 2G",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3027, "b_pid": 3027,
"productType": "curtain", "productType": "curtain",
"eps": [ "eps": [
{ {
"zid": "0203", "zid": "0203",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0102" "server": "0000:0003:0004:0005:0006:0102"
} }
} }
] ]
}, },
{ {
"pid": "00803028", "pid": "00803028",
"name": "XB DimmerLight Panel", "name": "XB DimmerLight Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3028, "b_pid": 3028,
"productType": "lightPanel", "productType": "lightPanel",
"eps": [ "eps": [
{ {
"zid": "0080", "zid": "0080",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0008" "server": "0000:0003:0004:0005:0006:0008"
} }
} }
] ]
}, },
{ {
"pid": "00803029", "pid": "00803029",
"name": "XB Water Floor Heating Panel", "name": "XB Water Floor Heating Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3029, "b_pid": 3029,
"productType": "floorHeating", "productType": "floorHeating",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201" "server": "0000:0003:0004:0005:0006:0201"
} }
} }
] ]
}, },
{ {
"pid": "00803030", "pid": "00803030",
"name": "XB Electric Floor Heating Panel", "name": "XB Electric Floor Heating Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3030, "b_pid": 3030,
"productType": "floorHeating", "productType": "floorHeating",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201" "server": "0000:0003:0004:0005:0006:0201"
} }
} }
] ]
}, },
{ {
"pid": "00803031", "pid": "00803031",
"name": "XB Fan Coil Panel", "name": "XB Fan Coil Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3031, "b_pid": 3031,
"productType": "fanCoil", "productType": "fanCoil",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202" "server": "0000:0003:0004:0005:0006:0201:0202"
} }
} }
] ]
}, },
{ {
"pid": "00803032", "pid": "00803032",
"name": "XB Fresh Air Panel", "name": "XB Fresh Air Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3032, "b_pid": 3032,
"productType": "freshAir", "productType": "freshAir",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202" "server": "0000:0003:0004:0005:0006:0201:0202"
} }
} }
] ]
}, },
{ {
"pid": "00803033", "pid": "00803033",
"name": "XB Midea Air Condition Panel Z3KA", "name": "XB Midea Air Condition Panel Z3KA",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3033, "b_pid": 3033,
"productType": "airConditioning", "productType": "airConditioning",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202" "server": "0000:0003:0004:0005:0006:0201:0202"
} }
} }
] ]
}, },
{ {
"pid": "00803034", "pid": "00803034",
"name": "XB Midea Air Condition Panel Z3ZA", "name": "XB Midea Air Condition Panel Z3ZA",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3034, "b_pid": 3034,
"productType": "airConditioning", "productType": "airConditioning",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202" "server": "0000:0003:0004:0005:0006:0201:0202"
} }
} }
] ]
}, },
{ {
"pid": "00803035", "pid": "00803035",
"name": "XB Daikin Air Condition Panel Z3KA", "name": "XB Daikin Air Condition Panel Z3KA",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3035, "b_pid": 3035,
"productType": "airConditioning", "productType": "airConditioning",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202" "server": "0000:0003:0004:0005:0006:0201:0202"
} }
} }
] ]
}, },
{ {
"pid": "00803036", "pid": "00803036",
"name": "XB MHI Air Condition Panel", "name": "XB MHI Air Condition Panel",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3036, "b_pid": 3036,
"productType": "airConditioning", "productType": "airConditioning",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0201:0202" "server": "0000:0003:0004:0005:0006:0201:0202"
} }
} }
] ]
}, },
{ {
"pid": "00518620", "pid": "00518620",
"name": "XB Plug Panel 10A", "name": "XB Plug Panel 10A",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3037, "b_pid": 3037,
"productType": "outlet", "productType": "outlet",
"eps": [ "eps": [
{ {
"zid": "0051", "zid": "0051",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0b04:0702" "server": "0000:0003:0004:0005:0006:0b04:0702"
} }
} }
] ]
}, },
{ {
"pid": "00518626", "pid": "00518626",
"name": "XB Plug Panel 16A", "name": "XB Plug Panel 16A",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3038, "b_pid": 3038,
"productType": "outlet", "productType": "outlet",
"eps": [ "eps": [
{ {
"zid": "0051", "zid": "0051",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006:0b04:0702" "server": "0000:0003:0004:0005:0006:0b04:0702"
} }
} }
] ]
}, },
{ {
"pid": "0402002A", "pid": "0402002A",
"name": "iHORN water detector", "name": "iHORN water detector",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3039, "b_pid": 3039,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"002A", "zone_type":"002A",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "0402002B", "pid": "0402002B",
"name": "iHORN gas detector", "name": "iHORN gas detector",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3040, "b_pid": 3040,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"002B", "zone_type":"002B",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "04020028", "pid": "04020028",
"name": "iHORN smoke detector", "name": "iHORN smoke detector",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3041, "b_pid": 3041,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"0028", "zone_type":"0028",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "0402000D", "pid": "0402000D",
"name": "KPL Body Sensor", "name": "KPL Body Sensor",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3042, "b_pid": 3042,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"000D", "zone_type":"000D",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "0402010D", "pid": "0402010D",
"name": "Infrared Curtain Detector", "name": "Infrared Curtain Detector",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3043, "b_pid": 3043,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"000D", "zone_type":"000D",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "04032225", "pid": "04032225",
"name": "KPL Indoor Siren", "name": "KPL Indoor Siren",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3044, "b_pid": 3044,
"productType": "siren", "productType": "siren",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0403", "zid": "0403",
"zone_type":"0225", "zone_type":"0225",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "04022015", "pid": "04022015",
"name": "KPL Door Seneor", "name": "KPL Door Seneor",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3045, "b_pid": 3045,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"0015", "zone_type":"0015",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "00510001", "pid": "00510001",
"name": "KIT Quick Panel", "name": "KIT Quick Panel",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3046, "b_pid": 3046,
"productType": "scene", "productType": "scene",
"eps": [ "eps": [
{ {
"zid": "0002", "zid": "0002",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0006" "server": "0000:0003:0006"
} }
} }
] ]
}, },
{ {
"pid": "03020000", "pid": "03020000",
"name": "KIT Environment Sensor", "name": "KIT Environment Sensor",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3048, "b_pid": 3048,
"productType": "Environmental", "productType": "Environmental",
"eps": [ "eps": [
{ {
"zid": "0302", "zid": "0302",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0402:0405" "server": "0000:0003:0402:0405"
} }
} }
] ]
}, },
{ {
"pid": "0402000D", "pid": "0402000D",
"name": "KIT Body Sensor", "name": "KIT Body Sensor",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3049, "b_pid": 3049,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"000D", "zone_type":"000D",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "04020015", "pid": "04020015",
"name": "KIT Door Seneor", "name": "KIT Door Seneor",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3050, "b_pid": 3050,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"0015", "zone_type":"0015",
"cluster": { "cluster": {
"client": "0003", "client": "0003",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "04021015", "pid": "04021015",
"name": "BD Door Sensor", "name": "BD Door Sensor",
"type": "ZSED", "type": "ZSED",
"ota": true, "ota": true,
"b_pid": 3051, "b_pid": 3051,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"0015", "zone_type":"0015",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "03021000", "pid": "03021000",
"name": "BD Environment Sensor", "name": "BD Environment Sensor",
"type": "ZSED", "type": "ZSED",
"ota": true, "ota": true,
"b_pid": 3052, "b_pid": 3052,
"productType": "Environmental", "productType": "Environmental",
"eps": [ "eps": [
{ {
"zid": "0302", "zid": "0302",
"cluster": { "cluster": {
"client": "0019", "client": "0019",
"server": "0000:0001:0003:0400:0402:0405" "server": "0000:0001:0003:0400:0402:0405"
} }
} }
] ]
}, },
{ {
"pid": "0402100D", "pid": "0402100D",
"name": "BD Body Sensor", "name": "BD Body Sensor",
"type": "ZSED", "type": "ZSED",
"ota": true, "ota": true,
"b_pid": 3053, "b_pid": 3053,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"000D", "zone_type":"000D",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "0402102C", "pid": "0402102C",
"name": "BD SOS Button", "name": "BD SOS Button",
"type": "ZSED", "type": "ZSED",
"ota": true, "ota": true,
"b_pid": 3054, "b_pid": 3054,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"002C", "zone_type":"002C",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "0402102A", "pid": "0402102A",
"name": "BD Water Sensor", "name": "BD Water Sensor",
"type": "ZSED", "type": "ZSED",
"ota": true, "ota": true,
"b_pid": 3055, "b_pid": 3055,
"productType": "IASsensor", "productType": "IASsensor",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0402", "zid": "0402",
"zone_type":"002A", "zone_type":"002A",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "00040002", "pid": "00040002",
"name": "BD Scene Button", "name": "BD Scene Button",
"type": "ZSED", "type": "ZSED",
"ota": true, "ota": true,
"b_pid": 3056, "b_pid": 3056,
"productType": "scene", "productType": "scene",
"eps": [ "eps": [
{ {
"zid": "0004", "zid": "0004",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "server": "0000:0003:0004:0005:0006"
} }
} }
] ]
}, },
{ {
"pid": "04031225", "pid": "04031225",
"name": "BD Indoor Siren", "name": "BD Indoor Siren",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3057, "b_pid": 3057,
"productType": "siren", "productType": "siren",
"eps": [ "eps": [
{ {
"ep":"1", "ep":"1",
"zid": "0403", "zid": "0403",
"zone_type":"0225", "zone_type":"0225",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "00803059", "pid": "00803059",
"name": "Infrared remote control", "name": "Infrared remote control",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3059, "b_pid": 3059,
"productType": "remoteControl", "productType": "remoteControl",
"eps": [ "eps": [
{ {
"zid": "0006", "zid": "0006",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0003:0500" "server": "0000:0003:0500"
} }
} }
] ]
}, },
{ {
"pid": "00803062", "pid": "00803062",
"name": "Center Air Conditioning Gateway PRO", "name": "Center Air Conditioning Gateway PRO",
"type": "ZR", "type": "ZR",
"ota": true, "ota": true,
"b_pid": 3062, "b_pid": 3062,
"productType": "airConditioningGateway", "productType": "airConditioningGateway",
"eps": [ "eps": [
{ {
"zid": "0300", "zid": "0300",
"cluster": { "cluster": {
"client": "0003:0006", "client": "0003:0006",
"server": "0000:0003:0004:0005:0006:0008:0201" "server": "0000:0003:0004:0005:0006:0008:0201"
} }
} }
] ]
}, },
{ {
"pid": "000A0001", "pid": "000A0001",
"name": "YM Doorlock", "name": "YM Doorlock",
"type": "ZSED", "type": "ZSED",
"ota": false, "ota": false,
"b_pid": 3064, "b_pid": 3064,
"productType": "Doorlock", "productType": "Doorlock",
"eps": [ "eps": [
{ {
"zid": "000A", "zid": "000A",
"cluster": { "cluster": {
"client": "0003:0019", "client": "0003:0019",
"server": "0000:0001:0003:0101:0B05" "server": "0000:0001:0003:0101:0B05"
} }
} }
] ]
}, },
{ {
"pid": "02020000", "pid": "000A0002",
"name": "DY Window Covering", "name": "YC Doorlock",
"type": "ZR", "type": "ZSED",
"ota": true, "ota": false,
"b_pid": 3067, "b_pid": 3066,
"productType": "curtain", "productType": "Doorlock",
"eps": [ "eps": [
{ {
"zid": "0202", "zid": "000A"
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "02020000",
} "name": "DY Window Covering",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3067,
"pid": "02020001", "productType": "curtain",
"name": "WSD Window Covering",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3068, "zid": "0202",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0202", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "02020001",
} "name": "WSD Window Covering",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3068,
"pid": "01000002", "productType": "curtain",
"name": "Dual Lamp Control Module",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3069, "zid": "0202",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0100", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "01000002",
} "name": "Dual Lamp Control Module",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3069,
"pid": "04028301", "productType":"switch",
"name": "Security Sensor Module",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3070, "zid": "0100",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"ep":"1", }
"zid": "0402", }
"zone_type": "8301", ]
},
"cluster": { {
"client": "0003:0019", "pid": "04028301",
"server": "0000:0003:0004:0005:0006" "name": "Security Sensor Module",
} "type": "ZR",
} "ota": true,
] "b_pid": 3070,
}, "productType": "IASsensor",
{
"pid": "03300001", "eps": [
"name": "Water Valve Controller", {
"type": "ZR", "ep":"1",
"ota": true, "zid": "0402",
"b_pid": 3071, "zone_type": "8301",
"productType": "waterValve",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0330", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "03300001",
} "name": "Water Valve Controller",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3071,
"pid": "03310001", "productType": "waterValve",
"name": "Gas Valve Controller",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3072, "zid": "0330",
"productType": "gasValve",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0331", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "03310001",
} "name": "Gas Valve Controller",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3072,
"pid": "01020001", "productType": "gasValve",
"name": "Light Belt Controller",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3073, "zid": "0331",
"productType": "colorDimmableLight",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0102", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01020001",
}, "name": "Light Belt Controller",
{ "type": "ZR",
"zid": "0101", "ota": true,
"b_pid": 3073,
"cluster": { "productType": "colorDimmableLight",
"client": "",
"server": "0004:0005:0006:0008" "eps": [
} {
} "zid": "0102",
]
}, "cluster": {
{ "client": "0003:0019",
"pid": "03020001", "server": "0000:0003:0004:0005:0006:0008:0300"
"name": "Environment Sensor", }
"type": "ZR", },
"ota": true, {
"b_pid": 3076, "zid": "0101",
"productType": "Environmental",
"cluster": {
"eps": [ "client": "",
{ "server": "0004:0005:0006:0008"
"zid": "0302", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0402:0405:0400" {
} "pid": "03020001",
} "name": "Environment Sensor",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3076,
"pid": "00068624", "productType": "Environmental",
"name": "XB Wall switch 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3078, "zid": "0302",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0402:0405:0400"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068624",
} "name": "XB Wall switch 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3078,
"pid": "00068614", "productType":"switch",
"name": "XC Wall switch 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3079, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068614",
} "name": "XC Wall switch 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3079,
"pid": "3050", "productType":"switch",
"name": "iHORN Gas Sensor",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3080, "zid": "0103",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"ep":"1", }
"zid": "0402", }
"zone_type":"002B", ]
},
"cluster": { {
"client": "0003:0019", "pid": "3050",
"server": "0000:0003:0500" "name": "iHORN Gas Sensor",
} "type": "ZR",
} "ota": true,
] "b_pid": 3080,
}, "productType": "IASsensor",
{
"pid": "3041", "eps": [
"name": "iHORN Smoke Sensor", {
"type": "ZSED", "ep":"1",
"ota": true, "zid": "0402",
"b_pid": 3081, "zone_type":"002B",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0500"
"ep":"1", }
"zid": "0402", }
"zone_type":"0028", ]
},
"cluster": { {
"client": "0003:0019", "pid": "3041",
"server": "0000:0003:0500" "name": "iHORN Smoke Sensor",
} "type": "ZSED",
} "ota": true,
] "b_pid": 3081,
}, "productType": "IASsensor",
{
"pid": "0402102B", "eps": [
"name": "BD Gas Sensor", {
"type": "ZR", "ep":"1",
"ota": true, "zid": "0402",
"b_pid": 3082, "zone_type":"0028",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0500"
"ep":"1", }
"zid": "0402", }
"zone_type":"002B", ]
},
"cluster": { {
"client": "0003:0019", "pid": "0402102B",
"server": "0000:0003:0500" "name": "BD Gas Sensor",
} "type": "ZR",
} "ota": true,
] "b_pid": 3082,
}, "productType": "IASsensor",
{
"pid": "04021028", "eps": [
"name": "BD Smoke Sensor", {
"type": "ZSED", "ep":"1",
"ota": true, "zid": "0402",
"b_pid": 3083, "zone_type":"002B",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0500"
"ep":"1", }
"zid": "0402", }
"zone_type":"0028", ]
},
"cluster": { {
"client": "0003:0019", "pid": "04021028",
"server": "0000:0003:0500" "name": "BD Smoke Sensor",
} "type": "ZSED",
} "ota": true,
] "b_pid": 3083,
}, "productType": "IASsensor",
{
"pid": "03020002", "eps": [
"name": "Environment Detection Panel", {
"type": "ZR", "ep":"1",
"ota": true, "zid": "0402",
"b_pid": 3084, "zone_type":"0028",
"productType": "Environmental",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0500"
"zid": "0302", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0400:0402:0405:040D:042A:042B" {
} "pid": "03020002",
} "name": "Environment Detection Panel",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3084,
"pid": "00068631", "productType": "Environmental",
"name": "HD Wall switch 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3085, "zid": "0302",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0400:0402:0405:040D:042A:042B"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068631",
} "name": "HD Wall switch 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3085,
"pid": "00068632", "productType":"switch",
"name": "HD Wall switch 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3086, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068632",
} "name": "HD Wall switch 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3086,
"pid": "00068633", "productType":"switch",
"name": "HD Wall switch 3G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3087, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068633",
} "name": "HD Wall switch 3G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3087,
"pid": "00038631", "productType":"switch",
"name": "HD Curtain Panel 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3088, "zid": "0103",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0203", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "00038631",
} "name": "HD Curtain Panel 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3088,
"pid": "00038632", "productType": "curtain",
"name": "HD Curtain Panel 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3089, "zid": "0203",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0203", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "00038632",
} "name": "HD Curtain Panel 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3089,
"pid": "00048631", "productType": "curtain",
"name": "HD Scene Panel 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3090, "zid": "0203",
"productType": "scene",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0004", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00048631",
} "name": "HD Scene Panel 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3090,
"pid": "01018631", "productType": "scene",
"name": "HD Dimmable Light Panel 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3091, "zid": "0004",
"productType": "lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0101", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0B05" {
} "pid": "01018631",
} "name": "HD Dimmable Light Panel 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3091,
"pid": "01018632", "productType": "lightPanel",
"name": "HD Dimmable Light Panel 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3092, "zid": "0101",
"productType": "lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0B05"
"zid": "0101", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0B05" {
} "pid": "01018632",
} "name": "HD Dimmable Light Panel 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3092,
"pid": "01018633", "productType": "lightPanel",
"name": "HD Dimmable Light Panel 3G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3093, "zid": "0101",
"productType": "lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0B05"
"zid": "0101", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0B05" {
} "pid": "01018633",
} "name": "HD Dimmable Light Panel 3G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3093,
"pid": "01010001", "productType": "lightPanel",
"name": "Dimmable Light Module 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3094, "zid": "0101",
"productType": "lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0B05"
"zid": "0101", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0B05" {
} "pid": "01010001",
} "name": "Dimmable Light Module 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3094,
"pid": "03008611", "productType": "lightPanel",
"name": "HD HVAC Air condition All in one",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3095, "zid": "0101",
"productType": "airConditioning",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0B05"
"zid": "0300", }
}
"cluster": { ]
"client": "0003:0006", },
"server": "0000:0003:0004:0005:0006:0201:0202" {
} "pid": "03008611",
} "name": "HD HVAC Air condition All in one",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3095,
"pid": "03008603", "productType": "airConditioning",
"name": "HD HVAC Floor Heating All in one",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3097, "zid": "0300",
"productType": "floorHeating",
"cluster": {
"eps": [ "client": "0003:0006",
{ "server": "0000:0003:0004:0005:0006:0201:0202"
"zid": "0300", }
}
"cluster": { ]
"client": "0003:0006", },
"server": "0000:0003:0004:0005:0006:0201:0202" {
} "pid": "03008603",
} "name": "HD HVAC Floor Heating All in one",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3097,
"pid": "03008601", "productType": "floorHeating",
"name": "HD HVAC Fan coil All in one",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3098, "zid": "0300",
"productType": "fanCoil",
"cluster": {
"eps": [ "client": "0003:0006",
{ "server": "0000:0003:0004:0005:0006:0201:0202"
"zid": "0300", }
}
"cluster": { ]
"client": "0003:0006", },
"server": "0000:0003:0004:0005:0006:0201:0202" {
} "pid": "03008601",
} "name": "HD HVAC Fan coil All in one",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3098,
"pid": "03008604", "productType": "fanCoil",
"name": "HD HVAC Fresh Air All in one",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3099, "zid": "0300",
"productType": "freshAir",
"cluster": {
"eps": [ "client": "0003:0006",
{ "server": "0000:0003:0004:0005:0006:0201:0202"
"zid": "0300", }
}
"cluster": { ]
"client": "0003:0006", },
"server": "0000:0003:0004:0005:0006:0201:0202" {
} "pid": "03008604",
} "name": "HD HVAC Fresh Air All in one",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3099,
"pid": "00518630", "productType": "freshAir",
"name": "HD Plug Panel 10A",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3100, "zid": "0300",
"productType": "outlet",
"cluster": {
"eps": [ "client": "0003:0006",
{ "server": "0000:0003:0004:0005:0006:0201:0202"
"zid": "0051", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0b04:0702" {
} "pid": "00518630",
} "name": "HD Plug Panel 10A",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3100,
"pid": "01018630", "productType": "outlet",
"name": "HD SCR Dimmable Light Panel",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3102, "zid": "0051",
"productType": "lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0b04:0702"
"zid": "0101", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0B05" {
} "pid": "01018630",
} "name": "HD SCR Dimmable Light Panel",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3102,
"pid": "00060002", "productType": "lightPanel",
"name": "Offline Voice Panel",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3104, "zid": "0101",
"productType": "voicePanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0B05"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00060002",
}, "name": "Offline Voice Panel",
{ "type": "ZR",
"zid": "0004", "ota": true,
"b_pid": 3104,
"cluster": { "productType": "voicePanel",
"client": "0003:0019",
"server": "0000:0003:0004:0005:0006" "eps": [
} {
}, "zid": "0103",
{
"zid": "0007", "cluster": {
"client": "0003:0019",
"cluster": { "server": "0000:0003:0004:0005:0006"
"client": "0003:0019", }
"server": "0000:0003:0008" },
} {
} "zid": "0004",
]
}, "cluster": {
{ "client": "0003:0019",
"pid": "04022028", "server": "0000:0003:0004:0005:0006"
"name": "KPL Smoke Sensor", }
"type": "ZSED", },
"ota": true, {
"b_pid": 3105, "zid": "0007",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0008"
"ep":"1", }
"zid": "0402", }
"zone_type":"0028", ]
},
"cluster": { {
"client": "0003:0019", "pid": "04022028",
"server": "0000:0003:0500" "name": "KPL Smoke Sensor",
} "type": "ZSED",
} "ota": true,
] "b_pid": 3105,
}, "productType": "IASsensor",
{
"pid": "0402202B", "eps": [
"name": "KPL Gas Sensor", {
"type": "ZR", "ep":"1",
"ota": true, "zid": "0402",
"b_pid": 3106, "zone_type":"0028",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0500"
"ep":"1", }
"zid": "0402", }
"zone_type":"002B", ]
},
"cluster": { {
"client": "0003:0019", "pid": "0402202B",
"server": "0000:0003:0500" "name": "KPL Gas Sensor",
} "type": "ZR",
} "ota": true,
] "b_pid": 3106,
}, "productType": "IASsensor",
{
"pid": "00020003", "eps": [
"name": "BJ Water cut-off panel", {
"type": "ZR", "ep":"1",
"ota": true, "zid": "0402",
"b_pid": 3108, "zone_type":"002B",
"productType": "waterValve",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0500"
"zid": "0002", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00020003",
} "name": "BJ Water cut-off panel",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3108,
"pid": "00803109", "productType": "waterValve",
"name": "Air Switch Gateway",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3109, "zid": "0002",
"productType": "airSwitchGateway",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0300", }
}
"cluster": { ]
"client": "0003:0006", },
"server": "0000:0003:0004:0005:0006:0201:0202:fcc0" {
} "pid": "00803109",
} "name": "Air Switch Gateway",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3109,
"pid": "00048612", "productType": "airSwitchGateway",
"name": "XC Scene Panel 6G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3110, "zid": "0300",
"productType": "scene",
"cluster": {
"eps": [ "client": "0003:0006",
{ "server": "0000:0003:0004:0005:0006:0201:0202:fcc0"
"zid": "0004", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00048612",
} "name": "XC Scene Panel 6G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3110,
"pid": "00068634", "productType": "scene",
"name": "HD Wall switch 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3115, "zid": "0004",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068634",
} "name": "HD Wall switch 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3115,
"pid": "00088626", "productType":"switch",
"name": "XB Fresh Air Panel",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3116, "zid": "0103",
"productType": "freshAir",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0300", }
}
"cluster": { ]
"client": "0003:0006", },
"server": "0000:0003:0004:0005:0006:0201:0202" {
} "pid": "00088626",
} "name": "XB Fresh Air Panel",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3116,
"pid": "03020003", "productType": "freshAir",
"name": "TQ Environment Detection",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3119, "zid": "0300",
"productType": "Environmental",
"cluster": {
"eps": [ "client": "0003:0006",
{ "server": "0000:0003:0004:0005:0006:0201:0202"
"zid": "0302", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0400:0402:0405:040D:042A:042B" {
} "pid": "03020003",
} "name": "TQ Environment Detection",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3119,
"pid": "00803122", "productType": "Environmental",
"name": "BL Fresh Air Gateway",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3122, "zid": "0302",
"productType": "freshAirGateway",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0400:0402:0405:040D:042A:042B"
"zid": "0300", }
}
"cluster": { ]
"client": "0003:0006", },
"server": "0000:0003:0004:0005:0006:0201:0202:fcc0" {
} "pid": "00803122",
} "name": "BL Fresh Air Gateway",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3122,
"pid": "04022115", "productType": "freshAirGateway",
"name": "XB SOS Button",
"type": "ZSED", "eps": [
"ota": false, {
"b_pid": 3124, "zid": "0300",
"productType": "IASsensor",
"cluster": {
"eps": [ "client": "0003:0006",
{ "server": "0000:0003:0004:0005:0006:0201:0202:fcc0"
"zid": "0402", }
"zone_type":"002C", }
]
"cluster": { },
"client": "0003", {
"server": "0000:0003:0500" "pid": "04022115",
} "name": "XB SOS Button",
} "type": "ZSED",
] "ota": false,
}, "b_pid": 3124,
{ "productType": "IASsensor",
"pid": "0006862A",
"name": "XB Singal Fire Switch 1G", "eps": [
"type": "ZED", {
"ota": true, "zid": "0402",
"b_pid": 3129, "zone_type":"002C",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003",
{ "server": "0000:0003:0500"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "0006862A",
} "name": "XB Singal Fire Switch 1G",
] "type": "ZED",
}, "ota": true,
{ "b_pid": 3129,
"pid": "0006862B", "productType":"switch",
"name": "XB Singal Fire Switch 2G",
"type": "ZED", "eps": [
"ota": true, {
"b_pid": 3130, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "0006862B",
} "name": "XB Singal Fire Switch 2G",
] "type": "ZED",
}, "ota": true,
{ "b_pid": 3130,
"pid": "0006862C", "productType":"switch",
"name": "XB Singal Fire Switch 3G",
"type": "ZED", "eps": [
"ota": true, {
"b_pid": 3131, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "0006862C",
} "name": "XB Singal Fire Switch 3G",
] "type": "ZED",
}, "ota": true,
{ "b_pid": 3131,
"pid": "03020004", "productType":"switch",
"name": "TQ Environment Detection Panel",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3132, "zid": "0103",
"productType": "Environmental",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0302", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0400:0402:0405:040D:042A:042B" {
} "pid": "03020004",
} "name": "TQ Environment Detection Panel",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3132,
"pid": "01021000", "productType": "Environmental",
"name": "YY Dimmalbe Light 5W",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3137, "zid": "0302",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0400:0402:0405:040D:042A:042B"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01021000",
} "name": "YY Dimmalbe Light 5W",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3137,
"pid": "01000004", "productType":"lightPanel",
"name": "Four Lamp Control Module",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3138, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "01000004",
} "name": "Four Lamp Control Module",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3138,
"pid": "00068651", "productType":"switch",
"name": "YH Wall switch 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3142, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068651",
} "name": "YH Wall switch 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3142,
"pid": "00068652", "productType":"switch",
"name": "YH Wall switch 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3143, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068652",
} "name": "YH Wall switch 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3143,
"pid": "00068653", "productType":"switch",
"name": "YH Wall switch 3G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3144, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068653",
} "name": "YH Wall switch 3G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3144,
"pid": "00068654", "productType":"switch",
"name": "YH Wall switch 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3145, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068654",
} "name": "YH Wall switch 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3145,
"pid": "00048651", "productType":"switch",
"name": "YH Scene Panel 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3146, "zid": "0103",
"productType": "scene",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0004", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00048651",
} "name": "YH Scene Panel 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3146,
"pid": "00038651", "productType": "scene",
"name": "YH Curtain Panel 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3147, "zid": "0004",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0203", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "00038651",
} "name": "YH Curtain Panel 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3147,
"pid": "00038652", "productType": "curtain",
"name": "YH Curtain Panel 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3148, "zid": "0203",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0203", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "00038652",
} "name": "YH Curtain Panel 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3148,
"pid": "00068661", "productType": "curtain",
"name": "GN Wall switch 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3149, "zid": "0203",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068661",
} "name": "GN Wall switch 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3149,
"pid": "00068662", "productType":"switch",
"name": "GN Wall switch 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3150, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068662",
} "name": "GN Wall switch 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3150,
"pid": "00068663", "productType":"switch",
"name": "GN Wall switch 3G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3151, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068663",
} "name": "GN Wall switch 3G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3151,
"pid": "00068664", "productType":"switch",
"name": "GN Wall switch 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3152, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068664",
} "name": "GN Wall switch 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3152,
"pid": "00048661", "productType":"switch",
"name": "GN Scene Panel 4G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3153, "zid": "0103",
"productType": "scene",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0004", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00048661",
} "name": "GN Scene Panel 4G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3153,
"pid": "00038661", "productType": "scene",
"name": "GN Curtain Panel 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3154, "zid": "0004",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0203", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "00038661",
} "name": "GN Curtain Panel 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3154,
"pid": "00038662", "productType": "curtain",
"name": "GN Curtain Panel 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3155, "zid": "0203",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0203", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "00038662",
} "name": "GN Curtain Panel 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3155,
"pid": "00068641", "productType": "curtain",
"name": "MS Wall switch 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3156, "zid": "0203",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068641",
} "name": "MS Wall switch 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3156,
"pid": "00068642", "productType":"switch",
"name": "MS Wall switch 2G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3157, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068642",
} "name": "MS Wall switch 2G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3157,
"pid": "00068643", "productType":"switch",
"name": "MS Wall switch 3G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3158, "zid": "0103",
"productType":"switch",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00068643",
} "name": "MS Wall switch 3G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3158,
"pid": "00048641", "productType":"switch",
"name": "MS Scene Panel 3G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3164, "zid": "0103",
"productType": "scene",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0004", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "00048641",
} "name": "MS Scene Panel 3G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3164,
"pid": "00038641", "productType": "scene",
"name": "MS Curtain Panel 1G",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3165, "zid": "0004",
"productType": "curtain",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006"
"zid": "0203", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0102" {
} "pid": "00038641",
} "name": "MS Curtain Panel 1G",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3165,
"pid": "01010004", "productType": "curtain",
"name": "YY Linear Dimmalbe Light Model G4 With Level",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3166, "zid": "0203",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0102"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01010004",
} "name": "YY Linear Dimmalbe Light Model G4 With Level",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3166,
"pid": "010C0002", "productType":"lightPanel",
"name": "YY Linear Dimmalbe Light Model G4 With ColorTemp",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3167, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "010C0002",
} "name": "YY Linear Dimmalbe Light Model G4 With ColorTemp",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3167,
"pid": "010C0021", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 12W With ColorTemp",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3169, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01010014",
} "name": "YY Live_Neutral_Wire Dimmalbe Light Model G4",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3168,
"pid": "01010021", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 12W With Level",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3170, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "010C0021",
} "name": "YY Dimmalbe Light Controler 12W With ColorTemp",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3169,
"pid": "010C0031", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 20W With ColorTemp",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3171, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01010021",
} "name": "YY Dimmalbe Light Controler 12W With Level",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3170,
"pid": "01010031", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 20W With Level",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3172, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "010C0031",
} "name": "YY Dimmalbe Light Controler 20W With ColorTemp",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3171,
"pid": "010C0041", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 8W With ColorTemp",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3173, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01010031",
} "name": "YY Dimmalbe Light Controler 20W With Level",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3172,
"pid": "01010041", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 8W With Level",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3174, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "010C0041",
} "name": "YY Dimmalbe Light Controler 8W With ColorTemp",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3173,
"pid": "010C0051", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 14W With ColorTemp",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3175, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01010041",
} "name": "YY Dimmalbe Light Controler 8W With Level",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3174,
"pid": "01010051", "productType":"lightPanel",
"name": "YY Dimmalbe Light Controler 14W With Level",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3176, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "010C0051",
} "name": "YY Dimmalbe Light Controler 14W With ColorTemp",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3175,
"pid": "010D0062", "productType":"lightPanel",
"name": "YY RGBCW Light Belt Controller",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3177, "zid": "0103",
"productType": "colorDimmableLight",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0102", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "01010051",
} "name": "YY Dimmalbe Light Controler 14W With Level",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3176,
"pid": "010D0061", "productType":"lightPanel",
"name": "YY CW Light Belt Controller",
"type": "ZR", "eps": [
"ota": true, {
"b_pid": 3178, "zid": "0103",
"productType":"lightPanel",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0103", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006:0008:0300" {
} "pid": "010D0062",
} "name": "YY RGBCW Light Belt Controller",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3177,
"pid": "00041002", "productType": "colorDimmableLight",
"name": "XB KeyBord Panel G3",
"type": "ZSED", "eps": [
"ota": true, {
"b_pid": 3185, "zid": "0102",
"productType": "scene",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "0004", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0003:0004:0005:0006" {
} "pid": "010D0061",
} "name": "YY CW Light Belt Controller",
] "type": "ZR",
}, "ota": true,
{ "b_pid": 3178,
"pid": "000A0002", "productType":"lightPanel",
"name": "YC Doorlock",
"type": "ZSED", "eps": [
"ota": false, {
"b_pid": 4508, "zid": "0103",
"productType": "Doorlock",
"cluster": {
"eps": [ "client": "0003:0019",
{ "server": "0000:0003:0004:0005:0006:0008:0300"
"zid": "000A", }
}
"cluster": { ]
"client": "0003:0019", },
"server": "0000:0001:0003:0101:0B05" {
} "pid": "00041002",
} "name": "XB KeyBord Panel G3",
] "type": "ZSED",
} "ota": true,
] "b_pid": 3185,
"productType": "scene",
"eps": [
{
"zid": "0004",
"cluster": {
"client": "0003:0019",
"server": "0000:0003:0004:0005:0006"
}
}
]
}
]
} }
\ No newline at end of file
...@@ -237,6 +237,29 @@ endif ...@@ -237,6 +237,29 @@ endif
fromdos $(releaseDir)/script/*.sh fromdos $(releaseDir)/script/*.sh
echo $(PWD) echo $(PWD)
package_a133:
@echo "$(buildDate)"
echo "kk_a133"
rm -rf kk_a133
mkdir kk_a133
mkdir kk_a133/lib
mkdir kk_a133/bin
mkdir kk_a133/etc
mkdir kk_a133/map
cp -rf $(TOP_DIR)/VERSION $(TOP_DIR)/kk_a133/etc/
cp -rf $(TOP_DIR)/tsl $(TOP_DIR)/kk_a133
cp -rf $(TOP_DIR)/output/release/lib/*.so $(TOP_DIR)/kk_a133/lib
cp -rf $(TOP_DIR)/output/release/bin/* $(TOP_DIR)/kk_a133/bin
cp -rf $(TOP_DIR)/opcodeMapCfg/* $(TOP_DIR)/kk_a133/map
cp -rf $(TOP_DIR)/config/* $(TOP_DIR)/kk_a133/etc
cp -rf $(TOP_DIR)/common/nanomsg/libnanomsg_a133.so $(TOP_DIR)/kk_a133/lib/libnanomsg.so.5
cp -rf $(TOP_DIR)/common/ev/libev_a133.so $(TOP_DIR)/kk_a133/lib/libev.so
cp -rf $(TOP_DIR)/common/curl/libcurl_a133.so $(TOP_DIR)/kk_a133/lib/libcurl.so.4
cp -rf $(TOP_DIR)/common/curl/libcrypto_a133.so $(TOP_DIR)/kk_a133/lib/libcrypto.so.1.1
cp -rf $(TOP_DIR)/common/curl/libssl_a133.so $(TOP_DIR)/kk_a133/lib/libssl.so.1.1
cp -rf $(TOP_DIR)/nx5_soc_gw/smarthome_z3gw_a133 $(TOP_DIR)/kk_a133/bin/smarthome_z3gw
cp -rf $(TOP_DIR)/nx5_soc_gw/kk_device_def.json $(TOP_DIR)/kk_a133/etc/
squashfs: package squashfs: package
@echo "build squashfs" @echo "build squashfs"
......
{
"schema": "https://iot-ap.ikonke.com/model/ccu_12.json",
"productType": "ccu",
"profile": {
"heartbeat": "3000",
"productCode": "12",
"productName": "主机"
},
"properties": [
{
"identifier": "SN",
"dataType": {
"specs": {
"length": "50"
},
"type": "text"
},
"name": "设备SN",
"accessMode": "r",
"required": false
},
{
"identifier": "MACAddress",
"dataType": {
"specs": {
"length": "128"
},
"type": "text"
},
"name": "MAC地址",
"accessMode": "r",
"required": false
},
{
"identifier": "LanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址",
"accessMode": "r",
"required": false
},
{
"identifier": "WanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址",
"accessMode": "r",
"required": false
},
{
"identifier": "WanState",
"dataType": {
"specs": {
"0": "无外网",
"1": "有外网"
},
"type": "bool"
},
"name": "外网链路状态",
"accessMode": "r",
"required": false
},
{
"identifier": "IOTCloudState",
"dataType": {
"specs": {
"0": "无服务",
"1": "有服务"
},
"type": "bool"
},
"name": "云服务状态",
"accessMode": "r",
"required": false
},
{
"identifier": "Version",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "版本",
"accessMode": "r",
"required": false
},
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态",
"accessMode": "rw",
"required": false
}
],
"services": [
{
"outputData": [],
"identifier": "set",
"inputData": [
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态"
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
"identifier": "SN",
"dataType": {
"specs": {
"length": "50"
},
"type": "text"
},
"name": "设备SN"
},
{
"identifier": "MACAddress",
"dataType": {
"specs": {
"length": "128"
},
"type": "text"
},
"name": "MAC地址"
},
{
"identifier": "LanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanState",
"dataType": {
"specs": {
"0": "无外网",
"1": "有外网"
},
"type": "bool"
},
"name": "外网链路状态"
},
{
"identifier": "IOTCloudState",
"dataType": {
"specs": {
"0": "无服务",
"1": "有服务"
},
"type": "bool"
},
"name": "云服务状态"
},
{
"identifier": "Version",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "版本"
},
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态"
}
],
"identifier": "get",
"inputData": [
"SN",
"MACAddress",
"LanIPAddress",
"WanIPAddress",
"IOTCloudState",
"Version",
"ArmingState"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
},
{
"outputData": [],
"identifier": "reboot",
"inputData": [],
"method": "thing.service.reboot",
"name": "reboot",
"required": false,
"callType": "async",
"desc": "重启"
},
{
"outputData": [],
"identifier": "addRoom",
"inputData": [
{
"identifier": "roomName",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间名字"
}
],
"method": "thing.service.addRoom",
"name": "addRoom",
"required": true,
"callType": "async",
"desc": "添加房间"
},
{
"outputData": [],
"identifier": "addDeviceToRoom",
"inputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
},
{
"identifier": "deviceCode",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "设备编码"
},
{
"identifier": "epNum",
"dataType": {
"specs": {
"length": "10"
},
"type": "text"
},
"name": "设备路数"
}
],
"method": "thing.service.addDeviceToRoom",
"name": "addDeviceToRoom",
"required": true,
"callType": "async",
"desc": "添加设备到房间"
},
{
"outputData": [],
"identifier": "removeDeviceFromRoom",
"inputData": [
{
"identifier": "deviceCode",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "设备编码"
},
{
"identifier": "epNum",
"dataType": {
"specs": {
"length": "10"
},
"type": "text"
},
"name": "设备路数"
}
],
"method": "thing.service.removeDeviceFromRoom",
"name": "removeDeviceFromRoom",
"required": true,
"callType": "async",
"desc": "移除设备从房间"
},
{
"outputData": [],
"identifier": "deleteRoom",
"inputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
}
],
"method": "thing.service.deleteRoom",
"name": "deleteRoom",
"required": true,
"callType": "async",
"desc": "删除房间"
},
{
"outputData": [],
"identifier": "executeRoom",
"inputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
},
{
"identifier": "productType",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "产品类别"
},
{
"identifier": "action",
"dataType": {
"type": "struct",
"specs": [
{
"identifier": "PowerSwitch",
"dataType": {
"specs": {
"0": "关闭",
"1": "打开"
},
"type": "bool"
},
"name": "电源开关"
}
]
},
"name": "动作"
}
],
"method": "thing.service.executeRoom",
"name": "executeRoom",
"required": true,
"callType": "async",
"desc": "批量执行房间设备"
}
],
"events": [
{
"outputData": [
{
"identifier": "SN",
"dataType": {
"specs": {
"length": "50"
},
"type": "text"
},
"name": "设备SN"
},
{
"identifier": "MACAddress",
"dataType": {
"specs": {
"length": "128"
},
"type": "text"
},
"name": "MAC地址"
},
{
"identifier": "LanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanState",
"dataType": {
"specs": {
"0": "无外网",
"1": "有外网"
},
"type": "bool"
},
"name": "外网链路状态"
},
{
"identifier": "IOTCloudState",
"dataType": {
"specs": {
"0": "无服务",
"1": "有服务"
},
"type": "bool"
},
"name": "云服务状态"
},
{
"identifier": "Version",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "版本"
},
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态"
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [],
"identifier": "rebootNotification",
"method": "thing.event.rebootNotification.post",
"name": "重启通知消息",
"type": "info",
"required": true
},
{
"outputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
}
],
"identifier": "addRoomNotification",
"method": "thing.event.addRoomNotification.post",
"name": "房间添加通知消息",
"type": "info",
"required": true
},
{
"outputData": [
{
"identifier": "ErrorCode",
"dataType": {
"specs": {
"0": "正常"
},
"type": "enum"
},
"name": "故障代码"
}
],
"identifier": "error",
"method": "thing.event.error.post",
"name": "故障上报",
"type": "error",
"required": true
}
]
}
\ No newline at end of file
{
"schema": "https://iot-ap.ikonke.com/model/ccu_12_scene.json",
"productType": "ccu",
"profile": {
"heartbeat": "3000",
"productCode": "12",
"productName": "主机"
},
"properties": [{
"identifier": "Scene",
"name": "场景",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "struct",
"specs": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "name",
"name": "场景名字",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneType",
"name": "场景类型",
"dataType": {
"type": "enum",
"specs": {
"0": "情景模式",
"1": "IFTTT",
"2": "定时",
"3": "多控"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}, {
"identifier": "triggers",
"name": "触发条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "conditions",
"name": "限制条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "actions",
"name": "动作",
"dataType": {
"type": "struct",
"specs": {}
}
}]
}
}, {
"identifier": "triggers",
"name": "触发场景",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "struct",
"specs": [{
"identifier": "items",
"name": "记录",
"dataType": {
"type": "array",
"specs": {
"size": "128",
"item": {
"type": "struct",
"specs": [{
"identifier": "type",
"name": "触发类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareType",
"name": "标记类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareValue",
"name": "比较值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
},
"item1": {
"name": "定时时间",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "限制类型 trigger/timing",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "time",
"name": "定时时间",
"dataType": {
"type": "int",
"specs": {}
}
}, {
"identifier": "week",
"name": "重复的周期",
"dataType": {
"type": "text",
"specs": {}
}
}]
}
}
}
}]
}
}, {
"identifier": "conditions",
"name": "限制条件",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "struct",
"specs": [{
"identifier": "items",
"name": "记录",
"dataType": {
"type": "array",
"specs": {
"size": "128",
"item": {
"name": "时间限制条件",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "限制类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "startTime",
"name": "开始时间 UTC时间 秒",
"dataType": {
"type": "int",
"specs": {}
}
}, {
"identifier": "endTime",
"name": "结束时间 UTC时间 秒",
"dataType": {
"type": "int",
"specs": {}
}
}, {
"identifier": "crossDay",
"name": "是否垮天",
"dataType": {
"type": "enum",
"specs": {
"0": "非跨天",
"1": "垮天"
}
}
}, {
"identifier": "repeat_days",
"name": "重复的天 为空是不重复",
"dataType": {
"type": "array",
"specs": {
"size": "7",
"item": {
"type": "int",
"specs": [1, 2, 3, 4, 5, 6, 7]
}
}
}
}]
},
"item1": {
"name": "设备属性限制条件",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "触发类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareType",
"name": "标记类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareValue",
"name": "比较值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}
}
}
}]
}
}, {
"identifier": "actions",
"name": "执行动作",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "array",
"specs": {
"size": "128",
"item": {
"name": "设置属性",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "propertyValue",
"name": "属性值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "delay",
"name": "延迟时间 单位s",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "86400"
}
}
}]
},
"item1": {
"name": "批量动作",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/thing/setProperty",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "productType",
"name": "批量执行的产品品类",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "propertyValue",
"name": "属性值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
},
"item2": {
"name": "嵌套场景",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/scene",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "delay",
"name": "延迟时间 单位s",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "86400"
}
}
}]
},
"item3": {
"name": "多控",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/thing/group",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}]
},
"item4": {
"name": "调用服务",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/thing/invokeService",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "identifier",
"name": "服务唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "args",
"name": "参数",
"dataType": {
"type": "struct",
"specs": {
"desc": "服务调用的传参"
}
}
}]
}
}
}
}],
"events": [{
"identifier": "addSceneNotification",
"name": "添加场景通知",
"type": "info",
"required": true,
"method": "thing.event.addSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}, {
"identifier": "updateSceneNotification",
"name": "修改场景通知",
"type": "info",
"required": true,
"method": "thing.event.updateSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}, {
"identifier": "deleteSceneNotification",
"name": "删除场景通知",
"type": "info",
"required": true,
"method": "thing.event.deleteSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}, {
"identifier": "executeSceneNotification",
"name": "执行场景通知",
"type": "info",
"required": true,
"method": "thing.event.executeSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}],
"services": [{
"identifier": "addScene",
"name": "addScene",
"required": true,
"callType": "async",
"desc": "添加场景",
"method": "thing.service.addScene",
"inputData": [{
"identifier": "name",
"name": "场景名字",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneType",
"name": "场景类型",
"dataType": {
"type": "enum",
"specs": {
"0": "情景模式",
"1": "IFTTT",
"2": "定时"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}, {
"identifier": "triggers",
"name": "触发条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "conditions",
"name": "限制条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "actions",
"name": "动作",
"dataType": {
"type": "struct",
"specs": {}
}
}],
"outputData": []
}, {
"identifier": "updateScene",
"name": "updateScene",
"required": true,
"callType": "async",
"desc": "修改场景",
"method": "thing.service.updateScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "name",
"name": "场景名字",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneType",
"name": "场景类型",
"dataType": {
"type": "enum",
"specs": {
"0": "情景模式",
"1": "IFTTT",
"2": "定时"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}, {
"identifier": "triggers",
"name": "触发条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "conditions",
"name": "限制条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "actions",
"name": "动作",
"dataType": {
"type": "struct",
"specs": {}
}
}],
"outputData": []
}, {
"identifier": "deleteScene",
"name": "deleteScene",
"required": true,
"callType": "async",
"desc": "删除场景",
"method": "thing.service.deleteScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}],
"outputData": []
}, {
"identifier": "executeScene",
"name": "executeScene",
"required": true,
"callType": "async",
"desc": "执行场景",
"method": "thing.service.executeScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}],
"outputData": []
}, {
"identifier": "enableScene",
"name": "enableScene",
"required": true,
"callType": "async",
"desc": "enable场景",
"method": "thing.service.executeScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}],
"outputData": []
}]
}
\ No newline at end of file
{
"schema": "https://iot-ap.ikonke.com/model/ccu_15.json",
"productType": "ccu",
"profile": {
"heartbeat": "3000",
"productCode": "15",
"productName": "主机"
},
"properties": [
{
"identifier": "SN",
"dataType": {
"specs": {
"length": "50"
},
"type": "text"
},
"name": "设备SN",
"accessMode": "r",
"required": false
},
{
"identifier": "MACAddress",
"dataType": {
"specs": {
"length": "128"
},
"type": "text"
},
"name": "MAC地址",
"accessMode": "r",
"required": false
},
{
"identifier": "LanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址",
"accessMode": "r",
"required": false
},
{
"identifier": "WanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址",
"accessMode": "r",
"required": false
},
{
"identifier": "WanState",
"dataType": {
"specs": {
"0": "无外网",
"1": "有外网"
},
"type": "bool"
},
"name": "外网链路状态",
"accessMode": "r",
"required": false
},
{
"identifier": "IOTCloudState",
"dataType": {
"specs": {
"0": "无服务",
"1": "有服务"
},
"type": "bool"
},
"name": "云服务状态",
"accessMode": "r",
"required": false
},
{
"identifier": "Version",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "版本",
"accessMode": "r",
"required": false
},
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态",
"accessMode": "rw",
"required": false
}
],
"services": [
{
"outputData": [],
"identifier": "set",
"inputData": [
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态"
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
"identifier": "SN",
"dataType": {
"specs": {
"length": "50"
},
"type": "text"
},
"name": "设备SN"
},
{
"identifier": "MACAddress",
"dataType": {
"specs": {
"length": "128"
},
"type": "text"
},
"name": "MAC地址"
},
{
"identifier": "LanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanState",
"dataType": {
"specs": {
"0": "无外网",
"1": "有外网"
},
"type": "bool"
},
"name": "外网链路状态"
},
{
"identifier": "IOTCloudState",
"dataType": {
"specs": {
"0": "无服务",
"1": "有服务"
},
"type": "bool"
},
"name": "云服务状态"
},
{
"identifier": "Version",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "版本"
},
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态"
}
],
"identifier": "get",
"inputData": [
"SN",
"MACAddress",
"LanIPAddress",
"WanIPAddress",
"IOTCloudState",
"Version",
"ArmingState"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
},
{
"outputData": [],
"identifier": "reboot",
"inputData": [],
"method": "thing.service.reboot",
"name": "reboot",
"required": false,
"callType": "async",
"desc": "重启"
},
{
"outputData": [],
"identifier": "addRoom",
"inputData": [
{
"identifier": "roomName",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间名字"
}
],
"method": "thing.service.addRoom",
"name": "addRoom",
"required": true,
"callType": "async",
"desc": "添加房间"
},
{
"outputData": [],
"identifier": "addDeviceToRoom",
"inputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
},
{
"identifier": "deviceCode",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "设备编码"
},
{
"identifier": "epNum",
"dataType": {
"specs": {
"length": "10"
},
"type": "text"
},
"name": "设备路数"
}
],
"method": "thing.service.addDeviceToRoom",
"name": "addDeviceToRoom",
"required": true,
"callType": "async",
"desc": "添加设备到房间"
},
{
"outputData": [],
"identifier": "removeDeviceFromRoom",
"inputData": [
{
"identifier": "deviceCode",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "设备编码"
},
{
"identifier": "epNum",
"dataType": {
"specs": {
"length": "10"
},
"type": "text"
},
"name": "设备路数"
}
],
"method": "thing.service.removeDeviceFromRoom",
"name": "removeDeviceFromRoom",
"required": true,
"callType": "async",
"desc": "移除设备从房间"
},
{
"outputData": [],
"identifier": "deleteRoom",
"inputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
}
],
"method": "thing.service.deleteRoom",
"name": "deleteRoom",
"required": true,
"callType": "async",
"desc": "删除房间"
},
{
"outputData": [],
"identifier": "executeRoom",
"inputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
},
{
"identifier": "productType",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "产品类别"
},
{
"identifier": "action",
"dataType": {
"type": "struct",
"specs": [
{
"identifier": "PowerSwitch",
"dataType": {
"specs": {
"0": "关闭",
"1": "打开"
},
"type": "bool"
},
"name": "电源开关"
}
]
},
"name": "动作"
}
],
"method": "thing.service.executeRoom",
"name": "executeRoom",
"required": true,
"callType": "async",
"desc": "批量执行房间设备"
}
],
"events": [
{
"outputData": [
{
"identifier": "SN",
"dataType": {
"specs": {
"length": "50"
},
"type": "text"
},
"name": "设备SN"
},
{
"identifier": "MACAddress",
"dataType": {
"specs": {
"length": "128"
},
"type": "text"
},
"name": "MAC地址"
},
{
"identifier": "LanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanIPAddress",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "内网IP地址"
},
{
"identifier": "WanState",
"dataType": {
"specs": {
"0": "无外网",
"1": "有外网"
},
"type": "bool"
},
"name": "外网链路状态"
},
{
"identifier": "IOTCloudState",
"dataType": {
"specs": {
"0": "无服务",
"1": "有服务"
},
"type": "bool"
},
"name": "云服务状态"
},
{
"identifier": "Version",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "版本"
},
{
"identifier": "ArmingState",
"dataType": {
"specs": {
"length": "255"
},
"type": "text"
},
"name": "安防状态"
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
},
{
"outputData": [],
"identifier": "rebootNotification",
"method": "thing.event.rebootNotification.post",
"name": "重启通知消息",
"type": "info",
"required": true
},
{
"outputData": [
{
"identifier": "roomId",
"dataType": {
"specs": {
"length": "256"
},
"type": "text"
},
"name": "房间id"
}
],
"identifier": "addRoomNotification",
"method": "thing.event.addRoomNotification.post",
"name": "房间添加通知消息",
"type": "info",
"required": true
},
{
"outputData": [
{
"identifier": "ErrorCode",
"dataType": {
"specs": {
"0": "正常"
},
"type": "enum"
},
"name": "故障代码"
}
],
"identifier": "error",
"method": "thing.event.error.post",
"name": "故障上报",
"type": "error",
"required": true
}
]
}
\ No newline at end of file
{
"schema": "https://iot-ap.ikonke.com/model/ccu_15_scene.json",
"productType": "ccu",
"profile": {
"heartbeat": "3000",
"productCode": "15",
"productName": "主机"
},
"properties": [{
"identifier": "Scene",
"name": "场景",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "struct",
"specs": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "name",
"name": "场景名字",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneType",
"name": "场景类型",
"dataType": {
"type": "enum",
"specs": {
"0": "情景模式",
"1": "IFTTT",
"2": "定时",
"3": "多控"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}, {
"identifier": "triggers",
"name": "触发条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "conditions",
"name": "限制条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "actions",
"name": "动作",
"dataType": {
"type": "struct",
"specs": {}
}
}]
}
}, {
"identifier": "triggers",
"name": "触发场景",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "struct",
"specs": [{
"identifier": "items",
"name": "记录",
"dataType": {
"type": "array",
"specs": {
"size": "128",
"item": {
"type": "struct",
"specs": [{
"identifier": "type",
"name": "触发类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareType",
"name": "标记类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareValue",
"name": "比较值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
},
"item1": {
"name": "定时时间",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "限制类型 trigger/timing",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "time",
"name": "定时时间",
"dataType": {
"type": "int",
"specs": {}
}
}, {
"identifier": "week",
"name": "重复的周期",
"dataType": {
"type": "text",
"specs": {}
}
}]
}
}
}
}]
}
}, {
"identifier": "conditions",
"name": "限制条件",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "struct",
"specs": [{
"identifier": "items",
"name": "记录",
"dataType": {
"type": "array",
"specs": {
"size": "128",
"item": {
"name": "时间限制条件",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "限制类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "startTime",
"name": "开始时间 UTC时间 秒",
"dataType": {
"type": "int",
"specs": {}
}
}, {
"identifier": "endTime",
"name": "结束时间 UTC时间 秒",
"dataType": {
"type": "int",
"specs": {}
}
}, {
"identifier": "crossDay",
"name": "是否垮天",
"dataType": {
"type": "enum",
"specs": {
"0": "非跨天",
"1": "垮天"
}
}
}, {
"identifier": "repeat_days",
"name": "重复的天 为空是不重复",
"dataType": {
"type": "array",
"specs": {
"size": "7",
"item": {
"type": "int",
"specs": [1, 2, 3, 4, 5, 6, 7]
}
}
}
}]
},
"item1": {
"name": "设备属性限制条件",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "触发类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareType",
"name": "标记类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "compareValue",
"name": "比较值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}
}
}
}]
}
}, {
"identifier": "actions",
"name": "执行动作",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "array",
"specs": {
"size": "128",
"item": {
"name": "设置属性",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "propertyValue",
"name": "属性值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "delay",
"name": "延迟时间 单位s",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "86400"
}
}
}]
},
"item1": {
"name": "批量动作",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/thing/setProperty",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "productType",
"name": "批量执行的产品品类",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "propertyName",
"name": "属性名",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "propertyValue",
"name": "属性值",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
},
"item2": {
"name": "嵌套场景",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/scene",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "delay",
"name": "延迟时间 单位s",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "86400"
}
}
}]
},
"item3": {
"name": "多控",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/thing/group",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "epNum",
"name": "端点号",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100"
}
}
}]
},
"item4": {
"name": "调用服务",
"type": "struct",
"specs": [{
"identifier": "type",
"name": "动作类型 action/thing/invokeService",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "deviceCode",
"name": "设备唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "identifier",
"name": "服务唯一标识",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "args",
"name": "参数",
"dataType": {
"type": "struct",
"specs": {
"desc": "服务调用的传参"
}
}
}]
}
}
}
}],
"events": [{
"identifier": "addSceneNotification",
"name": "添加场景通知",
"type": "info",
"required": true,
"method": "thing.event.addSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}, {
"identifier": "updateSceneNotification",
"name": "修改场景通知",
"type": "info",
"required": true,
"method": "thing.event.updateSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}, {
"identifier": "deleteSceneNotification",
"name": "删除场景通知",
"type": "info",
"required": true,
"method": "thing.event.deleteSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}, {
"identifier": "executeSceneNotification",
"name": "执行场景通知",
"type": "info",
"required": true,
"method": "thing.event.executeSceneNotification.post",
"outputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}]
}],
"services": [{
"identifier": "addScene",
"name": "addScene",
"required": true,
"callType": "async",
"desc": "添加场景",
"method": "thing.service.addScene",
"inputData": [{
"identifier": "name",
"name": "场景名字",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneType",
"name": "场景类型",
"dataType": {
"type": "enum",
"specs": {
"0": "情景模式",
"1": "IFTTT",
"2": "定时"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}, {
"identifier": "triggers",
"name": "触发条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "conditions",
"name": "限制条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "actions",
"name": "动作",
"dataType": {
"type": "struct",
"specs": {}
}
}],
"outputData": []
}, {
"identifier": "updateScene",
"name": "updateScene",
"required": true,
"callType": "async",
"desc": "修改场景",
"method": "thing.service.updateScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "name",
"name": "场景名字",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "sceneType",
"name": "场景类型",
"dataType": {
"type": "enum",
"specs": {
"0": "情景模式",
"1": "IFTTT",
"2": "定时"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}, {
"identifier": "triggers",
"name": "触发条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "conditions",
"name": "限制条件",
"dataType": {
"type": "struct",
"specs": {}
}
}, {
"identifier": "actions",
"name": "动作",
"dataType": {
"type": "struct",
"specs": {}
}
}],
"outputData": []
}, {
"identifier": "deleteScene",
"name": "deleteScene",
"required": true,
"callType": "async",
"desc": "删除场景",
"method": "thing.service.deleteScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}],
"outputData": []
}, {
"identifier": "executeScene",
"name": "executeScene",
"required": true,
"callType": "async",
"desc": "执行场景",
"method": "thing.service.executeScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}],
"outputData": []
}, {
"identifier": "enableScene",
"name": "enableScene",
"required": true,
"callType": "async",
"desc": "enable场景",
"method": "thing.service.executeScene",
"inputData": [{
"identifier": "sceneId",
"name": "场景id",
"dataType": {
"type": "text",
"specs": {
"length": "255"
}
}
}, {
"identifier": "enable",
"name": "启用",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭",
"1": "启用"
}
}
}],
"outputData": []
}]
}
\ 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