Commit 93d95f0b authored by 陈伟灿's avatar 陈伟灿

Merge branch 'cwc' into 'master'

Cwc

See merge request chenweican/k-sdk!118
parents 4d9d15b7 298ae08d
...@@ -62,7 +62,7 @@ static int kk_info_get(char *str) ...@@ -62,7 +62,7 @@ static int kk_info_get(char *str)
cJSON_AddItemToObject(args, "ccu", ccu); cJSON_AddItemToObject(args, "ccu", ccu);
cJSON_AddStringToObject(ccu, "id", &ccuid[4]); cJSON_AddStringToObject(ccu, "id", &ccuid[4]);
cJSON_AddStringToObject(ccu, "version", version); cJSON_AddStringToObject(ccu, "version", "1.1.1");
cJSON_AddStringToObject(ccu, "name", "kk_new_ccu"); cJSON_AddStringToObject(ccu, "name", "kk_new_ccu");
//INFO_PRINT("---222kk_get_cloud_status():%d\n",kk_get_cloud_status()); //INFO_PRINT("---222kk_get_cloud_status():%d\n",kk_get_cloud_status());
//if(kk_get_gw_status() == DEVICE_OFFLINE){ //if(kk_get_gw_status() == DEVICE_OFFLINE){
......
...@@ -115,16 +115,15 @@ void KK_reset_sub_flag(void) ...@@ -115,16 +115,15 @@ void KK_reset_sub_flag(void)
int KK_CCU_TOPIC_Subscribe(void) int KK_CCU_TOPIC_Subscribe(void)
{ {
char productCode[PRODUCT_CODE_LEN] = {0}; char productCode[PRODUCT_CODE_LEN] = {0};
char deviceCode[MAC_ADDR_LEN] = {0};
if(s_ccu_topic_sub == 1){ if(s_ccu_topic_sub == 1){
INFO_PRINT("[%s][%d] already Subscribe\n",__FUNCTION__,__LINE__); INFO_PRINT("[%s][%d] already Subscribe\n",__FUNCTION__,__LINE__);
return -1; //return -1;
} }
char ccuid[32] = {0}; char ccuid[32] = {0};
KK_Get_ccuid(ccuid); KK_Get_ccuid(ccuid);
s_ccu_topic_sub = 1; s_ccu_topic_sub = 1;
HAL_GetProduct_Code(productCode); HAL_GetProduct_Code(productCode);
HAL_Get_mac(deviceCode);
return _kk_ccu_topic_subscribe(productCode,ccuid); return _kk_ccu_topic_subscribe(productCode,ccuid);
} }
......
...@@ -198,8 +198,8 @@ int devOpen(char *dev) ...@@ -198,8 +198,8 @@ int devOpen(char *dev)
if(fd == -1) if(fd == -1)
{ {
SERIAL_LOG_ERR("devOpen %s\n ",dev); //SERIAL_LOG_ERR("devOpen %s\n ",dev);
perror("devOpen"); //perror("devOpen");
return -1; return -1;
} }
......
...@@ -115,7 +115,27 @@ cJSON * kk_control_protocol_convert(kk_map_dev_node_t *devNode,int nodeId,cJSON ...@@ -115,7 +115,27 @@ cJSON * kk_control_protocol_convert(kk_map_dev_node_t *devNode,int nodeId,cJSON
return params; return params;
} }
static int kk_guard_ctrl_handle(int status)
{
char ccuid[33]={0};
kk_lan_get_ccuid(ccuid);
cJSON *root = cJSON_CreateObject();
cJSON *params = cJSON_CreateObject();
cJSON_AddStringToObject(params,"epNum","1");
if(status == 0){ //
cJSON_AddStringToObject(params,"ArmingState","0");
}else if(status == 2){ //ڼ
cJSON_AddStringToObject(params,"ArmingState","2");
}else{ //
cJSON_AddStringToObject(params,"ArmingState","1");
}
cJSON *info = property_info_build("/thing/service/property/set",KK_CCU_PRODUCTID,ccuid);
cJSON *payload = property_payload_build("thing.service.property.set","1","v1.0",params);
cJSON_AddItemToObject(root,INFO_STRING,info);
cJSON_AddItemToObject(root,PAYLOAD_STRING,payload);
kk_ipc_send_json(root);
return 0;
}
static int kk_indoorAir_ctrl_handle(char *epNum,cJSON *arg) static int kk_indoorAir_ctrl_handle(char *epNum,cJSON *arg)
{ {
kk_map_dev_node_t *dev = NULL; kk_map_dev_node_t *dev = NULL;
...@@ -202,6 +222,17 @@ int kk_ccu_opcode_handle(cJSON *root) ...@@ -202,6 +222,17 @@ int kk_ccu_opcode_handle(cJSON *root)
kk_indoorAir_ctrl_handle(nodeId->valuestring,arg); kk_indoorAir_ctrl_handle(nodeId->valuestring,arg);
return 0; return 0;
}else if(strcmp(requester->valuestring,"HJ_Server") == 0){
if(strcmp(opcode->valuestring,"ARMING_IN_HOME") == 0){
kk_guard_ctrl_handle(2);
return 0;
}else if(strcmp(opcode->valuestring,"ARMING_LEAVE_HOME") == 0){
kk_guard_ctrl_handle(0);
return 0;
}else if(strcmp(opcode->valuestring,"DISARMING") == 0){
kk_guard_ctrl_handle(1);
return 0;
}
} }
} }
......
...@@ -315,7 +315,7 @@ void *kk_vp_manage_thread(void *arg) ...@@ -315,7 +315,7 @@ void *kk_vp_manage_thread(void *arg)
break; break;
case UPDATING_8009_CONFIG_FILE_INFO: case UPDATING_8009_CONFIG_FILE_INFO:
debug_log(LOG_INFO_LEVEL,"updating...\n"); //debug_log(LOG_INFO,"updating...\n");
sleep(1); sleep(1);
//todo :超时取消 //todo :超时取消
break; break;
......
This diff is collapsed.
...@@ -1239,7 +1239,52 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params) ...@@ -1239,7 +1239,52 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params)
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
int kk_msg_cloud_status_notify(const char *deviceCode,const char *productCode)
{
char *method = "thing.service.cloudStatus";
char *req_info = NULL,*payload = NULL;
int req_info_len = 0,payload_len = 0;
char msgId[MSG_MAX_LEN] = {0};
req_info_len = strlen(DM_MSG_INFO)+10+strlen(deviceCode)+strlen(productCode)+strlen(KK_THING_SERVICE_CLOUDSTATUS)+1;
req_info = malloc(req_info_len);
if (req_info == NULL) {
return MEMORY_NOT_ENOUGH;
}
memset(req_info, 0, req_info_len);
snprintf(req_info, req_info_len, DM_MSG_INFO, KK_THING_SERVICE_CLOUDSTATUS,productCode, deviceCode);
cJSON *params=cJSON_CreateObject();
cJSON_AddNumberToObject(params, "status", 1);
char *paramStr = cJSON_Print(params);
payload_len = strlen(DM_MSG_REQUEST) + 10 + strlen(DM_MSG_VERSION) + strlen(paramStr) + strlen(
method) + 1 + 20 + sizeof(msgId);
payload = malloc(payload_len);
if (payload == NULL) {
free(req_info);
return MEMORY_NOT_ENOUGH;
}
memset(payload, 0, payload_len);
iotx_report_id(msgId);
//sprintf(msgId,"%d",iotx_report_id());
snprintf(payload, payload_len, DM_MSG_REQUEST, msgId,
DM_MSG_VERSION, paramStr,HAL_GetTime(), method);
cJSON *root=cJSON_CreateObject();
cJSON* infoObj = cJSON_Parse(req_info);
cJSON* payloadObj = cJSON_Parse(payload);
cJSON_AddItemToObject(root, "info", infoObj);
cJSON_AddItemToObject(root, "payload",payloadObj);
void *buf = cJSON_Print(root);
printf("------------------------------------------------------->333\n");
kk_sendData2gw(buf, strlen(buf), deviceCode);
free(paramStr);
free(buf);
free(req_info);
free(payload);
cJSON_Delete(params);
cJSON_Delete(root);
return SUCCESS_RETURN;
}
int kk_msg_execute_property_set(const char *productCode,const char *deviceCode,const char* params,const char *fatherDeviceCode) int kk_msg_execute_property_set(const char *productCode,const char *deviceCode,const char* params,const char *fatherDeviceCode)
{ {
char *method = "thing.service.property.set"; char *method = "thing.service.property.set";
......
...@@ -85,7 +85,7 @@ const char DM_MSG_INFO[] DM_READ_ONLY; ...@@ -85,7 +85,7 @@ const char DM_MSG_INFO[] DM_READ_ONLY;
#define KK_THING_SERVICE_SYNCINFO "/thing/service/syncinfo" #define KK_THING_SERVICE_SYNCINFO "/thing/service/syncinfo"
#define KK_THING_SERVICE_SYNCDEVICEINFO "/thing/service/syncDeviceInfo" #define KK_THING_SERVICE_SYNCDEVICEINFO "/thing/service/syncDeviceInfo"
#define KK_THING_SERVICE_SYNCDEVICEINFO_REPLY "/thing/service/syncDeviceInfo_reply" #define KK_THING_SERVICE_SYNCDEVICEINFO_REPLY "/thing/service/syncDeviceInfo_reply"
#define KK_THING_SERVICE_CLOUDSTATUS "/thing/service/cloudStatus"
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
static int s_gateway_add_flag = 0;
typedef struct { typedef struct {
int msgid; int msgid;
...@@ -351,10 +351,10 @@ int kk_topo_delete_handle(cJSON *payload,cJSON *buf) ...@@ -351,10 +351,10 @@ int kk_topo_delete_handle(cJSON *payload,cJSON *buf)
cJSON_AddItemToObject(rootData,"payload",payload); cJSON_AddItemToObject(rootData,"payload",payload);
char *pnewout=cJSON_Print(rootData); char *pnewout=cJSON_Print(rootData);
kk_sendData2gw(pnewout, strlen(pnewout), node->fatherDeviceCode);//send to gw itself kk_sendData2gw(pnewout, strlen(pnewout), node->fatherDeviceCode);//send to gw itself
free(pnewout);
cJSON_Delete(rootData);
dm_mgr_subdev_delete(deviceCode); dm_mgr_subdev_delete(deviceCode);
item = item->next; free(pnewout);
//cJSON_Delete(rootData);
return SUCCESS_RETURN;
} }
} }
...@@ -1094,9 +1094,10 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data) ...@@ -1094,9 +1094,10 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
char *payload_Str = NULL; char *payload_Str = NULL;
cJSON *deviceCode = NULL; cJSON *deviceCode = NULL;
json=cJSON_Parse(data); json=cJSON_Parse(data);
_iotx_linkkit_mutex_lock();
if (json == NULL) { if (json == NULL) {
WARNING_PRINT("Error before: [%s]\n","cJSON_Parse"); WARNING_PRINT("Error before: [%s]\n","cJSON_Parse");
_iotx_linkkit_mutex_unlock();
return; return;
} }
info_root = cJSON_GetObjectItem(json, MSG_INFO_STR); info_root = cJSON_GetObjectItem(json, MSG_INFO_STR);
...@@ -1195,7 +1196,8 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data) ...@@ -1195,7 +1196,8 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
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
usleep(200000); if(s_gateway_add_flag == 0)
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();
} }
...@@ -1370,6 +1372,7 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data) ...@@ -1370,6 +1372,7 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
directReturn: directReturn:
free(payload_Str); free(payload_Str);
cJSON_Delete(json); cJSON_Delete(json);
_iotx_linkkit_mutex_unlock();
} }
/************************************************************ /************************************************************
...@@ -1765,7 +1768,15 @@ int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char d ...@@ -1765,7 +1768,15 @@ int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char d
} }
kk_subDev_update_productType(node->productType,deviceCode); kk_subDev_update_productType(node->productType,deviceCode);
} }
if(devType == KK_DM_DEVICE_GATEWAY){//如果还没有连上云,网关topo add不处理
if(s_CloudStatus){
//kk_subDev_update_auth(1,deviceCode);
s_gateway_add_flag = 1;
}else{
ERROR_PRINT("Cloud is not connected!!!!!!!!\n");
return FAIL_RETURN;
}
}
_iotx_linkkit_mutex_lock(); _iotx_linkkit_mutex_lock();
res = _iotx_linkkit_slave_connect(devid); res = _iotx_linkkit_slave_connect(devid);
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
......
...@@ -228,8 +228,6 @@ static int _kk_check_door_induction_device(char *productCode){ ...@@ -228,8 +228,6 @@ static int _kk_check_door_induction_device(char *productCode){
int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_data_type_e valuetype,int devtype) int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_data_type_e valuetype,int devtype)
{ {
printf("---------------------------------------->identifier:%s\n",identifier);
dm_mgr_dev_node_t *node = NULL; dm_mgr_dev_node_t *node = NULL;
int res = 0 ; int res = 0 ;
const char *insertCmd = "insert into PropertiesInfo (deviceCode,identifier,value,valueType,devType) \ const char *insertCmd = "insert into PropertiesInfo (deviceCode,identifier,value,valueType,devType) \
...@@ -238,12 +236,10 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d ...@@ -238,12 +236,10 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d
int rc = 0; int rc = 0;
char *zErrMsg = 0; char *zErrMsg = 0;
kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx(); kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx();
printf("---------------------------------------->1\n");
if(_kk_check_property_exist(deviceCode,identifier) == 1) if(_kk_check_property_exist(deviceCode,identifier) == 1)
{ {
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
printf("---------------------------------------->2\n");
_kk_property_db_lock(); _kk_property_db_lock();
//传感器类默认安防等级为离家安防 //传感器类默认安防等级为离家安防
if(strcmp(identifier,"SensorType") == 0 && devtype == KK_DM_DEVICE_SUBDEV){ if(strcmp(identifier,"SensorType") == 0 && devtype == KK_DM_DEVICE_SUBDEV){
...@@ -251,12 +247,10 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d ...@@ -251,12 +247,10 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
return FAIL_RETURN; return FAIL_RETURN;
} }
printf("---------------------------------------->3\n");
if(_kk_check_human_induction_device(node->productCode) == 1 || //门磁和人体默认室外安防 if(_kk_check_human_induction_device(node->productCode) == 1 || //门磁和人体默认室外安防
_kk_check_door_induction_device(node->productCode) == 1){ _kk_check_door_induction_device(node->productCode) == 1){
sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"1",valuetype,devtype); sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"1",valuetype,devtype);
}else{ }else{
printf("---------------------------------------->\n");
sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"2",valuetype,devtype);//其他24小时警戒 sqlCmd = sqlite3_mprintf(insertCmd,deviceCode,identifier,"2",valuetype,devtype);//其他24小时警戒
} }
}else{ }else{
......
...@@ -385,7 +385,36 @@ int kk_subDev_update_auth(int isAuth,const char *deviceCode) ...@@ -385,7 +385,36 @@ int kk_subDev_update_auth(int isAuth,const char *deviceCode)
_kk_subDb_unlock(); _kk_subDb_unlock();
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
/************************************************************
*功能描述:更新设备注册标记
*输入参数:deviceCode:设备deviceCode
isAuth:1,已注册;0,未注册
*输出参数:无
*返 回 值:0:成功;其他:失败
*其他说明:
*************************************************************/
int kk_subDev_check_auth(int devType)
{
char *sqlCmd = NULL;
sqlite3_stmt *stmt;
int rc = 0;
char *zErrMsg = 0;
const char *searchCmd = "select * from SubDeviceInfo WHERE devType = '%d';";
kk_subDb_ctx_t *ctx = _kk_subDb_get_ctx();
printf("------------------------------------------------------->111\n");
sqlCmd = sqlite3_mprintf(searchCmd,devType);
sqlite3_prepare_v2(ctx->pDb, sqlCmd, strlen(sqlCmd), &stmt, NULL);
while(sqlite3_step(stmt) == SQLITE_ROW){
printf("------------------------------------------------------->222\n");
char *pDeviceCode = (char*)sqlite3_column_text(stmt, DB_SUB_DEVICECODE);
char *pProductCode = (char*)sqlite3_column_text(stmt, DB_SUB_PRODUCTCODE);
kk_msg_cloud_status_notify(pProductCode,pDeviceCode);
//kk_subDev_update_auth(1,pDeviceCode);
}
sqlite3_finalize(stmt);
sqlite3_free(sqlCmd);
return SUCCESS_RETURN;
}
/************************************************************ /************************************************************
*功能描述:更新内场景支持,此接口只针对网关设备有效 *功能描述:更新内场景支持,此接口只针对网关设备有效
*输入参数:deviceCode:设备deviceCode *输入参数:deviceCode:设备deviceCode
......
...@@ -15,7 +15,6 @@ int kk_subDev_update_auth(int isAuth,const char *deviceCode); ...@@ -15,7 +15,6 @@ int kk_subDev_update_auth(int isAuth,const char *deviceCode);
int kk_subDev_update_sceneSupport(int sceneSupport,const char *deviceCode); int kk_subDev_update_sceneSupport(int sceneSupport,const char *deviceCode);
int kk_subDev_delete_by_dcode(char deviceCode[DEVICE_CODE_MAXLEN]); int kk_subDev_delete_by_dcode(char deviceCode[DEVICE_CODE_MAXLEN]);
int kk_subDev_update_productType(char *productType,const char *deviceCode); int kk_subDev_update_productType(char *productType,const char *deviceCode);
int kk_subDev_update_auth(int isAuth,const char *deviceCode);
int kk_subDev_send_property_get_from_db(void); int kk_subDev_send_property_get_from_db(void);
int kk_subDev_send_property_get(const char *fatherDeviceCode); int kk_subDev_send_property_get(const char *fatherDeviceCode);
...@@ -24,6 +23,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen ...@@ -24,6 +23,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen
int kk_subDev_update_offline(int isOffline,const char *deviceCode); int kk_subDev_update_offline(int isOffline,const char *deviceCode);
int kk_subDev_getSensors_reply(SensorType_t*list); int kk_subDev_getSensors_reply(SensorType_t*list);
int kk_load_subDevice(void); int kk_load_subDevice(void);
int kk_subDev_check_auth(int devType);
enum{ enum{
DB_SUB_IDX = 0, DB_SUB_IDX = 0,
DB_SUB_ONLINE, DB_SUB_ONLINE,
......
...@@ -783,6 +783,7 @@ void kk_platMsg_handle(void* data, char* chalMark){ ...@@ -783,6 +783,7 @@ void kk_platMsg_handle(void* data, char* chalMark){
if(sceneSupportStr != NULL&&!strcmp(sceneSupportStr->valuestring,"1")){ if(sceneSupportStr != NULL&&!strcmp(sceneSupportStr->valuestring,"1")){
kk_subDev_update_sceneSupport(1,devCode->valuestring); kk_subDev_update_sceneSupport(1,devCode->valuestring);
} }
kk_dm_gw_status_update_online(info_dcode->valuestring);
}else{ }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);
} }
......
#!/bin/sh #!/bin/sh
#filepath="/home/kk"
filepath="/app/ccuApps"
if [ ! -f "/sbin/jq" ] if [ ! -f "/sbin/jq" ]
then then
cp /app/ccuApps/jq /sbin cp $filepath/jq /sbin
fi fi
if [ -f "/app/nx5Apps/syscfg.json" ] if [ -f "/app/nx5Apps/syscfg.json" ]
then then
...@@ -19,9 +21,9 @@ then ...@@ -19,9 +21,9 @@ then
fi fi
fi fi
nanomsg_File="/app/ccuApps/lib/libnanomsg.so.5" nanomsg_File="$filepath/lib/libnanomsg.so.5"
ev_File="/app/ccuApps/lib/libev.so.4" ev_File="$filepath/lib/libev.so.4"
sqlite_File="/app/ccuApps/lib/libsqlite3.so.0" sqlite_File="$filepath/lib/libsqlite3.so.0"
run_Dir="/data/kk" run_Dir="/data/kk"
tsl_Dir="${run_Dir}/tsl" tsl_Dir="${run_Dir}/tsl"
...@@ -38,36 +40,36 @@ if [ ! -d "$run_Dir" ]; then ...@@ -38,36 +40,36 @@ if [ ! -d "$run_Dir" ]; then
fi fi
if [ ! -d "$tsl_Dir" ]; then if [ ! -d "$tsl_Dir" ]; then
cp -rf /app/ccuApps/tsl ${run_Dir}/ cp -rf $filepath/tsl ${run_Dir}/
fi fi
if [ ! -d "$map_Dir" ]; then if [ ! -d "$map_Dir" ]; then
cp -rf /app/ccuApps/map ${run_Dir}/ cp -rf $filepath/map ${run_Dir}/
fi fi
cd /app/ccuApps/lib cd $filepath/lib
if [ ! -f "$nanomsg_File" ]; then if [ ! -f "$nanomsg_File" ]; then
ln -sf /app/ccuApps/lib/libnanomsg.so /lib/libnanomsg.so.5 ln -sf $filepath/lib/libnanomsg.so /lib/libnanomsg.so.5
fi fi
if [ ! -f "$ev_File" ]; then if [ ! -f "$ev_File" ]; then
ln -sf /app/ccuApps/lib/libev.so /lib/libev.so.4 ln -sf $filepath/lib/libev.so /lib/libev.so.4
fi fi
if [ ! -f "$sqlite_File" ]; then if [ ! -f "$sqlite_File" ]; then
ln -sf /app/ccuApps/lib/libsqlite3.so /lib/libsqlite3.so.0 ln -sf $filepath/lib/libsqlite3.so /lib/libsqlite3.so.0
fi fi
export LD_LIBRARY_PATH=/app/ccuApps/lib export LD_LIBRARY_PATH=$filepath/lib
/app/ccuApps/bin/kk_midware & $filepath/bin/kk_midware &
sleep 3 sleep 3
/app/ccuApps/bin/kk_cloud & $filepath/bin/kk_cloud &
sleep 1 sleep 5
#/home/kk/process_check.sh >/dev/null 2>&1 & #/home/kk/process_check.sh >/dev/null 2>&1 &
/app/ccuApps/bin/smarthome_z3gw_nx5 -r0 -l3 --device-def=/app/ccuApps/kk_device_def.json --db=/data/kk/kk_z3gw.db --uart=/dev/ttyS1& $filepath/bin/smarthome_z3gw_nx5 -r0 -l3 --device-def=$filepath/kk_device_def.json --db=/data/kk/kk_z3gw.db --uart=/dev/ttyS1&
sleep 2 sleep 2
/app/ccuApps/bin/kk_lan & $filepath/bin/kk_lan --uart=/dev/ttyS3&
sleep 1 sleep 1
echo "*/1 * * * * /app/ccuApps/process_check.sh" > /etc/cron.d/ccu || { echo "ERROR:add ccu crontab rule failed."; exit 1;} #echo "*/1 * * * * /app/ccuApps/process_check.sh" > /etc/cron.d/ccu || { echo "ERROR:add ccu crontab rule failed."; exit 1;}
ntpd -n -q -d -p stdtime.gov.hk & ntpd -n -q -d -p stdtime.gov.hk &
exit 0 exit 0
\ No newline at end of file
...@@ -210,6 +210,7 @@ package: ...@@ -210,6 +210,7 @@ package:
cp -rf $(TOP_DIR)/process_check.sh $(TOP_DIR)/$(releaseDir)/ cp -rf $(TOP_DIR)/process_check.sh $(TOP_DIR)/$(releaseDir)/
cp -rf $(TOP_DIR)/onboot.sh $(TOP_DIR)/$(releaseDir)/ cp -rf $(TOP_DIR)/onboot.sh $(TOP_DIR)/$(releaseDir)/
cp -rf $(TOP_DIR)/killall.sh $(TOP_DIR)/$(releaseDir)/
cp -rf $(TOP_DIR)/VERSION $(TOP_DIR)/$(releaseDir)/ cp -rf $(TOP_DIR)/VERSION $(TOP_DIR)/$(releaseDir)/
cp -rf $(TOP_DIR)/opcodeMapCfg/* $(TOP_DIR)/$(releaseDir)/map cp -rf $(TOP_DIR)/opcodeMapCfg/* $(TOP_DIR)/$(releaseDir)/map
#cp -rf $(TOP_DIR)/platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table $(TOP_DIR)/$(releaseDir)/ #cp -rf $(TOP_DIR)/platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table $(TOP_DIR)/$(releaseDir)/
...@@ -218,6 +219,7 @@ ifeq ($(CONFIG_MODEL),ubuntu) ...@@ -218,6 +219,7 @@ ifeq ($(CONFIG_MODEL),ubuntu)
cp -rf $(TOP_DIR)/common/nanomsg/libnanomsg_ubuntu.so $(TOP_DIR)/$(releaseDir)/lib/libnanomsg.so.5 cp -rf $(TOP_DIR)/common/nanomsg/libnanomsg_ubuntu.so $(TOP_DIR)/$(releaseDir)/lib/libnanomsg.so.5
cp -rf $(TOP_DIR)/common/ev/libev_ubuntu.so $(TOP_DIR)/$(releaseDir)/lib cp -rf $(TOP_DIR)/common/ev/libev_ubuntu.so $(TOP_DIR)/$(releaseDir)/lib
else ifeq ($(CONFIG_MODEL),nx5) else ifeq ($(CONFIG_MODEL),nx5)
cp -rf $(TOP_DIR)/jq $(TOP_DIR)/$(releaseDir)/
cp -rf $(TOP_DIR)/common/nanomsg/libnanomsg_nx5.so $(TOP_DIR)/$(releaseDir)/lib/libnanomsg.so cp -rf $(TOP_DIR)/common/nanomsg/libnanomsg_nx5.so $(TOP_DIR)/$(releaseDir)/lib/libnanomsg.so
cp -rf $(TOP_DIR)/common/ev/libev_nx5.so $(TOP_DIR)/$(releaseDir)/lib/libev.so cp -rf $(TOP_DIR)/common/ev/libev_nx5.so $(TOP_DIR)/$(releaseDir)/lib/libev.so
cp -rf $(TOP_DIR)/common/sqlite/libsqlite3_nx5.so $(TOP_DIR)/$(releaseDir)/lib/libsqlite3.so cp -rf $(TOP_DIR)/common/sqlite/libsqlite3_nx5.so $(TOP_DIR)/$(releaseDir)/lib/libsqlite3.so
......
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