Commit 579ad88d authored by chen.weican's avatar chen.weican

【修改内容】修改相关BUG

【提交人】陈伟灿
parent 0ee6d385
......@@ -34,11 +34,9 @@ static int kk_findccu_ack(int sockfd,struct sockaddr_in *addr){
args = cJSON_CreateObject();
if(args){
cJSON_AddItemToObject(json, "arg", args);
#ifdef CONFIG_A133_PLATFORM
cJSON_AddStringToObject(args, "zkid", ccuid);
#else
cJSON_AddStringToObject(args, "zkid", &ccuid[4]);
#endif
cJSON_AddStringToObject(args, "zk", KK_CCU_NAME);
HAL_Get_IP(s_IP,NULL);
cJSON_AddStringToObject(args, "ip", s_IP);
......@@ -96,6 +94,8 @@ void *kk_findccu_handle(void *data)
WARNING_PRINT("read error....\n");
}else{
DEBUG_PRINT("findccu recmsg: %s\n", recvline);
DEBUG_PRINT("findccu frome ip: %s\n", inet_ntoa(presaddr.sin_addr));
pStart = strstr(recvline, "!");
pEnd = strstr(recvline, "$");
if(pStart != NULL && pEnd != NULL){
......
......@@ -15,7 +15,7 @@
#include "kk_data_handle.h"
#include "kk_lan_debug.h"
#define LISTEN_MAX 5
#define LISTEN_MAX 16
#define BUF_SIZE 1500
typedef struct {
......
......@@ -518,7 +518,8 @@ int dm_mgr_check_heartbeat_timeout(time_t timestamp)
}
if(s_count >= 60)
{
INFO_PRINT("[%s][%d]search_node->productCode:%s\n",__FUNCTION__,__LINE__,search_node->productCode);
// INFO_PRINT("[%s][%d]search_node->productCode:%s\n",__FUNCTION__,__LINE__,search_node->productCode);
INFO_PRINT("[%s][%d]search_node->deviceCode:%s\n",__FUNCTION__,__LINE__,search_node->deviceCode);
INFO_PRINT("[%s][%d]search_node->hb_timeout:%d\n",__FUNCTION__,__LINE__,search_node->hb_timeout);
INFO_PRINT("[%s][%d]search_node->isOffline:%d\n",__FUNCTION__,__LINE__,search_node->isOffline);
INFO_PRINT("[%s][%d]search_node->timestamp:%ld\n",__FUNCTION__,__LINE__,search_node->timestamp);
......
......@@ -1190,7 +1190,10 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params)
for(idx = 0; idx < epNumInt; idx++){
countPro = propertyInfoBuf[idx].num;
if(countPro == 0){
continue;
if(epNumInt == 1 && versionItem != NULL && versionFlag == 0){//处理只上报version的问题
}else{
continue;
}
}
//printf(" ------------------------>countPro:%d\n",countPro);
memset(epIdx,0x0,sizeof(epIdx));
......@@ -1338,7 +1341,6 @@ int kk_msg_execute_property_get(dm_mgr_dev_node_t *node)
int i = 0,j = 0,serviceNum = 0;
char *paramS = NULL;
char msgId[MSG_MAX_LEN] = {0};
if(node == NULL){
return INVALID_PARAMETER;
}
......@@ -1349,10 +1351,8 @@ int kk_msg_execute_property_get(dm_mgr_dev_node_t *node)
}
memset(req_info, 0, req_info_len);
snprintf(req_info, req_info_len, DM_MSG_INFO, KK_THING_SERVICE_PROPERTY_GET,node->productCode, node->deviceCode);
cJSON *rootParam = cJSON_CreateObject();
cJSON *array = cJSON_CreateArray();
serviceNum = node->dev_shadow->service_number;
for(i = 0; i < serviceNum; i++){
kk_tsl_service_t *item = node->dev_shadow->services + i;
......@@ -1372,6 +1372,9 @@ int kk_msg_execute_property_get(dm_mgr_dev_node_t *node)
break;
}
}
if(paramS == NULL){
paramS = "{}";
}
payload_len = strlen(DM_MSG_REQUEST) + 10 + strlen(DM_MSG_VERSION) + strlen(paramS) + strlen(
method) + 1 + 20+sizeof(msgId);
......
......@@ -1761,10 +1761,37 @@ static int kk_service_bindScene_handle(cJSON *params,char *deviceCodeStr)
sprintf(btnId,"%d",ButtonId->valueint);
kk_scene_delete_panel_scene_info(btnId,deviceCodeStr);//如果已经关联,先删除关联
//bindType:1,情景;2,动作;3,全屋;4,布防
if(bindType->valueint == 2 || bindType->valueint == 3 ){
HAL_GetTime_s(sceneId);//use time to create the sceneId
kk_scene_parse_scene_action(params,sceneId,0);
kk_scene_insert_panel_scene_info(bindType->valueint,btnId,deviceCodeStr,sceneId);
if(bindType->valueint == 3 ){
cJSON * action = cJSON_GetObjectItem(params,MSG_SCENE_ACTIONS);
if(action == NULL || action->type != cJSON_Array){
ERROR_PRINT("DATA ERROR!!!");
return FAIL_RETURN;
}
cJSON *client_list = action->child;
while( client_list != NULL ){
char roomIdBuf[16] = {0};
cJSON * roomId = cJSON_GetObjectItem( client_list ,"ccuRoomId") ;
if(roomId != NULL){
if(roomId->type != cJSON_String){
sprintf(roomIdBuf,"%d",roomId->valueint);
}else{
strcpy(roomIdBuf,roomId->valuestring);
}
}
else{
strcpy(roomIdBuf,"-1");
}
cJSON * productType = cJSON_GetObjectItem( client_list ,"productType") ;
kk_scene_insert_panel_scene_info(bindType->valueint,btnId,deviceCodeStr,sceneId,roomIdBuf,productType->valuestring);
client_list = client_list->next ;
}
}else{
kk_scene_insert_panel_scene_info(bindType->valueint,btnId,deviceCodeStr,sceneId,"-1","");
}
}
else if(bindType->valueint == 1){
cJSON * action = cJSON_GetObjectItem(params,MSG_SCENE_ACTIONS);
......@@ -1776,7 +1803,7 @@ static int kk_service_bindScene_handle(cJSON *params,char *deviceCodeStr)
while( client_list != NULL ){
int isceneId = cJSON_GetObjectItem( client_list ,"sceneId")->valueint ;
sprintf(sceneId,"%d",isceneId);
kk_scene_insert_panel_scene_info(bindType->valueint,btnId,deviceCodeStr,sceneId);
kk_scene_insert_panel_scene_info(bindType->valueint,btnId,deviceCodeStr,sceneId,"-1","");
client_list = client_list->next ;
}
......@@ -1800,7 +1827,7 @@ static int kk_service_bindScene_handle(cJSON *params,char *deviceCodeStr)
res = kk_scene_insert_scene_action(type->valuestring,deviceCode->valuestring,1,
propertyName->valuestring,propertyValue->valuestring,0,sceneId,deviceCode->valuestring);
kk_scene_insert_panel_scene_info(bindType->valueint,btnId,deviceCodeStr,sceneId);
kk_scene_insert_panel_scene_info(bindType->valueint,btnId,deviceCodeStr,sceneId,"-1","");
item = item->next;
}
......@@ -2311,7 +2338,6 @@ int _iotx_linkkit_slave_connect(int devid)
/* Subdev Add Topo */
res = kk_dm_subdev_topo_add(devid);
if (res < SUCCESS_RETURN) {
_iotx_linkkit_mutex_unlock();
return FAIL_RETURN;
}
......@@ -2569,7 +2595,7 @@ static int _iotx_linkkit_subdev_login(int devid)
*返 回 值: 0:成功;其他:失败
*其他说明:
*************************************************************/
int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char deviceCode[DEVICE_CODE_MAXLEN],char mac[DEVICE_MAC_MAXLEN],char fatherDeviceCode[DEVICE_CODE_MAXLEN]){
int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char deviceCode[DEVICE_CODE_MAXLEN],char mac[DEVICE_MAC_MAXLEN],char fatherDeviceCode[DEVICE_CODE_MAXLEN],char version[32]){
int res = 0;
int devid = 0;
int heartbeat = 0;
......@@ -2583,7 +2609,7 @@ int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char d
if (TSL_ALREADY_EXIST == res){
//todo
}else{
res = kk_subDev_insert_db(devType,productCode,deviceCode,fatherDeviceCode,mac,"1.1.0",heartbeat);
res = kk_subDev_insert_db(devType,productCode,deviceCode,fatherDeviceCode,mac,version,heartbeat);
if (res != SUCCESS_RETURN) {
return FAIL_RETURN;
}
......
......@@ -10,7 +10,6 @@ int _iotx_linkkit_slave_connect(int devid);
int _iotx_linkkit_slave_register(int devid);
void IOT_Linkkit_Yield(int timeout_ms);
int IOT_Linkkit_Close(int devid);
int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char deviceCode[DEVICE_CODE_MAXLEN],char mac[DEVICE_MAC_MAXLEN],char fatherDeviceCode[DEVICE_CODE_MAXLEN]);
int kk_mid_subdev_batch_add( char productCode[PRODUCT_CODE_MAXLEN], char deviceCode[DEVICE_CODE_MAXLEN],char mac[DEVICE_MAC_MAXLEN],char fatherDeviceCode[DEVICE_CODE_MAXLEN]);
int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char deviceCode[DEVICE_CODE_MAXLEN],char mac[DEVICE_MAC_MAXLEN],char fatherDeviceCode[DEVICE_CODE_MAXLEN],char version[32]);
int kk_service_arming_set(char *state);
#endif
......@@ -31,7 +31,8 @@ static int kk_check_multi_ep_num(char *deviceCode);
static int kk_get_scenes_actions_info(cJSON *actionArray,int id);
static int kk_get_panel_scenes_actions_info(cJSON *actionArray,int id);
static int kk_get_panel_scenes_info(cJSON *actionItem,int id);
static int kk_get_panel_scenes_allRoom_info(cJSON *actionItem,int id,char *roomId,char* productType);
typedef struct {
void *mutex;
sqlite3 *pDb;
......@@ -586,11 +587,10 @@ static int kk_get_panelConfig_info(cJSON *decvies,char *deviceCode)
char *sqlCmd = NULL;
sqlite3_stmt *stmt;
kk_sync_ctx_t *ctx = _kk_sync_get_ctx();
char *sceneId = NULL;
char *buttonId = NULL;
char *roomId = NULL;
char *productType = NULL;
int bindType = 0;
int mFlag = 0;
......@@ -614,8 +614,16 @@ static int kk_get_panelConfig_info(cJSON *decvies,char *deviceCode)
sceneId = (char*)sqlite3_column_text(stmt, DB_QUICKPANEL_SCENEID);
buttonId = (char*)sqlite3_column_text(stmt, DB_QUICKPANEL_BUTTONID);
bindType = (int)sqlite3_column_int(stmt,DB_QUICKPANEL_BINDTYPE);
kk_get_panel_scenes_actions_info(action,atoi(sceneId));
if(bindType == 1){
kk_get_panel_scenes_info(action,atoi(sceneId));
}else if(bindType == 3){
roomId = (char*)sqlite3_column_text(stmt, DB_QUICKPANEL_ROOMID);
productType = (char*)sqlite3_column_text(stmt, DB_QUICKPANEL_PRODUCTTYPE);
kk_get_panel_scenes_allRoom_info(action,atoi(sceneId),roomId,productType);
}else{
kk_get_panel_scenes_actions_info(action,atoi(sceneId));
}
cJSON_AddItemToObject(item, "action", action);
cJSON_AddNumberToObject(item, "bindType", bindType);
......@@ -636,10 +644,32 @@ static int kk_get_panelConfig_info(cJSON *decvies,char *deviceCode)
}
static int _kk_deviceCode_switchto_mac(const char * deviceCode,char *mac)
{
char deviceCode_bak[33] = {0};
int i, j;
int len = strlen(deviceCode);
for(i=0; i < len; i++) /*将串s拷贝至串t*/
deviceCode_bak[i]=deviceCode[i];
deviceCode_bak[i]='\0';
for(i=0,j=0; i < len; i++){
if( i % 2 == 0 && i != 0)
{
mac[j++]=':';
mac[j++]=deviceCode_bak[i];
}
else
{
mac[j++]=deviceCode_bak[i];
}
}
mac[j]='\0'; /*在串s结尾加结束标志*/
return 0;
}
static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
{
char *sqlCmd = NULL;
char macaddr[33] = {0};
//char *zErrMsg = 0;
sqlite3_stmt *stmt;
kk_sync_ctx_t *ctx = _kk_sync_get_ctx();
......@@ -667,7 +697,8 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
subproductType = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTTYPE);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_DEVICECODE_STR, subDeviceCode);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_VERSION_STR, subVersion);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_MAC_STR, subDeviceCode);
_kk_deviceCode_switchto_mac(subDeviceCode,macaddr);
cJSON_AddStringToObject(subdevicesItem, KK_SYNC_MAC_STR, macaddr);
cJSON_AddNumberToObject(subdevicesItem, KK_SYNC_ONLINE_STR, (strcmp(subIsline,"0")==0)?1:0);
......@@ -701,6 +732,7 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
static int kk_get_gw_devices_info(cJSON *gwdevices)
{
char *sqlCmd = NULL;
char macaddr[33] = {0};
//char *zErrMsg = 0;
sqlite3_stmt *stmt;
//cJSON *gwdevicesItem = NULL;
......@@ -728,7 +760,8 @@ static int kk_get_gw_devices_info(cJSON *gwdevices)
printf("gw_productCode:%s\n",gw_productCode);
cJSON_AddStringToObject(gwdevicesItem, KK_SYNC_DEVICECODE_STR, gw_deviceCode);
cJSON_AddStringToObject(gwdevicesItem, KK_SYNC_VERSION_STR, gw_version);
cJSON_AddStringToObject(gwdevicesItem, KK_SYNC_MAC_STR, gw_deviceCode);
_kk_deviceCode_switchto_mac(gw_deviceCode,macaddr);
cJSON_AddStringToObject(gwdevicesItem, KK_SYNC_MAC_STR, macaddr);
cJSON_AddStringToObject(gwdevicesItem, KK_SYNC_NANE_STR, "GW");
cJSON_AddNumberToObject(gwdevicesItem, KK_SYNC_ONLINE_STR, (strcmp(gw_isline,"0")==0)?1:0);
cJSON_AddStringToObject(gwdevicesItem, KK_SYNC_PRODUCTCODE_STR, gw_productCode);
......@@ -781,8 +814,90 @@ int kk_get_room_name_by_scene_id(int scene_id,char *room_name)
return res;
}
static int kk_get_panel_scenes_info(cJSON *actionItem,int id)
{
char *sqlCmd = NULL;
//char *zErrMsg = 0;
sqlite3_stmt *stmt;
int scenetype = 0;
char *type = NULL;
char sceneIdStr[16] = {0};
int delay = 0,epNum = 0,scene_id=0;
kk_sync_ctx_t *ctx = _kk_sync_get_ctx();
if(actionItem == NULL){
return FAIL_RETURN;
}
const char *selectCmd = "select * from SceneInfo WHERE sceneId = '%d';";
sqlCmd = sqlite3_mprintf(selectCmd,id);
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
scenetype = sqlite3_column_int(stmt, DB_SCENEINFO_SCENETYPE);
sprintf(sceneIdStr,"%d",id);
cJSON_AddNumberToObject(actionItem, "bindType", 1);
cJSON_AddStringToObject(actionItem, "type", "action/scene");
cJSON_AddStringToObject(actionItem, KK_SYNC_SCENEID_STR, sceneIdStr);
cJSON_AddNumberToObject(actionItem, KK_SYNC_SCENE_SCENETYPE_STR, scenetype);
break;
}
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
return SUCCESS_RETURN;
}
static int kk_get_panel_scenes_allRoom_info(cJSON *actionItem,int id,char *roomId,char *productType)
{
char *sqlCmd = NULL;
//char *zErrMsg = 0;
sqlite3_stmt *stmt;
char *deviceCode = NULL;
char *propertyName = NULL;
char *propertyValue = NULL;
char *type = NULL;
int delay = 0,epNum = 0,scene_id=0;
kk_sync_ctx_t *ctx = _kk_sync_get_ctx();
if(actionItem == NULL){
return FAIL_RETURN;
}
sqlCmd = sqlite3_mprintf("select * from SceneActionInfo");
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
scene_id = sqlite3_column_int(stmt, DB_SCENEACTION_SCENEID);
if(id!=scene_id){
continue ;
}
deviceCode = (char*)sqlite3_column_text(stmt, DB_SCENEACTION_DEVICECODE);
delay = sqlite3_column_int(stmt, DB_SCENEACTION_DELAY);
epNum = sqlite3_column_int(stmt, DB_SCENEACTION_EPNUM);
propertyName = (char*)sqlite3_column_text(stmt, DB_SCENEACTION_PROPERTYNAME);
propertyValue = (char*)sqlite3_column_text(stmt, DB_SCENEACTION_PROPERTYVALUE);
type = (char*)sqlite3_column_text(stmt, DB_SCENEACTION_TYPE);
cJSON_AddStringToObject(actionItem, KK_SYNC_DEVICECODE_STR, deviceCode);
cJSON_AddNumberToObject(actionItem, KK_SYNC_SCENE_DELAY_STR, delay);
cJSON_AddNumberToObject(actionItem, KK_SYNC_SCENE_EPNUM_STR, epNum);
char *propertiesbuf[64] = {0};
int num = 0;
kk_split(propertyName,"_",propertiesbuf,&num);
if(num==2){
cJSON_AddStringToObject(actionItem, KK_SYNC_SCENE_PROPERTYNAME_STR, propertiesbuf[0]);
}else{
cJSON_AddStringToObject(actionItem, KK_SYNC_SCENE_PROPERTYNAME_STR, propertyName);
}
cJSON_AddStringToObject(actionItem, KK_SYNC_SCENE_TYPE_STR, type);
cJSON_AddStringToObject(actionItem, KK_SYNC_SCENE_PROPERTYVALUE_STR, propertyValue);
cJSON_AddStringToObject(actionItem, KK_SYNC_ROOMID_STR, roomId);
cJSON_AddStringToObject(actionItem, KK_SYNC_SCENE_PRODUCTTYPE, productType);
break;
}
sqlite3_free(sqlCmd);
sqlite3_finalize(stmt);
return SUCCESS_RETURN;
}
static int kk_get_panel_scenes_actions_info(cJSON *actionItem,int id)
{
char *sqlCmd = NULL;
......
......@@ -34,7 +34,7 @@
#define KK_SYNC_SCENE_ENDTIME_STR "endTime"
#define KK_SYNC_SCENE_CROSSDAY_STR "crossDay"
#define KK_SYNC_SCENE_REPEATDAY_STR "repeat_days"
#define KK_SYNC_SCENE_PRODUCTTYPE "productType"
int kk_sync_init(void);
char *kk_sync_get_info();
......
......@@ -905,7 +905,8 @@ void kk_platMsg_handle(void* data, char* chalMark){
cJSON *devCode;
cJSON *mac;
cJSON *payload;
cJSON *version;
char versionBuf[32] = {0};
json=cJSON_Parse(data);
if (!json) {
WARNING_PRINT("Error before: [%s]\n","cJSON_Parse");
......@@ -945,19 +946,25 @@ void kk_platMsg_handle(void* data, char* chalMark){
ERROR_PRINT("productCode, deviceCode mac params are error\n");
goto error;
}
version = cJSON_GetObjectItem(jsonPay, "version");
if(version != NULL ){
memcpy(versionBuf,version->valuestring,strlen(version->valuestring));
}else{
memcpy(versionBuf,"1.1.0",strlen("1.1.0"));
}
INFO_PRINT("deviceCode productCode mac: [%s][%s] [%s] \n",devCode->valuestring, proCode->valuestring, mac->valuestring);
//判断网关还是子设备
if (strcmp(info_dcode->valuestring, devCode->valuestring) == 0){
char ccu_deviceCode[DEVICE_CODE_MAXLEN] = {0};
HAL_Get_ccuid(ccu_deviceCode);
kk_mid_subdev_add(KK_DM_DEVICE_GATEWAY,proCode->valuestring,devCode->valuestring, mac->valuestring,ccu_deviceCode);
kk_mid_subdev_add(KK_DM_DEVICE_GATEWAY,proCode->valuestring,devCode->valuestring, mac->valuestring,ccu_deviceCode,versionBuf);
cJSON * sceneSupportStr = cJSON_GetObjectItem(jsonPay, MSG_SCENE_SUPPORT);
if(sceneSupportStr != NULL&&!strcmp(sceneSupportStr->valuestring,"1")){
kk_subDev_update_sceneSupport(1,devCode->valuestring);
}
kk_dm_gw_status_update_online(info_dcode->valuestring);
}else{
kk_mid_subdev_add(KK_DM_DEVICE_SUBDEV,proCode->valuestring,devCode->valuestring, mac->valuestring,info_dcode->valuestring);
kk_mid_subdev_add(KK_DM_DEVICE_SUBDEV,proCode->valuestring,devCode->valuestring, mac->valuestring,info_dcode->valuestring,versionBuf);
}
dm_mgr_update_timestamp_by_devicecode(devCode->valuestring,HAL_Uptimes());
}
......
......@@ -167,7 +167,9 @@ int kk_scene_db_init(void)
buttonId varchar(255), \
bindType INTEGER, \
deviceCode varchar(255), \
sceneId varchar(255) UNIQUE)";
sceneId varchar(255), \
roomId varchar(255), \
productType varchar(255))";
if (sqlite3_exec(ctx->pDb, pPanelScene, NULL, NULL, &pcErr) != SQLITE_OK)
{
......@@ -259,18 +261,18 @@ int kk_scene_insert_scene_info(const char* roomId,const char* sceneName,int scen
*其他说明:
*************************************************************/
int kk_scene_insert_panel_scene_info(int bindType,char *buttonId,char *deviceCode,const char* sceneId)
int kk_scene_insert_panel_scene_info(int bindType,char *buttonId,char *deviceCode,const char* sceneId,const char* roomId,const char* productType)
{
int res = 0;
kk_scene_ctx_t *ctx = _kk_scene_get_ctx();
char *sqlCmd = NULL;
char *zErrMsg = 0;
const char *insertCmd = "insert into QuickPanelScene (buttonId,bindType,deviceCode,sceneId) \
values ('%s','%d','%s','%s');";
const char *insertCmd = "insert into QuickPanelScene (buttonId,bindType,deviceCode,sceneId,roomId,productType) \
values ('%s','%d','%s','%s','%s','%s');";
_kk_scene_lock();
sqlCmd = sqlite3_mprintf(insertCmd,buttonId,bindType,deviceCode,sceneId);
sqlCmd = sqlite3_mprintf(insertCmd,buttonId,bindType,deviceCode,sceneId,roomId,productType);
res = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( res != SQLITE_OK ){
ERROR_PRINT("SQL error: %s\n", zErrMsg);
......
......@@ -74,6 +74,8 @@ enum{
DB_QUICKPANEL_BINDTYPE,
DB_QUICKPANEL_DEVICECODE,
DB_QUICKPANEL_SCENEID,
DB_QUICKPANEL_ROOMID,
DB_QUICKPANEL_PRODUCTTYPE,
};
int kk_scene_delete_scene_timing(const char *sceneId);
int kk_scene_delete_scene_condition(const char *sceneId);
......@@ -94,7 +96,7 @@ int kk_scene_insert_scene_condition(const char* type,int startTime,int endTime,i
int kk_scene_insert_scene_info(const char* roomName,const char* name,int sceneType,int enable,const char* sceneId);
int kk_scene_update_scene_enable(int enable,const char *sceneId);
int kk_scene_db_init(void);
int kk_scene_insert_panel_scene_info(int bindType,char *buttonId,char *deviceCode,const char* sceneId);
int kk_scene_insert_panel_scene_info(int bindType,char *buttonId,char *deviceCode,const char* sceneId,const char* roomId,const char* productType);
int kk_scene_delete_quickpanel_info(char *buttonId,char* deviceCode);
int kk_scene_delete_panel_scene_info(char *buttonId,char *deviceCode);
int kk_scene_deleteall_panel_scene_info(char *deviceCode);
......
......@@ -1187,14 +1187,10 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
kk_subDev_set_action_by_productType(productType->valuestring,roomId->valuestring,sceneId,propertyName->valuestring,
propertyValue->valuestring,type->valuestring,idelay);
}else{
printf("1111\r\n");
char *str = cJSON_PrintUnformatted(propertyValue);
printf("222\r\n");
kk_subDev_set_action_by_productType(productType->valuestring,roomId->valuestring,sceneId,propertyName->valuestring,
str,type->valuestring,idelay);
printf("333\r\n");
free(str);
printf("4444\r\n");
}
}
......
......@@ -18,7 +18,7 @@
#define PRODUCT_CODE_MAXLEN (32 + 1)
#define DEVICE_CODE_MAXLEN (32 + 1)
#define DEVICE_MAC_MAXLEN (16 + 1)
#define DEVICE_MAC_MAXLEN (32 + 1)
#define DEVICE_SN_MAXLEN (32 + 1)
#define DEVICE_VERSION_MAXLEN (32 + 1)
......
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -31,5 +31,5 @@ OVERRIDE_AR = arm-linux-androideabi-ar
OVERRIDE_LD = arm-linux-androideabi-ld
CROSS_PREFIX = arm-linux-androideabi-
OVERRIDE_STRIP := strip
OVERRIDE_STRIP := arm-linux-androideabi-strip
File mode changed from 100755 to 100644
......@@ -31,4 +31,4 @@ OVERRIDE_AR = mips-openwrt-linux-ar
OVERRIDE_LD = mips-openwrt-linux-ld
CROSS_PREFIX = mips-openwrt-linux-
OVERRIDE_STRIP := strip
OVERRIDE_STRIP := mips-openwrt-linux-strip
......@@ -32,5 +32,5 @@ OVERRIDE_AR = arm-kk-linux-gnueabihf-ar
OVERRIDE_LD = arm-kk-linux-gnueabihf-ld
CROSS_PREFIX = arm-kk-linux-gnueabihf-
OVERRIDE_STRIP := strip
OVERRIDE_STRIP := arm-kk-linux-gnueabihf-strip
{
"schema": "https://iot-ap.ikonke.com/model/product_3015.json",
"productType": "sensor",
"version": "1.0",
"profile": {
"heartbeat": "300",
"productCode": "3015",
"productName": "铂金系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
},
"services": [
{
"outputData": [],
"inputData": [],
"identifier": "PositioningDevice",
"method": "thing.service.PositioningDevice",
"name": "PositioningDevice",
"required": true,
"callType": "async",
"desc": "设备定位"
}
],
"properties": [
],
"events": [
{
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
}
]
{
"schema": "https://iot-ap.ikonke.com/model/product_3015.json",
"productType": "sensor",
"version": "1.1",
"profile": {
"heartbeat": "300",
"productCode": "3015",
"productName": "铂金系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
},
"services": [
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"identifier": "get",
"inputData": [
"SosState"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
},
{
"outputData": [],
"inputData": [],
"identifier": "PositioningDevice",
"method": "thing.service.PositioningDevice",
"name": "PositioningDevice",
"required": true,
"callType": "async",
"desc": "设备定位"
}
],
"properties": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "SensorType",
"name": "安防等级",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "在家安防",
"1": "室外安防",
"2": "24小时警戒",
"3": "无警戒"
}
}
}
],
"events": [
{
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
}
]
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
"productType": "sensor",
"version": "1.1",
"profile": {
"heartbeat": "300",
"heartbeat": "1200",
"productCode": "3082",
"productName": "邦德系列.燃气报警器(KONKE)"
},
......
{
"schema": "https://iot-ap.ikonke.com/model/product_3124.json",
"productType": "sensor",
"version": "1.0",
"profile": {
"heartbeat": "300",
"productCode": "3124",
"productName": "肖邦系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
},
"services": [
{
"outputData": [],
"inputData": [],
"identifier": "PositioningDevice",
"method": "thing.service.PositioningDevice",
"name": "PositioningDevice",
"required": true,
"callType": "async",
"desc": "设备定位"
}
],
"properties": [
],
"events": [
{
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
}
]
{
"schema": "https://iot-ap.ikonke.com/model/product_3124.json",
"productType": "sensor",
"version": "1.1",
"profile": {
"heartbeat": "1200",
"productCode": "3124",
"productName": "肖邦系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
},
"services": [
{
"outputData": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
}
],
"identifier": "get",
"inputData": [
"SosState"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获取"
},
{
"outputData": [],
"inputData": [],
"identifier": "PositioningDevice",
"method": "thing.service.PositioningDevice",
"name": "PositioningDevice",
"required": true,
"callType": "async",
"desc": "设备定位"
}
],
"properties": [
{
"identifier": "SosState",
"name": "紧急按钮告警状态",
"accessMode": "r",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "没有报警",
"1": "报警"
}
}
},
{
"identifier": "SensorType",
"name": "安防等级",
"accessMode": "rw",
"required": true,
"dataType": {
"type": "enum",
"specs": {
"0": "在家安防",
"1": "室外安防",
"2": "24小时警戒",
"3": "无警戒"
}
}
}
],
"events": [
{
"outputData": [],
"identifier": "sosAlarm",
"method": "thing.event.sosAlarm.post",
"name": "sosAlarm",
"type": "alarm",
"required": true,
"desc": "紧急按钮告警"
}
]
}
\ No newline at end of file
File mode changed from 100755 to 100644
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