Commit 254c2dc9 authored by 陈伟灿's avatar 陈伟灿

Merge branch 'cwc' into 'master'

【修改内容】修改物模型相关

See merge request chenweican/k-sdk!123
parents 73987d9f f2aca24d
......@@ -232,7 +232,7 @@ static char *kk_open_lan_cfg_file(char *deviceCode)
memset(buf,0x0,filesize+1);
fseek(fp, 0L, SEEK_SET);
fread(buf, 1, filesize, fp);
printf("[read lan cfg]:%s\n",buf);
//printf("[read lan cfg]:%s\n",buf);
fclose(fp);
return buf;
......
......@@ -1101,14 +1101,14 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
return;
}
info_root = cJSON_GetObjectItem(json, MSG_INFO_STR);
if(info_root == NULL) return;
if(info_root == NULL) goto directReturn;;
typeJson = cJSON_GetObjectItem(info_root, MSG_TYPE_STR);
if(typeJson == NULL) return;
if(typeJson == NULL) goto directReturn;;
payload = cJSON_GetObjectItem(json, MSG_PAYLOAD_STR);
if(payload == NULL) return;
if(payload == NULL) goto directReturn;;
payload_Str = cJSON_Print(payload);
deviceCode = cJSON_GetObjectItem(info_root, MSG_DEVICE_CODE_STR);
if(deviceCode == NULL) return;
if(deviceCode == NULL) goto directReturn;;
if (strstr(typeJson->valuestring,KK_REGISTER_TOPIC_REPLY)){
INFO_PRINT(" topic:register_reply \n");
......@@ -1370,9 +1370,11 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
}
directReturn:
_iotx_linkkit_mutex_unlock();
if(payload_Str != NULL){
free(payload_Str);
}
cJSON_Delete(json);
_iotx_linkkit_mutex_unlock();
}
/************************************************************
......
......@@ -69,6 +69,7 @@ static void HAL_Ccuid_version(void)
if(!(fp = fopen(KK_VERSION_FILE_PATH,"r")))
{
ERROR_PRINT("can't open the file tslPath:%s\n",KK_VERSION_FILE_PATH);
strncpy(s_Version, KK_CCU_VERSION, strlen(KK_CCU_VERSION));
return ;
}
fread(s_Version, 1, VERSION_MAXLEN, fp);
......
......@@ -644,7 +644,6 @@ int kk_scene_parse_scene_trigger(const cJSON* str,const char *sceneId)
if(type == NULL) return FAIL_RETURN;
if(!strcmp("trigger/thing/property",type->valuestring)){
printf("---------------->isAnd=0\n");
res = kk_scene_parse_trigger_detail(type->valuestring,item,sceneId,0);
if(res != SUCCESS_RETURN){
ERROR_PRINT("kk_scene_parse_scene_trigger fail!!!\n");
......@@ -860,7 +859,6 @@ int kk_scene_parse_scene_condition(const cJSON* str,const char *sceneId)
}
}
else if(!strcmp("trigger/thing/property",type->valuestring)){
printf("---------------->isAnd=1\n");
kk_scene_parse_trigger_detail(type->valuestring,item,sceneId,1);
}
else{
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3030.json",
"productType": "floorHeating",
"version": "1.2",
"profile": {
"heartbeat": "3000",
"productCode": "3030",
......@@ -16,7 +17,7 @@
"method": "thing.service.property.set",
"inputData": [
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"dataType": {
"type": "double",
......@@ -66,13 +67,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -87,7 +84,7 @@
"desc": "属性获取",
"method": "thing.service.property.get",
"inputData": [
"TargetTemperature",
"Temperature",
"CurrentTemperature",
"PowerSwitch",
"ChildLockState",
......@@ -96,7 +93,7 @@
],
"outputData": [
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"dataType": {
"type": "double",
......@@ -160,13 +157,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -188,7 +181,7 @@
}
},
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"accessMode": "rw",
"required": true,
......@@ -250,13 +243,9 @@
"accessMode": "rw",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -271,7 +260,7 @@
"method": "thing.event.property.post",
"outputData": [
{
"identifier": "TargetTemperature",
"identifier": "Temperature",
"name": "目标温度",
"dataType": {
"type": "double",
......@@ -335,13 +324,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3031.json",
"productType": "floorHeating",
"productType": "fanCoil",
"version": "1.1",
"profile": {
"heartbeat": "3000",
"productCode": "3031",
......@@ -80,13 +81,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -189,13 +186,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -296,13 +289,9 @@
"accessMode": "rw",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -395,13 +384,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3032.json",
"productType": "airConditioning",
"productType": "freshAir",
"version": "1.2",
"profile": {
"heartbeat": "3000",
"productCode": "3032",
......@@ -61,7 +62,7 @@
}
},
{
"identifier": "StrainerUsageTime",
"identifier": "StrainerWorkTime",
"name": "滤网使用时间",
"dataType": {
"type": "int",
......@@ -90,13 +91,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -116,7 +113,7 @@
"WorkMode",
"ChildLockState",
"TimingOffTime",
"StrainerUsageTime",
"StrainerWorkTime",
"StrainerAlarmTime",
"CurrentTemperature"
],
......@@ -170,13 +167,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
},
......@@ -195,7 +188,7 @@
}
},
{
"identifier": "StrainerUsageTime",
"identifier": "StrainerWorkTime",
"name": "滤网使用时间",
"dataType": {
"type": "int",
......@@ -277,7 +270,7 @@
}
},
{
"identifier": "StrainerUsageTime",
"identifier": "StrainerWorkTime",
"name": "滤网使用时间",
"accessMode": "rw",
"required": true,
......@@ -312,13 +305,9 @@
"accessMode": "rw",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
},
......@@ -397,18 +386,14 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
},
{
"identifier": "StrainerUsageTime",
"identifier": "StrainerWorkTime",
"name": "滤网使用时间",
"dataType": {
"type": "int",
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3033.json",
"productType": "airConditioning",
"version": "1.1",
"profile": {
"heartbeat": "3000",
"productCode": "3033",
......@@ -81,13 +82,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -191,13 +188,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -299,13 +292,9 @@
"accessMode": "rw",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -399,13 +388,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3034.json",
"productType": "airConditioning",
"version": "1.0",
"version": "1.2",
"profile": {
"heartbeat": "3000",
"productCode": "3034",
......@@ -82,13 +82,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -192,13 +188,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -300,13 +292,9 @@
"accessMode": "rw",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -400,13 +388,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3035.json",
"productType": "airConditioning",
"version": "1.1",
"profile": {
"heartbeat": "3000",
"productCode": "3035",
......@@ -81,13 +82,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -191,13 +188,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -299,13 +292,9 @@
"accessMode": "rw",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -399,13 +388,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3036.json",
"productType": "airConditioning",
"version": "1.1",
"profile": {
"heartbeat": "3000",
"productCode": "3036",
......@@ -81,13 +82,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -191,13 +188,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -299,13 +292,9 @@
"accessMode": "rw",
"required": true,
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......@@ -399,13 +388,9 @@
"identifier": "TimingOffTime",
"name": "延时关机时间",
"dataType": {
"type": "double",
"specs": {
"min": "0",
"max": "24",
"unit": "h",
"unitName": "小时",
"step": "0.5"
"type":"text",
"specs":{
"length":"10"
}
}
}
......
......@@ -2,6 +2,7 @@
"schema": "https://iot-ap.ikonke.com/model/product_3037.json",
"productType": "outlet",
"version": "1.0",
"version": "1",
"profile": {
"heartbeat": "300",
"productCode": "3037",
......
......@@ -26,7 +26,7 @@
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
"step": "1"
"step": "0.5"
}
}
},
......@@ -107,7 +107,7 @@
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
"step": "1"
"step": "0.5"
}
}
},
......@@ -207,7 +207,7 @@
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
"step": "1"
"step": "0.5"
}
}
},
......@@ -289,7 +289,7 @@
"max": "30",
"unit": "°C",
"unitName": "摄氏度",
"step": "1"
"step": "0.5"
}
}
},
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3091.json",
"productType": "lightPanel",
"version": "1.0",
"profile": {
"heartbeat": "300",
"productCode": "3091",
"productName": "海顿系列.线性单路调光调色面板(KONKE)"
},
"services": [
{
"outputData": [],
"identifier": "set",
"inputData": [
{
"identifier": "PowerSwitch",
"dataType": {
"specs": {
"0": "关闭",
"1": "打开"
},
"type": "bool"
},
"name": "电源开关"
},
{
"identifier": "Brightness",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "亮度"
},
{
"identifier": "ColorTemperature",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "100",
"unit": "K",
"unitName": "开尔文",
"step": "1"
}
},
"name": "色温"
},
{
"identifier": "FadeTime",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "254",
"unit": "s",
"unitName": "秒",
"step": "1"
}
},
"name": "渐变时间"
},
{
"identifier": "LowBrightness",
"dataType": {
"type": "int",
"specs": {
"min": "10",
"max": "90",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最低亮度"
},
{
"identifier": "HighBrightness",
"dataType": {
"type": "int",
"specs": {
"min": "20",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最高亮度"
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
"identifier": "PowerSwitch",
"dataType": {
"specs": {
"0": "关闭",
"1": "打开"
},
"type": "bool"
},
"name": "电源开关"
},
{
"identifier": "Brightness",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "亮度"
},
{
"identifier": "ColorTemperature",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "100",
"unit": "K",
"unitName": "开尔文",
"step": "1"
}
},
"name": "色温"
},
{
"identifier": "FadeTime",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "254",
"unit": "s",
"unitName": "秒",
"step": "1"
}
},
"name": "渐变时间"
},
{
"identifier": "LowBrightness",
"dataType": {
"type": "int",
"specs": {
"min": "10",
"max": "90",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最低亮度"
},
{
"identifier": "HighBrightness",
"dataType": {
"type": "int",
"specs": {
"min": "20",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最高亮度"
}
],
"identifier": "get",
"inputData": [
"PowerSwitch",
"Brightness",
"ColorTemperature",
"FadeTime",
"LowBrightness",
"HighBrightness"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
},
{
"outputData":[
],
"identifier":"negativeProperty",
"inputData":[
"PowerSwitch"
],
"method":"thing.service.negativeProperty",
"name":"negativeProperty",
"required":true,
"callType":"async",
"desc":"属性值取反"
}
],
"properties": [
{
"identifier": "PowerSwitch",
"dataType": {
"specs": {
"0": "关闭",
"1": "打开"
},
"type": "bool"
},
"name": "电源开关",
"accessMode": "rw",
"required": true
},
{
"identifier": "Brightness",
"name": "亮度",
"accessMode": "rw",
"required": false,
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
}
},
{
"identifier": "ColorTemperature",
"accessMode": "rw",
"required": false,
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "100",
"unit": "K",
"unitName": "开尔文",
"step": "1"
}
},
"name": "色温"
},
{
"identifier": "FadeTime",
"accessMode": "rw",
"required": false,
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "254",
"unit": "s",
"unitName": "秒",
"step": "1"
}
},
"name": "渐变时间"
},
{
"identifier": "LowBrightness",
"accessMode": "rw",
"required": false,
"dataType": {
"type": "int",
"specs": {
"min": "10",
"max": "90",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最低亮度"
},
{
"identifier": "HighBrightness",
"accessMode": "rw",
"required": false,
"dataType": {
"type": "int",
"specs": {
"min": "20",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最高亮度"
}
],
"events": [
{
"outputData": [
{
"identifier": "PowerSwitch",
"dataType": {
"specs": {
"0": "关闭",
"1": "打开"
},
"type": "bool"
},
"name": "电源开关"
},
{
"identifier": "Brightness",
"dataType": {
"type": "int",
"specs": {
"min": "1",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "亮度"
},
{
"identifier": "ColorTemperature",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "100",
"unit": "K",
"unitName": "开尔文",
"step": "1"
}
},
"name": "色温"
},
{
"identifier": "FadeTime",
"dataType": {
"type": "int",
"specs": {
"min": "0",
"max": "254",
"unit": "s",
"unitName": "秒",
"step": "1"
}
},
"name": "渐变时间"
},
{
"identifier": "LowBrightness",
"dataType": {
"type": "int",
"specs": {
"min": "10",
"max": "90",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最低亮度"
},
{
"identifier": "HighBrightness",
"dataType": {
"type": "int",
"specs": {
"min": "20",
"max": "100",
"unit": "%",
"unitName": "百分比",
"step": "1"
}
},
"name": "最高亮度"
}
],
"identifier": "property",
"method": "thing.event.property.post",
"name": "property",
"type": "info",
"required": true,
"desc": "属性上报"
}
]
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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