Commit 0e303cf6 authored by chen.weican's avatar chen.weican

Merge branch 'master' of http://172.17.3.10:17001/chenweican/k-sdk

# Conflicts:
#	midware/midware/midware.c
parents faeb96b8 c2542639
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "com_api.h" #include "com_api.h"
#include "kk_product.h" #include "kk_product.h"
#include "kk_hal.h" #include "kk_hal.h"
#include "ccu_ver.h"
//#include "kcloud_log.h" //#include "kcloud_log.h"
static char s_ccuid[DEVICE_CODE_LEN] = {0}; static char s_ccuid[DEVICE_CODE_LEN] = {0};
int KK_Get_ccuid(char *device_code) int KK_Get_ccuid(char *device_code)
...@@ -257,6 +257,7 @@ static int setStoragePath(char* path){ ...@@ -257,6 +257,7 @@ static int setStoragePath(char* path){
#ifdef CONFIG_A133_PLATFORM #ifdef CONFIG_A133_PLATFORM
sprintf(KK_DEFAULT_CONFIG_FILE_PATH, "%s/%s", path, KK_DEFAULT_CONFIG_FILE_PATH_SUB); sprintf(KK_DEFAULT_CONFIG_FILE_PATH, "%s/%s", path, KK_DEFAULT_CONFIG_FILE_PATH_SUB);
sprintf(KK_AUTH_CONFIG_FILE_PATH, "%s/%s", path, KK_AUTH_CONFIG_FILE_PATH_SUB); sprintf(KK_AUTH_CONFIG_FILE_PATH, "%s/%s", path, KK_AUTH_CONFIG_FILE_PATH_SUB);
sprintf(KK_VERSION_FILE_PATH, "%s/%s", path, KK_VERSION_FILE_PATH_SUB);
#endif #endif
kk_set_storage_dir(path); kk_set_storage_dir(path);
......
...@@ -232,6 +232,7 @@ static int setStoragePath(char* path){ ...@@ -232,6 +232,7 @@ static int setStoragePath(char* path){
#ifdef CONFIG_A133_PLATFORM #ifdef CONFIG_A133_PLATFORM
sprintf(KK_DEFAULT_CONFIG_FILE_PATH, "%s/%s", path, KK_DEFAULT_CONFIG_FILE_PATH_SUB); sprintf(KK_DEFAULT_CONFIG_FILE_PATH, "%s/%s", path, KK_DEFAULT_CONFIG_FILE_PATH_SUB);
sprintf(KK_AUTH_CONFIG_FILE_PATH, "%s/%s", path, KK_AUTH_CONFIG_FILE_PATH_SUB); sprintf(KK_AUTH_CONFIG_FILE_PATH, "%s/%s", path, KK_AUTH_CONFIG_FILE_PATH_SUB);
sprintf(KK_VERSION_FILE_PATH, "%s/%s", path, KK_VERSION_FILE_PATH_SUB);
#endif #endif
kk_set_storage_dir(path); kk_set_storage_dir(path);
......
#ifndef _KK_CCU_VER_H_
#define _KK_CCU_VER_H_
#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"
#endif
#endif
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <time.h> #include <time.h>
#include <signal.h> #include <signal.h>
#include "kk_product.h" #include "kk_product.h"
#include "ccu_ver.h"
#include "com_api.h" #include "com_api.h"
#include "kk_log.h" #include "kk_log.h"
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#define KK_GW_PRODUCTID "gateway_2" #define KK_GW_PRODUCTID "gateway_2"
#define KK_CCU_RANDOM "0000000000" #define KK_CCU_RANDOM "0000000000"
#define KK_CCU_NAME "NEW_CCU" #define KK_CCU_NAME "NEW_CCU"
#define KK_CCU_VERSION "1.3.0"
/* /*
#ifdef CONFIG_A133_PLATFORM #ifdef CONFIG_A133_PLATFORM
#define KK_DEVICESECRET_PATH "/data/local/kk/kk_deviceSecret.txt" #define KK_DEVICESECRET_PATH "/data/local/kk/kk_deviceSecret.txt"
...@@ -137,7 +139,7 @@ ...@@ -137,7 +139,7 @@
#define KK_DEFAULT_CONFIG_FILE_PATH_SUB "kk/etc/cloud_default_config.json" #define KK_DEFAULT_CONFIG_FILE_PATH_SUB "kk/etc/cloud_default_config.json"
#endif #endif
#define KK_AUTH_CONFIG_FILE_PATH_SUB "kk/auth_conf.json" #define KK_AUTH_CONFIG_FILE_PATH_SUB "kk/auth_conf.json"
#define KK_VERSION_FILE_PATH_SUB "kk/etc/VERSION"
__attribute__((weak)) char KK_DEVICESECRET_PATH[128] = STORSGE_DIR"/"KK_DEVICESECRET_PATH_SUB; __attribute__((weak)) char KK_DEVICESECRET_PATH[128] = STORSGE_DIR"/"KK_DEVICESECRET_PATH_SUB;
...@@ -156,9 +158,12 @@ __attribute__((weak)) char KK_CONFIG_FILE_PATH[128] = STORSGE_DIR"/"KK_CONFIG_FI ...@@ -156,9 +158,12 @@ __attribute__((weak)) char KK_CONFIG_FILE_PATH[128] = STORSGE_DIR"/"KK_CONFIG_FI
#ifdef CONFIG_A133_PLATFORM #ifdef CONFIG_A133_PLATFORM
__attribute__((weak)) char KK_DEFAULT_CONFIG_FILE_PATH[128] = STORSGE_DIR"/"KK_DEFAULT_CONFIG_FILE_PATH_SUB; __attribute__((weak)) char KK_DEFAULT_CONFIG_FILE_PATH[128] = STORSGE_DIR"/"KK_DEFAULT_CONFIG_FILE_PATH_SUB;
__attribute__((weak)) char KK_AUTH_CONFIG_FILE_PATH[128] = STORSGE_DIR"/"KK_AUTH_CONFIG_FILE_PATH_SUB; __attribute__((weak)) char KK_AUTH_CONFIG_FILE_PATH[128] = STORSGE_DIR"/"KK_AUTH_CONFIG_FILE_PATH_SUB;
__attribute__((weak)) char KK_VERSION_FILE_PATH[128] = STORSGE_DIR"/"KK_VERSION_FILE_PATH_SUB;
#else #else
__attribute__((weak)) char KK_DEFAULT_CONFIG_FILE_PATH[128] = "/app/ccuApps/config/cloud_default_config.json"; __attribute__((weak)) char KK_DEFAULT_CONFIG_FILE_PATH[128] = "/app/ccuApps/config/cloud_default_config.json";
__attribute__((weak)) char KK_AUTH_CONFIG_FILE_PATH[128] = "/tmp/auth_conf.json"; __attribute__((weak)) char KK_AUTH_CONFIG_FILE_PATH[128] = "/tmp/auth_conf.json";
__attribute__((weak)) char KK_VERSION_FILE_PATH[128] = "/app/ccuApps/VERSION"
#endif #endif
enum { enum {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "kk_hal.h" #include "kk_hal.h"
#include "kk_scene_handle.h" #include "kk_scene_handle.h"
#include "dm_ota.h" #include "dm_ota.h"
#include "ccu_ver.h"
#include "kk_area_handle.h" #include "kk_area_handle.h"
#include "kk_property_get_handle.h" #include "kk_property_get_handle.h"
#include "kk_motor_bind_db.h" #include "kk_motor_bind_db.h"
...@@ -326,11 +326,13 @@ static int kk_property_set_data_check(cJSON * payload,const char *deviceCode){ ...@@ -326,11 +326,13 @@ static int kk_property_set_data_check(cJSON * payload,const char *deviceCode){
}else{ }else{
epNumInt = 1; epNumInt = 1;
} }
//printf("----------------->epNumInt:%d\n",epNumInt);
for(idx = 0; idx < node->dev_shadow->property_number; idx++){ for(idx = 0; idx < node->dev_shadow->property_number; idx++){
property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx); property = (kk_tsl_data_t *)(node->dev_shadow->properties + idx);
if(property == NULL){ if(property == NULL){
continue; continue;
} }
//printf("----------------->property->identifier:%s\n",property->identifier);
memset(propertiesTmp,0x0,sizeof(propertiesTmp)); memset(propertiesTmp,0x0,sizeof(propertiesTmp));
memcpy(propertiesTmp,property->identifier,strlen(property->identifier)); memcpy(propertiesTmp,property->identifier,strlen(property->identifier));
split(propertiesTmp,"_",propertiesbuf,&num); split(propertiesTmp,"_",propertiesbuf,&num);
...@@ -996,7 +998,7 @@ void mid_cb(void* data, int len){ ...@@ -996,7 +998,7 @@ void mid_cb(void* data, int len){
} }
#if 0 #if 0
if(strcmp(gw_node->productType,KK_DM_AIR_SWITCH_GATEWAY_TYPE) == 0){ if(strcmp(gw_node->productType,KK_DM_AIR_SWITCH_GATEWAY_TYPE) == 0){
res = _kk_handle_airswitch_property(gw_node->fatherDeviceCode,info_root,payload); res = _kk_handle_airswitch_property(gw_node->fatherDeviceCode,info_root,payload);//空开epnum 传的是数组,无语
if(res != 0){ if(res != 0){
cJSON * rootData=cJSON_CreateObject(); cJSON * rootData=cJSON_CreateObject();
char *info_rootS=cJSON_Print(info_root); char *info_rootS=cJSON_Print(info_root);
...@@ -1693,11 +1695,11 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -1693,11 +1695,11 @@ void kk_platMsg_handle(void* data, char* chalMark){
if(strcmp(eventItem->identifier,"DoorBell") != 0){//门铃事件不处理; if(strcmp(eventItem->identifier,"DoorBell") != 0){//门铃事件不处理;
dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL); dm_msg_thing_event_post(info_dcode->valuestring,eventItem->identifier,NULL);
} }
}
} }
} }
} }
}
else if(strstr(msgType->valuestring, KK_THING_TOPO_BATCH_DELETE_MSG) != NULL){ else if(strstr(msgType->valuestring, KK_THING_TOPO_BATCH_DELETE_MSG) != NULL){
kk_ipc_send(IPC_MID2APP,data,strlen(data)); kk_ipc_send(IPC_MID2APP,data,strlen(data));
jsonPay = cJSON_GetObjectItem(payload, MSG_PARAMS_STR); jsonPay = cJSON_GetObjectItem(payload, MSG_PARAMS_STR);
...@@ -2105,6 +2107,7 @@ static int setStoragePath(char* path){ ...@@ -2105,6 +2107,7 @@ static int setStoragePath(char* path){
#ifdef CONFIG_A133_PLATFORM #ifdef CONFIG_A133_PLATFORM
sprintf(KK_DEFAULT_CONFIG_FILE_PATH, "%s/%s", path, KK_DEFAULT_CONFIG_FILE_PATH_SUB); sprintf(KK_DEFAULT_CONFIG_FILE_PATH, "%s/%s", path, KK_DEFAULT_CONFIG_FILE_PATH_SUB);
sprintf(KK_AUTH_CONFIG_FILE_PATH, "%s/%s", path, KK_AUTH_CONFIG_FILE_PATH_SUB); sprintf(KK_AUTH_CONFIG_FILE_PATH, "%s/%s", path, KK_AUTH_CONFIG_FILE_PATH_SUB);
sprintf(KK_VERSION_FILE_PATH, "%s/%s", path, KK_VERSION_FILE_PATH_SUB);
#endif #endif
kk_set_storage_dir(path); kk_set_storage_dir(path);
......
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