Commit 7fc8b819 authored by 陈伟灿's avatar 陈伟灿

Merge branch 'hzl' into 'master'

Hzl

See merge request chenweican/k-sdk!30
parents 740f213d bf82a042
...@@ -3,32 +3,41 @@ nanomsg_File="/home/kk/lib/libnanomsg.so.5" ...@@ -3,32 +3,41 @@ nanomsg_File="/home/kk/lib/libnanomsg.so.5"
ev_File="/home/kk/lib/libev.so.4" ev_File="/home/kk/lib/libev.so.4"
sqlite_File="/home/kk/lib/libsqlite3.so.0" sqlite_File="/home/kk/lib/libsqlite3.so.0"
run_Dir="/" run_Dir="/usr/kk"
dev_cfg_Dir="${run_Dir}/ZB/dev_config_table" tsl_Dir="${run_Dir}/tsl"
dev_cfg_Dir="${run_Dir}/dev_config_table"
cd /sbin/ cd /sbin/
insmod /sbin/ssd1306-revision.ko insmod /sbin/ssd1306-revision.ko
/sbin/oled >/dev/null 2>&1 & /sbin/oled >/dev/null 2>&1 &
sleep 1 sleep 1
if [ ! -d "$run_Dir" ]; then
mkdir ${run_Dir}
fi
if [ ! -d "$tsl_Dir" ]; then
cp -rf /home/kk/tsl ${run_Dir}/
fi
if [ ! -d "$dev_cfg_Dir" ]; then if [ ! -d "$dev_cfg_Dir" ]; then
mkdir /ZB cp -rf /home/kk/dev_config_table ${run_Dir}
cp -rf /home/kk/dev_config_table /ZB sleep 1
cp -rf /home/kk/dev_map_table.json /ZB
fi fi
sleep 1
export LD_LIBRARY_PATH=/home/kk/lib export LD_LIBRARY_PATH=/home/kk/lib
cd /home/kk/lib cd /home/kk/lib
if [ ! -f "$nanomsg_File" ]; then if [ ! -f "$nanomsg_File" ]; then
ln -s libnanomsg.so /lib/libnanomsg.so.5 ln -sf /home/kk/lib/libnanomsg.so /lib/libnanomsg.so.5
fi fi
if [ ! -f "$ev_File" ]; then if [ ! -f "$ev_File" ]; then
ln -s libev.so /lib/libev.so.4 ln -sf /home/kk/lib/libev.so /lib/libev.so.4
fi fi
if [ ! -f "$sqlite_File" ]; then if [ ! -f "$sqlite_File" ]; then
ln -s libsqlite3.so /lib/libsqlite3.so.0 ln -sf /home/kk/lib/libsqlite3.so /lib/libsqlite3.so.0
fi fi
...@@ -41,9 +50,9 @@ export LD_LIBRARY_PATH=/home/kk/lib ...@@ -41,9 +50,9 @@ export LD_LIBRARY_PATH=/home/kk/lib
cd ${run_Dir} cd ${run_Dir}
/home/kk/kk_midware >/dev/null 2>&1 & /home/kk/kk_midware >/dev/null 2>&1 &
sleep 1
/home/kk/kcloud >/dev/null 2>&1 & /home/kk/kcloud >/dev/null 2>&1 &
/home/kk/Z3GatewayHost -f x -p /dev/ttyS0 >/dev/null 2>&1 & /home/kk/Z3GatewayHost -f x -p /dev/ttyS0 >/dev/null 2>&1 &
sleep 5
/home/kk/process_check.sh >/dev/null 2>&1 & /home/kk/process_check.sh >/dev/null 2>&1 &
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "kk_property_db.h" #include "kk_property_db.h"
#define KK_PROPERTIES_DB_FILE "kk_properties.db" #define KK_PROPERTIES_DB_FILE "/usr/kk/kk_properties.db"
typedef struct { typedef struct {
void *mutex; void *mutex;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "sqlite3.h" #include "sqlite3.h"
#include "kk_log.h" #include "kk_log.h"
#define KK_SUB_DB_FILE "subDevice.db" #define KK_SUB_DB_FILE "/usr/kk/subDevice.db"
typedef struct { typedef struct {
void *mutex; void *mutex;
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
#include "kk_tsl_common.h" #include "kk_tsl_common.h"
#include "kk_dm_mng.h" #include "kk_dm_mng.h"
#include "kk_log.h" #include "kk_log.h"
#define TSL_SUBDEVICE_PATH_FILE "/home/kk/tsl/product_%s.json" #define TSL_SUBDEVICE_PATH_FILE "/usr/kk/tsl/product_%s.json"
#define TSL_GATEWAY_PATH_FILE "/home/kk/tsl/gateway-%s.json" #define TSL_GATEWAY_PATH_FILE "/usr/kk/tsl/gateway-%s.json"
#define TSL_CCU_PATH_FILE "/home/kk/tsl/ccu-%s.json" #define TSL_CCU_PATH_FILE "/usr/kk/tsl/ccu-%s.json"
char* kk_load_json(const char *productCode,int type) char* kk_load_json(const char *productCode,int type)
{ {
......
...@@ -254,7 +254,7 @@ error_return: ...@@ -254,7 +254,7 @@ error_return:
#define KK_DEVICE_MAP_TABLE_FILE "./ZB/dev_map_table.json" #define KK_DEVICE_MAP_TABLE_FILE "/usr/kk/dev_config_table/dev_map_table.json"
#define KK_DEVICE_MAP_TABLE_ARRAY_IDENTIFY "mapTable" #define KK_DEVICE_MAP_TABLE_ARRAY_IDENTIFY "mapTable"
#define KK_DEVICE_CONFIG_MAP_TABLE_ARRAY_IDENTIFY "config" #define KK_DEVICE_CONFIG_MAP_TABLE_ARRAY_IDENTIFY "config"
...@@ -422,7 +422,7 @@ char *kk_match_productCode(const char* modelId) ...@@ -422,7 +422,7 @@ char *kk_match_productCode(const char* modelId)
static kk_dev_config_map *dev_config_map = NULL; static kk_dev_config_map *dev_config_map = NULL;
#define KK_DEVICE_CONFIG_MAP_TABLE_FILE_PREFIX "./ZB/dev_config_table/device_%s.json" #define KK_DEVICE_CONFIG_MAP_TABLE_FILE_PREFIX "/usr/kk/dev_config_table/device_%s.json"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define KK_DEVICE_DB_TABLE "kk_device" #define KK_DEVICE_DB_TABLE "kk_device"
#define KK_DEVICE_DB_FILE "kk_device.db" #define KK_DEVICE_DB_FILE "/usr/kk/kk_device.db"
......
...@@ -172,7 +172,7 @@ int kk_tsl_set_gloabl_OnOff(jrpc_context * ctx,EmberNodeId node,unsigned char ep ...@@ -172,7 +172,7 @@ int kk_tsl_set_gloabl_OnOff(jrpc_context * ctx,EmberNodeId node,unsigned char ep
uint8_t Onoff = 0; uint8_t Onoff = 0;
EmberStatus status = 0; EmberStatus status = 0;
Onoff = *(uint8_t*)data; Onoff = *(int*)data;
emberAfAppPrintln("[tsl set:OnOff],Onoff=0x%02x",Onoff); emberAfAppPrintln("[tsl set:OnOff],Onoff=0x%02x",Onoff);
if(node==EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID){ if(node==EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID){
...@@ -206,7 +206,7 @@ int kk_tsl_set_windowCovering_OperationMode(jrpc_context * ctx,EmberNodeId node, ...@@ -206,7 +206,7 @@ int kk_tsl_set_windowCovering_OperationMode(jrpc_context * ctx,EmberNodeId node,
uint8_t Operation = 0; uint8_t Operation = 0;
EmberStatus status = 0; EmberStatus status = 0;
Operation = *(uint8_t*)data; Operation = *(int*)data;
emberAfAppPrintln("[tsl set:Window Covering Operation Mode],mode=0x%02x",Operation); emberAfAppPrintln("[tsl set:Window Covering Operation Mode],mode=0x%02x",Operation);
if(node==EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID){ if(node==EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID){
...@@ -242,7 +242,7 @@ int kk_tsl_set_windowCovering_mode(jrpc_context * ctx,EmberNodeId node,unsigned ...@@ -242,7 +242,7 @@ int kk_tsl_set_windowCovering_mode(jrpc_context * ctx,EmberNodeId node,unsigned
uint8_t WCmode = 0; uint8_t WCmode = 0;
EmberStatus status = 0; EmberStatus status = 0;
mode = *(uint8_t*)data; mode = *(int*)data;
emberAfAppPrintln("[tsl set:Window Covering Run Mode],mode=0x%02x",mode); emberAfAppPrintln("[tsl set:Window Covering Run Mode],mode=0x%02x",mode);
if(mode==WC_calibration_mode){ if(mode==WC_calibration_mode){
...@@ -288,7 +288,7 @@ int kk_tsl_set_windowCovering_position(jrpc_context * ctx,EmberNodeId node,unsig ...@@ -288,7 +288,7 @@ int kk_tsl_set_windowCovering_position(jrpc_context * ctx,EmberNodeId node,unsig
uint8_t position = 0; uint8_t position = 0;
EmberStatus status = 0; EmberStatus status = 0;
position = *(uint8_t*)data; position = *(int*)data;
emberAfAppPrintln("[tsl set:Window Covering Position],position=0x%02x",position); emberAfAppPrintln("[tsl set:Window Covering Position],position=0x%02x",position);
status = WindowCover_GotoLiftPercentage(node,ep,position); status = WindowCover_GotoLiftPercentage(node,ep,position);
...@@ -326,7 +326,7 @@ static int kk_zclColorControlMovetohueandsat(EmberNodeId node,unsigned char ep) ...@@ -326,7 +326,7 @@ static int kk_zclColorControlMovetohueandsat(EmberNodeId node,unsigned char ep)
} }
int kk_tsl_set_colorlight_RGB_red(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data) int kk_tsl_set_colorlight_RGB_red(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data)
{ {
int value = *(uint8_t*)data; int value = *(int*)data;
EmberStatus status = 0; EmberStatus status = 0;
emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_RGB_red],value=0x%02x",value); emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_RGB_red],value=0x%02x",value);
//s_Red = value; //s_Red = value;
...@@ -337,7 +337,7 @@ int kk_tsl_set_colorlight_RGB_red(jrpc_context * ctx,EmberNodeId node,unsigned c ...@@ -337,7 +337,7 @@ int kk_tsl_set_colorlight_RGB_red(jrpc_context * ctx,EmberNodeId node,unsigned c
} }
int kk_tsl_set_colorlight_RGB_green(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data) int kk_tsl_set_colorlight_RGB_green(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data)
{ {
int value = *(uint8_t*)data; int value = *(int*)data;
EmberStatus status = 0; EmberStatus status = 0;
emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_RGB_green],value=0x%02x",value); emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_RGB_green],value=0x%02x",value);
//s_Green = value; //s_Green = value;
...@@ -348,7 +348,7 @@ int kk_tsl_set_colorlight_RGB_green(jrpc_context * ctx,EmberNodeId node,unsigned ...@@ -348,7 +348,7 @@ int kk_tsl_set_colorlight_RGB_green(jrpc_context * ctx,EmberNodeId node,unsigned
} }
int kk_tsl_set_colorlight_RGB_blue(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data) int kk_tsl_set_colorlight_RGB_blue(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data)
{ {
int value = *(uint8_t*)data; int value = *(int*)data;
EmberStatus status = 0; EmberStatus status = 0;
emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_RGB_blue],value=0x%02x",value); emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_RGB_blue],value=0x%02x",value);
//s_Blue = value; //s_Blue = value;
...@@ -360,7 +360,7 @@ int kk_tsl_set_colorlight_RGB_blue(jrpc_context * ctx,EmberNodeId node,unsigned ...@@ -360,7 +360,7 @@ int kk_tsl_set_colorlight_RGB_blue(jrpc_context * ctx,EmberNodeId node,unsigned
int kk_tsl_set_colorlight_Brightness(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data) int kk_tsl_set_colorlight_Brightness(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data)
{ {
int value = *(uint8_t*)data; int value = *(int*)data;
EmberStatus status = 0; EmberStatus status = 0;
emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_Brightness],value=0x%02x",value); emberAfAppPrintln("[tsl set:kk_tsl_set_colorloght_Brightness],value=0x%02x",value);
if(node==EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID){ if(node==EMBER_AF_PLUGIN_DEVICE_TABLE_NULL_NODE_ID){
...@@ -375,7 +375,7 @@ int kk_tsl_set_colorlight_Brightness(jrpc_context * ctx,EmberNodeId node,unsigne ...@@ -375,7 +375,7 @@ int kk_tsl_set_colorlight_Brightness(jrpc_context * ctx,EmberNodeId node,unsigne
int kk_tsl_set_colorlight_mode(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data) int kk_tsl_set_colorlight_mode(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data)
{ {
int value = *(uint8_t*)data; int value = *(int*)data;
EmberStatus status = EMBER_ERR_FATAL; EmberStatus status = EMBER_ERR_FATAL;
kk_dev_config_item_extra_data *mode; kk_dev_config_item_extra_data *mode;
int ix = 1; int ix = 1;
......
...@@ -208,7 +208,7 @@ package: ...@@ -208,7 +208,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)/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)/
cp -rf $(TOP_DIR)/platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_map_table.json $(TOP_DIR)/$(releaseDir)/ cp -rf $(TOP_DIR)/platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_map_table.json $(TOP_DIR)/$(releaseDir)/dev_config_table/
ifeq ($(CONFIG_VENDOR),ubuntu) ifeq ($(CONFIG_VENDOR),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
......
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