Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈伟灿
k-sdk
Commits
fdcba0f7
Commit
fdcba0f7
authored
Jan 18, 2022
by
陈伟灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'yjq'
# Conflicts: # midware/midware/midware.c
parents
5880d2e5
e3f9bf9d
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
477 additions
and
234 deletions
+477
-234
application/klansdk/kk_findccu_handle.c
application/klansdk/kk_findccu_handle.c
+1
-1
application/klansdk/kk_lan_main.c
application/klansdk/kk_lan_main.c
+0
-21
application/klansdk/kk_lan_sync.c
application/klansdk/kk_lan_sync.c
+2
-5
midware/midware/dm/kk_dm_msg.h
midware/midware/dm/kk_dm_msg.h
+2
-0
midware/midware/dm/kk_linkkit.c
midware/midware/dm/kk_linkkit.c
+29
-0
midware/midware/dm/kk_property_get_handle.c
midware/midware/dm/kk_property_get_handle.c
+4
-4
midware/midware/dm/kk_sub_db.c
midware/midware/dm/kk_sub_db.c
+13
-0
midware/midware/dm/kk_sync_data.c
midware/midware/dm/kk_sync_data.c
+4
-8
midware/midware/midware.c
midware/midware/midware.c
+21
-0
midware/midware/scene/kk_scene_handle.c
midware/midware/scene/kk_scene_handle.c
+22
-5
nx5_soc_gw/smarthome_z3gw_a133
nx5_soc_gw/smarthome_z3gw_a133
+0
-0
opcodeMapCfg/device_3137.json
opcodeMapCfg/device_3137.json
+1
-1
opcodeMapCfg/device_3172.json
opcodeMapCfg/device_3172.json
+1
-1
tsl/product_3028.json
tsl/product_3028.json
+133
-1
tsl/product_3043.json
tsl/product_3043.json
+235
-180
tsl/product_3062.json
tsl/product_3062.json
+3
-1
tsl/product_3108.json
tsl/product_3108.json
+6
-6
No files found.
application/klansdk/kk_findccu_handle.c
View file @
fdcba0f7
...
@@ -94,7 +94,7 @@ void *kk_findccu_handle(void *data)
...
@@ -94,7 +94,7 @@ void *kk_findccu_handle(void *data)
WARNING_PRINT
(
"read error....
\n
"
);
WARNING_PRINT
(
"read error....
\n
"
);
}
else
{
}
else
{
DEBUG_PRINT
(
"findccu recmsg: %s
\n
"
,
recvline
);
DEBUG_PRINT
(
"findccu recmsg: %s
\n
"
,
recvline
);
DEBUG_PRINT
(
"findccu frome
ip: %s
\n
"
,
inet_ntoa
(
presaddr
.
sin_addr
));
WARNING_PRINT
(
"findccu from
ip: %s
\n
"
,
inet_ntoa
(
presaddr
.
sin_addr
));
pStart
=
strstr
(
recvline
,
"!"
);
pStart
=
strstr
(
recvline
,
"!"
);
pEnd
=
strstr
(
recvline
,
"$"
);
pEnd
=
strstr
(
recvline
,
"$"
);
...
...
application/klansdk/kk_lan_main.c
View file @
fdcba0f7
...
@@ -208,32 +208,11 @@ int main(int argc, char* argv[])
...
@@ -208,32 +208,11 @@ int main(int argc, char* argv[])
int
ret
=
0
;
int
ret
=
0
;
struct
sigaction
sa
;
struct
sigaction
sa
;
//#ifdef CONFIG_8197_PLATFORM
signal
(
SIGPIPE
,
SIG_IGN
);
signal
(
SIGPIPE
,
SIG_IGN
);
signal
(
SIGALRM
,
SIG_IGN
);
signal
(
SIGALRM
,
SIG_IGN
);
signal
(
SIGSTOP
,
SIG_IGN
);
signal
(
SIGSTOP
,
SIG_IGN
);
//#else
/* setup alarm signal handler */
//#ifdef CONFIG_NX5_PLATFORM
//for(int i=1;i<32;i++){
//signal(i, handler);
//}
//#endif
//#endif
//signal(SIGPIPE, SIG_IGN);
openlog
(
"kk_lan"
,
LOG_CONS
|
LOG_PID
,
LOG_USER
);
openlog
(
"kk_lan"
,
LOG_CONS
|
LOG_PID
,
LOG_USER
);
//if(prg_run_singleton(argv[0])<0){
//debug_log(LOG_CRITICAL_LEVEL,"[%s]run singleton fail!\n",argv[0]);
//return -1;
//}
kk_lan_pid_init
();
kk_lan_pid_init
();
kk_lan_ccuid_init
();
kk_lan_ccuid_init
();
...
...
application/klansdk/kk_lan_sync.c
View file @
fdcba0f7
...
@@ -1508,16 +1508,13 @@ int kk_create_syncinfo_to_sdk(cJSON *payload,int push)
...
@@ -1508,16 +1508,13 @@ int kk_create_syncinfo_to_sdk(cJSON *payload,int push)
cJSON_AddItemToObject
(
root
,
"air_box_devices"
,
air_box_devices
);
cJSON_AddItemToObject
(
root
,
"air_box_devices"
,
air_box_devices
);
alarms
=
cJSON_CreateArray
();
alarms
=
cJSON_CreateArray
();
cJSON_AddItemToObject
(
root
,
"alarms"
,
alarms
);
cJSON_AddItemToObject
(
root
,
"alarms"
,
alarms
);
cJSON
*
shortcut_panel_configs
=
cJSON_CreateArray
();
cJSON_AddItemToObject
(
root
,
"shortcut_panel_configs"
,
shortcut_panel_configs
);
ccu_link_status
=
cJSON_CreateObject
();
ccu_link_status
=
cJSON_CreateObject
();
link_arg
=
cJSON_CreateObject
();
link_arg
=
cJSON_CreateObject
();
cJSON_AddItemToObject
(
ccu_link_status
,
"link_arg"
,
link_arg
);
cJSON_AddItemToObject
(
ccu_link_status
,
"link_arg"
,
link_arg
);
cJSON_AddStringToObject
(
ccu_link_status
,
"link_type"
,
"broadband_net"
);
cJSON_AddStringToObject
(
ccu_link_status
,
"link_type"
,
"broadband_net"
);
cJSON_AddItemToObject
(
root
,
"ccu_link_status"
,
ccu_link_status
);
cJSON_AddItemToObject
(
root
,
"ccu_link_status"
,
ccu_link_status
);
printf
(
"[%s][%d]
\n
"
,
__FUNCTION__
,
__LINE__
);
cnwise_music_controllers
=
cJSON_CreateArray
();
cnwise_music_controllers
=
cJSON_CreateArray
();
cJSON_AddItemToObject
(
root
,
"cnwise_music_controllers"
,
cnwise_music_controllers
);
cJSON_AddItemToObject
(
root
,
"cnwise_music_controllers"
,
cnwise_music_controllers
);
code_lib_controllers
=
cJSON_CreateArray
();
code_lib_controllers
=
cJSON_CreateArray
();
...
...
midware/midware/dm/kk_dm_msg.h
View file @
fdcba0f7
...
@@ -85,6 +85,8 @@ typedef struct {
...
@@ -85,6 +85,8 @@ typedef struct {
#define KK_THING_SERVICE_ADDSCENC_REPLY "/thing/service/addScene_reply"
#define KK_THING_SERVICE_ADDSCENC_REPLY "/thing/service/addScene_reply"
#define KK_THING_SERVICE_DELETESCENC "/thing/service/deleteScene"
#define KK_THING_SERVICE_DELETESCENC "/thing/service/deleteScene"
#define KK_THING_SERVICE_DELETESCENC_REPLY "/thing/service/deleteScene_reply"
#define KK_THING_SERVICE_DELETESCENC_REPLY "/thing/service/deleteScene_reply"
#define KK_THING_SERVICE_ENABLESCENC "/thing/service/enableScene"
#define KK_THING_SERVICE_ENABLESCENC_REPLY "/thing/service/enableScene_reply"
#define KK_THING_SERVICE_UPDATESCENC "/thing/service/updateScene"
#define KK_THING_SERVICE_UPDATESCENC "/thing/service/updateScene"
#define KK_THING_SERVICE_UPDATESCENC_REPLY "/thing/service/updateScene_reply"
#define KK_THING_SERVICE_UPDATESCENC_REPLY "/thing/service/updateScene_reply"
#define KK_THING_SERVICE_PROPERTY_GET_REPLY "/thing/service/property/get_reply"
#define KK_THING_SERVICE_PROPERTY_GET_REPLY "/thing/service/property/get_reply"
...
...
midware/midware/dm/kk_linkkit.c
View file @
fdcba0f7
...
@@ -1453,6 +1453,28 @@ static int kk_service_updateScene_handle(cJSON *param,cJSON *msgId)
...
@@ -1453,6 +1453,28 @@ static int kk_service_updateScene_handle(cJSON *param,cJSON *msgId)
return
res
;
return
res
;
}
}
/************************************************************
/************************************************************
*功能描述:使能场景处理
*输入参数:params:云端下发数据,包含场景名称,场景类型,场景使能,场景Id等
msgId:消息Id
*输出参数:无
*返 回 值: 0:成功;其他:失败
*其他说明:
*************************************************************/
static
int
kk_service_enableScene_handle
(
cJSON
*
param
,
cJSON
*
msgId
)
{
int
res
=
0
;
kk_tsl_t
*
pSceneShadow
=
NULL
;
if
(
param
==
NULL
||
msgId
==
NULL
){
return
INVALID_PARAMETER
;
}
cJSON
*
sceneId
=
cJSON_GetObjectItem
(
param
,
MSG_SCENE_SCENEID
);
if
(
sceneId
==
NULL
)
return
FAIL_RETURN
;
cJSON
*
enable
=
cJSON_GetObjectItem
(
param
,
MSG_SCENE_ENABLE
);
if
(
enable
==
NULL
)
return
FAIL_RETURN
;
kk_scene_update_scene_enable
(
enable
->
valueint
,
sceneId
->
valuestring
);
return
res
;
}
/************************************************************
*功能描述:删除场景处理
*功能描述:删除场景处理
*输入参数:params:云端下发数据,包含场景Id等
*输入参数:params:云端下发数据,包含场景Id等
msgId:消息Id
msgId:消息Id
...
@@ -2104,6 +2126,13 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
...
@@ -2104,6 +2126,13 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *data)
kk_service_updateScene_handle
(
paramStr
,
msgId
);
kk_service_updateScene_handle
(
paramStr
,
msgId
);
kk_service_common_reply
(
info_root
,
msgId
,
KK_THING_SERVICE_UPDATESCENC_REPLY
);
kk_service_common_reply
(
info_root
,
msgId
,
KK_THING_SERVICE_UPDATESCENC_REPLY
);
}
}
else
if
(
strcmp
(
typeJson
->
valuestring
,
KK_THING_SERVICE_ENABLESCENC
)
==
0
){
INFO_PRINT
(
" enable scene
\n
"
);
cJSON
*
paramStr
=
cJSON_GetObjectItem
(
payload
,
MSG_PARAMS_STR
);
cJSON
*
msgId
=
cJSON_GetObjectItem
(
payload
,
MSG_COMMON_MSGID
);
kk_service_enableScene_handle
(
paramStr
,
msgId
);
kk_service_common_reply
(
info_root
,
msgId
,
KK_THING_SERVICE_ENABLESCENC_REPLY
);
}
else
if
(
strcmp
(
typeJson
->
valuestring
,
KK_THING_SERVICE_DELETESCENC
)
==
0
){
else
if
(
strcmp
(
typeJson
->
valuestring
,
KK_THING_SERVICE_DELETESCENC
)
==
0
){
INFO_PRINT
(
"delete scene
\n
"
);
INFO_PRINT
(
"delete scene
\n
"
);
cJSON
*
paramStr
=
cJSON_GetObjectItem
(
payload
,
MSG_PARAMS_STR
);
cJSON
*
paramStr
=
cJSON_GetObjectItem
(
payload
,
MSG_PARAMS_STR
);
...
...
midware/midware/dm/kk_property_get_handle.c
View file @
fdcba0f7
...
@@ -51,7 +51,7 @@ static int kk_service_get_reply(char *deviceCode,char *productCode,char *msgId,d
...
@@ -51,7 +51,7 @@ static int kk_service_get_reply(char *deviceCode,char *productCode,char *msgId,d
cJSON_AddNumberToObject
(
paramInfo
,
"data"
,
(
double
)
param1
);
cJSON_AddNumberToObject
(
paramInfo
,
"data"
,
(
double
)
param1
);
}
else
if
(
strcmp
(
type
,
"ChildLockState"
)
==
0
){
}
else
if
(
strcmp
(
type
,
"ChildLockState"
)
==
0
){
cJSON_AddNumberToObject
(
paramInfo
,
"ChildLockState"
,
(
int
)
param1
);
cJSON_AddNumberToObject
(
paramInfo
,
"ChildLockState"
,
(
int
)
param1
);
}
else
if
(
strcmp
(
type
,
"Power
DownSave
"
)
==
0
){
}
else
if
(
strcmp
(
type
,
"Power
Memory
"
)
==
0
){
cJSON_AddNumberToObject
(
paramInfo
,
"PowerMemory"
,
(
int
)
param1
);
cJSON_AddNumberToObject
(
paramInfo
,
"PowerMemory"
,
(
int
)
param1
);
cJSON_AddNumberToObject
(
paramInfo
,
"Mode"
,
(
int
)
1
);
cJSON_AddNumberToObject
(
paramInfo
,
"Mode"
,
(
int
)
1
);
}
else
if
(
strcmp
(
type
,
"Screensaver"
)
==
0
){
}
else
if
(
strcmp
(
type
,
"Screensaver"
)
==
0
){
...
@@ -351,12 +351,12 @@ static int kk_property_WaterValveArgs_handle(char *deviceCode,int epNum,char *ms
...
@@ -351,12 +351,12 @@ static int kk_property_WaterValveArgs_handle(char *deviceCode,int epNum,char *ms
mutiDev
=
kk_check_muti_device
(
node
);
mutiDev
=
kk_check_muti_device
(
node
);
if
(
mutiDev
){
if
(
mutiDev
){
memset
(
propertiesTmp
,
0x0
,
sizeof
(
propertiesTmp
));
memset
(
propertiesTmp
,
0x0
,
sizeof
(
propertiesTmp
));
sprintf
(
propertiesTmp
,
"Power
DownSave
_%d"
,
epNum
);
sprintf
(
propertiesTmp
,
"Power
Memory
_%d"
,
epNum
);
kk_property_db_get_value
(
deviceCode
,
propertiesTmp
,
&
PowerDownSave
);
kk_property_db_get_value
(
deviceCode
,
propertiesTmp
,
&
PowerDownSave
);
}
else
{
}
else
{
kk_property_db_get_value
(
deviceCode
,
"Power
DownSave
"
,
&
PowerDownSave
);
kk_property_db_get_value
(
deviceCode
,
"Power
Memory
"
,
&
PowerDownSave
);
}
}
kk_service_get_reply
(
deviceCode
,
node
->
productCode
,
msgid
,
PowerDownSave
,
1
,
-
1
,
epNum
,
"Power
DownSave
"
);
kk_service_get_reply
(
deviceCode
,
node
->
productCode
,
msgid
,
PowerDownSave
,
1
,
-
1
,
epNum
,
"Power
Memory
"
);
return
SUCCESS_RETURN
;
return
SUCCESS_RETURN
;
}
}
static
int
kk_property_Screensaver_handle
(
char
*
deviceCode
,
int
epNum
,
char
*
msgid
)
static
int
kk_property_Screensaver_handle
(
char
*
deviceCode
,
int
epNum
,
char
*
msgid
)
...
...
midware/midware/dm/kk_sub_db.c
View file @
fdcba0f7
...
@@ -712,6 +712,7 @@ static int _kk_air_switch_handle(char* deviceCode, char *sceneId, char *property
...
@@ -712,6 +712,7 @@ static int _kk_air_switch_handle(char* deviceCode, char *sceneId, char *property
int
kk_subDev_set_action_by_productType
(
const
char
*
productType
,
const
char
*
roomId
,
const
char
*
sceneId
,
const
char
*
propertyName
,
const
char
*
propertyValue
,
const
char
*
type
,
int
delay
)
int
kk_subDev_set_action_by_productType
(
const
char
*
productType
,
const
char
*
roomId
,
const
char
*
sceneId
,
const
char
*
propertyName
,
const
char
*
propertyValue
,
const
char
*
type
,
int
delay
)
{
{
int
res
=
0
;
int
res
=
0
;
int
devIsExsit
=
0
;
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
char
*
sqlCmd
=
NULL
;
char
*
sqlCmd
=
NULL
;
char
*
pDeviceCode
=
NULL
;
char
*
pDeviceCode
=
NULL
;
...
@@ -747,8 +748,10 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
...
@@ -747,8 +748,10 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
INFO_PRINT
(
"typeArray[k]:%s
\n
"
,
typeArray
[
k
]);
INFO_PRINT
(
"typeArray[k]:%s
\n
"
,
typeArray
[
k
]);
sqlCmd
=
sqlite3_mprintf
(
searchCmd
,
typeArray
[
k
]);
//curtain type
sqlCmd
=
sqlite3_mprintf
(
searchCmd
,
typeArray
[
k
]);
//curtain type
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
devIsExsit
=
0
;
//INFO_PRINT("total_column = %d\n", sqlite3_column_count(stmt));
//INFO_PRINT("total_column = %d\n", sqlite3_column_count(stmt));
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
pDeviceCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_DEVICECODE
);
pDeviceCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_DEVICECODE
);
res
=
dm_mgr_get_device_by_devicecode
(
pDeviceCode
,
&
node
);
res
=
dm_mgr_get_device_by_devicecode
(
pDeviceCode
,
&
node
);
if
(
res
!=
SUCCESS_RETURN
)
{
if
(
res
!=
SUCCESS_RETURN
)
{
...
@@ -804,6 +807,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
...
@@ -804,6 +807,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
continue
;
continue
;
}
}
info
.
delay
=
delay
;
info
.
delay
=
delay
;
devIsExsit
=
1
;
kk_scene_action_add
(
node
->
fatherDeviceCode
,
sceneId
,
info
);
kk_scene_action_add
(
node
->
fatherDeviceCode
,
sceneId
,
info
);
res
=
kk_scene_insert_scene_action
(
type
,
node
->
deviceCode
,
info
.
epNum
,
res
=
kk_scene_insert_scene_action
(
type
,
node
->
deviceCode
,
info
.
epNum
,
property
->
identifier
,
propertyValue
,
info
.
delay
,
sceneId
,
node
->
fatherDeviceCode
);
property
->
identifier
,
propertyValue
,
info
.
delay
,
sceneId
,
node
->
fatherDeviceCode
);
...
@@ -815,6 +819,15 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
...
@@ -815,6 +819,15 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *room
}
}
}
}
}
}
if
(
devIsExsit
==
0
){
//设置场景,但是又没有对应的设备需要插入一条无效action用于记录propertyName,同步需要
res
=
kk_scene_insert_scene_action
(
type
,
""
,
1
,
propertyName
,
propertyValue
,
delay
,
sceneId
,
""
);
if
(
res
!=
SUCCESS_RETURN
){
INFO_PRINT
(
"kk_subDev_set_action_by_productType fail!!!
\n
"
);
//return res;
continue
;
}
}
sqlite3_finalize
(
stmt
);
sqlite3_finalize
(
stmt
);
sqlite3_free
(
sqlCmd
);
sqlite3_free
(
sqlCmd
);
}
}
...
...
midware/midware/dm/kk_sync_data.c
View file @
fdcba0f7
...
@@ -482,12 +482,12 @@ static cJSON *kk_get_indoor_properties_info(char *deviceCode)
...
@@ -482,12 +482,12 @@ static cJSON *kk_get_indoor_properties_info(char *deviceCode)
}
}
}
}
cJSON_AddItemToArray
(
eps
,
propertyItem
);
cJSON_AddItemToArray
(
eps
,
propertyItem
);
sqlite3_free
(
sqlCmd
);
sqlite3_finalize
(
stmt
);
}
}
cJSON_AddItemToObject
(
obj
,
"eps"
,
eps
);
cJSON_AddItemToObject
(
obj
,
"eps"
,
eps
);
cJSON_AddNumberToObject
(
obj
,
"EpTotal"
,
count
);
cJSON_AddNumberToObject
(
obj
,
"EpTotal"
,
count
);
cJSON_AddNumberToObject
(
obj
,
"CombineDeviceFlag"
,
1
);
cJSON_AddNumberToObject
(
obj
,
"CombineDeviceFlag"
,
1
);
sqlite3_free
(
sqlCmd
);
sqlite3_finalize
(
stmt
);
return
obj
;
return
obj
;
}
}
static
cJSON
*
kk_get_subfreshair_properties_info
(
char
*
deviceCode
)
static
cJSON
*
kk_get_subfreshair_properties_info
(
char
*
deviceCode
)
...
@@ -675,15 +675,13 @@ static int kk_get_panelConfig_info(cJSON *decvies,char *deviceCode)
...
@@ -675,15 +675,13 @@ static int kk_get_panelConfig_info(cJSON *decvies,char *deviceCode)
}
}
cJSON
*
panelConfig
=
NULL
;
cJSON
*
panelConfig
=
NULL
;
sqlCmd
=
sqlite3_mprintf
(
"select * from QuickPanelScene WHERE deviceCode = '%s' "
,
deviceCode
);
sqlCmd
=
sqlite3_mprintf
(
"select * from QuickPanelScene WHERE deviceCode = '%s' "
,
deviceCode
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
if
(
mFlag
==
0
){
if
(
mFlag
==
0
){
mFlag
=
1
;
mFlag
=
1
;
panelConfig
=
cJSON_CreateArray
();
panelConfig
=
cJSON_CreateArray
();
}
}
cJSON
*
item
=
cJSON_CreateObject
();
cJSON
*
item
=
cJSON_CreateObject
();
cJSON
*
action
=
cJSON_CreateObject
();
cJSON
*
action
=
cJSON_CreateObject
();
...
@@ -706,7 +704,6 @@ static int kk_get_panelConfig_info(cJSON *decvies,char *deviceCode)
...
@@ -706,7 +704,6 @@ static int kk_get_panelConfig_info(cJSON *decvies,char *deviceCode)
cJSON_AddStringToObject
(
item
,
"buttonId"
,
buttonId
);
cJSON_AddStringToObject
(
item
,
"buttonId"
,
buttonId
);
cJSON_AddItemToArray
(
panelConfig
,
item
);
cJSON_AddItemToArray
(
panelConfig
,
item
);
}
}
if
(
mFlag
==
1
){
if
(
mFlag
==
1
){
cJSON_AddItemToObject
(
decvies
,
"panelConfig"
,
panelConfig
);
cJSON_AddItemToObject
(
decvies
,
"panelConfig"
,
panelConfig
);
}
}
...
@@ -770,14 +767,13 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
...
@@ -770,14 +767,13 @@ static int kk_get_sub_devices_info(cJSON *gwdevicesItem,char *deviceCode)
subProductCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_PRODUCTCODE
);
subProductCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_PRODUCTCODE
);
subVersion
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_VERSION
);
subVersion
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_VERSION
);
subIsline
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_ONLINE
);
subIsline
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_ONLINE
);
subproductType
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_PRODUCTTYPE
);
subproductType
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SUB_PRODUCTTYPE
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_DEVICECODE_STR
,
subDeviceCode
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_DEVICECODE_STR
,
subDeviceCode
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_VERSION_STR
,
subVersion
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_VERSION_STR
,
subVersion
);
_kk_deviceCode_switchto_mac
(
subDeviceCode
,
macaddr
);
_kk_deviceCode_switchto_mac
(
subDeviceCode
,
macaddr
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_MAC_STR
,
macaddr
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_MAC_STR
,
macaddr
);
cJSON_AddNumberToObject
(
subdevicesItem
,
KK_SYNC_ONLINE_STR
,
(
strcmp
(
subIsline
,
"0"
)
==
0
)
?
1
:
0
);
cJSON_AddNumberToObject
(
subdevicesItem
,
KK_SYNC_ONLINE_STR
,
(
strcmp
(
subIsline
,
"0"
)
==
0
)
?
1
:
0
);
kk_get_panelConfig_info
(
subdevicesItem
,
subDeviceCode
);
kk_get_panelConfig_info
(
subdevicesItem
,
subDeviceCode
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_PRODUCTCODE_STR
,
subProductCode
);
cJSON_AddStringToObject
(
subdevicesItem
,
KK_SYNC_PRODUCTCODE_STR
,
subProductCode
);
...
...
midware/midware/midware.c
View file @
fdcba0f7
...
@@ -1200,6 +1200,27 @@ static int kk_subDevice_property_handle(cJSON *info,cJSON *payload,char *deviceC
...
@@ -1200,6 +1200,27 @@ static int kk_subDevice_property_handle(cJSON *info,cJSON *payload,char *deviceC
free
(
infff
);
free
(
infff
);
return
0
;
return
0
;
}
}
<<<<<<<
midware
/
midware
/
midware
.
c
=======
static
int
_kk_subDevice_online_to_app
(
cJSON
*
info
,
cJSON
*
payload
)
{
char
ccuid
[
32
]
=
{
0
};
HAL_Get_ccuid
(
ccuid
);
cJSON
*
param
=
cJSON_GetObjectItem
(
payload
,
"params"
);
if
(
param
==
NULL
){
return
-
1
;
}
cJSON_AddStringToObject
(
param
,
"ccuCode"
,
ccuid
);
char
*
payload11
=
cJSON_Print
(
payload
);
char
*
infff
=
cJSON_Print
(
info
);
printf
(
"------------------------payload11:%s
\n
"
,
payload11
);
printf
(
"------------------------infff:%s
\n
"
,
infff
);
kk_sendData2app
(
infff
,
payload11
,
0
);
free
(
payload11
);
free
(
infff
);
return
0
;
}
>>>>>>>
midware
/
midware
/
midware
.
c
static
int
kk_indoorAir_online_handle
(
dm_mgr_dev_node_t
*
node
,
char
*
deviceCode
,
int
epNum
)
static
int
kk_indoorAir_online_handle
(
dm_mgr_dev_node_t
*
node
,
char
*
deviceCode
,
int
epNum
)
{
{
int
idx
=
0
;
int
idx
=
0
;
...
...
midware/midware/scene/kk_scene_handle.c
View file @
fdcba0f7
...
@@ -533,12 +533,12 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
...
@@ -533,12 +533,12 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYNAME
,
ptr
->
actionInfo
->
info
.
propertyName
);
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYNAME
,
ptr
->
actionInfo
->
info
.
propertyName
);
if
(
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"{"
)
!=
NULL
&&
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"}"
)
!=
NULL
){
if
(
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"{"
)
!=
NULL
&&
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"}"
)
!=
NULL
){
prtyObj
=
cJSON_Parse
(
ptr
->
actionInfo
->
info
.
propertyValue
);
//
prtyObj = cJSON_Parse(ptr->actionInfo->info.propertyValue);
if
(
prtyObj
!=
NULL
){
//
if(prtyObj != NULL){
cJSON_AddItemToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
prtyObj
);
//
cJSON_AddItemToObject(info, MSG_SCENE_PROPERTYVALUE, prtyObj);
}
else
{
//
}else{
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
}
//
}
}
else
{
}
else
{
//开启/关闭取反操作
//开启/关闭取反操作
if
(
strcmp
(
ptr
->
actionInfo
->
info
.
propertyName
,
"PowerSwitch"
)
==
0
&&
strcmp
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"2"
)
==
0
){
if
(
strcmp
(
ptr
->
actionInfo
->
info
.
propertyName
,
"PowerSwitch"
)
==
0
&&
strcmp
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"2"
)
==
0
){
...
@@ -1261,6 +1261,23 @@ static int _kk_scene_LightStripSpecialAction_handle(cJSON* propertyValue,char *d
...
@@ -1261,6 +1261,23 @@ static int _kk_scene_LightStripSpecialAction_handle(cJSON* propertyValue,char *d
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
}
}
memset
(
&
info
,
0x0
,
sizeof
(
kk_scene_action_detail_t
));
memset
(
&
info
,
0x0
,
sizeof
(
kk_scene_action_detail_t
));
cJSON
*
WhiteBrightness
=
cJSON_GetObjectItem
(
propertyValue
,
"WhiteBrightness"
);
if
(
WhiteBrightness
!=
NULL
&&
WhiteBrightness
->
type
==
cJSON_Number
){
sprintf
(
info
.
propertyValue
,
"%d"
,
WhiteBrightness
->
valueint
);
memcpy
(
info
.
propertyName
,
"WhiteBrightness"
,
strlen
(
"WhiteBrightness"
));
memcpy
(
info
.
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
info
.
epNum
=
ep
;
info
.
delay
=
idelay
;
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
}
else
if
(
WhiteBrightness
!=
NULL
&&
WhiteBrightness
->
type
==
cJSON_String
){
memcpy
(
info
.
propertyValue
,
WhiteBrightness
->
valuestring
,
strlen
(
WhiteBrightness
->
valuestring
));
memcpy
(
info
.
propertyName
,
"WhiteBrightness"
,
strlen
(
"WhiteBrightness"
));
memcpy
(
info
.
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
info
.
epNum
=
ep
;
info
.
delay
=
idelay
;
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
}
memset
(
&
info
,
0x0
,
sizeof
(
kk_scene_action_detail_t
));
cJSON
*
RGBColor
=
cJSON_GetObjectItem
(
propertyValue
,
"RGBColor"
);
cJSON
*
RGBColor
=
cJSON_GetObjectItem
(
propertyValue
,
"RGBColor"
);
if
(
RGBColor
!=
NULL
&&
RGBColor
->
type
==
cJSON_String
){
//"RGBColor":"[115,114,253]"
if
(
RGBColor
!=
NULL
&&
RGBColor
->
type
==
cJSON_String
){
//"RGBColor":"[115,114,253]"
cJSON
*
rgb
=
cJSON_CreateObject
();
cJSON
*
rgb
=
cJSON_CreateObject
();
...
...
nx5_soc_gw/smarthome_z3gw_a133
View file @
fdcba0f7
No preview for this file type
opcodeMapCfg/device_3137.json
View file @
fdcba0f7
{
{
"productCode"
:
"3137"
,
"productCode"
:
"3137"
,
"operateType"
:
"51
4
"
,
"operateType"
:
"51
2
"
,
"channel"
:
1
,
"channel"
:
1
,
"syn_type"
:
1
,
"syn_type"
:
1
,
"syn_opcode"
:
"DIMMABLE_LIGHT_STATUS"
,
"syn_opcode"
:
"DIMMABLE_LIGHT_STATUS"
,
...
...
opcodeMapCfg/device_3172.json
View file @
fdcba0f7
{
{
"productCode"
:
"3172"
,
"productCode"
:
"3172"
,
"operateType"
:
"50
7
"
,
"operateType"
:
"50
6
"
,
"channel"
:
1
,
"channel"
:
1
,
"syn_type"
:
1
,
"syn_type"
:
1
,
"syn_opcode"
:
"DIMMABLE_LIGHT_STATUS"
,
"syn_opcode"
:
"DIMMABLE_LIGHT_STATUS"
,
...
...
tsl/product_3028.json
View file @
fdcba0f7
...
@@ -70,12 +70,57 @@
...
@@ -70,12 +70,57 @@
}
}
},
},
"name"
:
"亮度"
"name"
:
"亮度"
},
{
"identifier"
:
"FadeTime"
,
"dataType"
:
{
"type"
:
"int"
,
"specs"
:
{
"min"
:
"10"
,
"max"
:
"50"
,
"unit"
:
"1/10s"
,
"unitName"
:
"1/10秒"
,
"step"
:
"10"
}
},
"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"
,
"identifier"
:
"get"
,
"inputData"
:
[
"inputData"
:
[
"PowerSwitch"
,
"PowerSwitch"
,
"Brightness"
"Brightness"
,
"FadeTime"
,
"LowBrightness"
,
"HighBrightness"
],
],
"method"
:
"thing.service.property.get"
,
"method"
:
"thing.service.property.get"
,
"name"
:
"get"
,
"name"
:
"get"
,
...
@@ -127,6 +172,51 @@
...
@@ -127,6 +172,51 @@
"step"
:
"1"
"step"
:
"1"
}
}
}
}
},
{
"identifier"
:
"FadeTime"
,
"accessMode"
:
"rw"
,
"dataType"
:
{
"type"
:
"int"
,
"specs"
:
{
"min"
:
"10"
,
"max"
:
"50"
,
"unit"
:
"1/10s"
,
"unitName"
:
"1/10秒"
,
"step"
:
"10"
}
},
"name"
:
"渐变时间"
},
{
"identifier"
:
"LowBrightness"
,
"accessMode"
:
"rw"
,
"dataType"
:
{
"type"
:
"int"
,
"specs"
:
{
"min"
:
"10"
,
"max"
:
"90"
,
"unit"
:
"%"
,
"unitName"
:
"百分比"
,
"step"
:
"1"
}
},
"name"
:
"最低亮度"
},
{
"identifier"
:
"HighBrightness"
,
"accessMode"
:
"rw"
,
"dataType"
:
{
"type"
:
"int"
,
"specs"
:
{
"min"
:
"20"
,
"max"
:
"100"
,
"unit"
:
"%"
,
"unitName"
:
"百分比"
,
"step"
:
"1"
}
},
"name"
:
"最高亮度"
}
}
],
],
"events"
:
[
"events"
:
[
...
@@ -156,6 +246,48 @@
...
@@ -156,6 +246,48 @@
}
}
},
},
"name"
:
"亮度"
"name"
:
"亮度"
},
{
"identifier"
:
"FadeTime"
,
"dataType"
:
{
"type"
:
"int"
,
"specs"
:
{
"min"
:
"10"
,
"max"
:
"50"
,
"unit"
:
"1/10s"
,
"unitName"
:
"1/10秒"
,
"step"
:
"10"
}
},
"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"
,
"identifier"
:
"property"
,
...
...
tsl/product_3043.json
View file @
fdcba0f7
This diff is collapsed.
Click to expand it.
tsl/product_3062.json
View file @
fdcba0f7
...
@@ -47,9 +47,11 @@
...
@@ -47,9 +47,11 @@
"dataType"
:
{
"dataType"
:
{
"type"
:
"enum"
,
"type"
:
"enum"
,
"specs"
:
{
"specs"
:
{
"0"
:
"自动"
,
"2"
:
"低档"
,
"2"
:
"低档"
,
"3"
:
"中档"
,
"3"
:
"中档"
,
"4"
:
"高档"
"4"
:
"高档"
,
"6"
:
"未知"
}
}
}
}
},
},
...
...
tsl/product_3108.json
View file @
fdcba0f7
{
{
"schema"
:
"https://iot-ap.ikonke.com/model/product_3108.json"
,
"schema"
:
"https://iot-ap.ikonke.com/model/product_3108.json"
,
"productType"
:
"On/Off Output"
,
"productType"
:
"On/Off Output"
,
"version"
:
"1.
0
"
,
"version"
:
"1.
1
"
,
"profile"
:
{
"profile"
:
{
"heartbeat"
:
"300"
,
"heartbeat"
:
"300"
,
"productCode"
:
"3108"
,
"productCode"
:
"3108"
,
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
"name"
:
"电源开关"
"name"
:
"电源开关"
},
},
{
{
"identifier"
:
"Power
DownSave
"
,
"identifier"
:
"Power
Memory
"
,
"dataType"
:
{
"dataType"
:
{
"specs"
:
{
"specs"
:
{
"0"
:
"关闭"
,
"0"
:
"关闭"
,
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
"name"
:
"电源开关"
"name"
:
"电源开关"
},
},
{
{
"identifier"
:
"Power
DownSave
"
,
"identifier"
:
"Power
Memory
"
,
"dataType"
:
{
"dataType"
:
{
"specs"
:
{
"specs"
:
{
"0"
:
"关闭"
,
"0"
:
"关闭"
,
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
"identifier"
:
"get"
,
"identifier"
:
"get"
,
"inputData"
:
[
"inputData"
:
[
"PowerSwitch"
,
"PowerSwitch"
,
"Power
DownSave
"
"Power
Memory
"
],
],
"method"
:
"thing.service.property.get"
,
"method"
:
"thing.service.property.get"
,
"name"
:
"get"
,
"name"
:
"get"
,
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
"required"
:
true
"required"
:
true
},
},
{
{
"identifier"
:
"Power
DownSave
"
,
"identifier"
:
"Power
Memory
"
,
"dataType"
:
{
"dataType"
:
{
"specs"
:
{
"specs"
:
{
"0"
:
"关闭"
,
"0"
:
"关闭"
,
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
"name"
:
"电源开关"
"name"
:
"电源开关"
},
},
{
{
"identifier"
:
"Power
DownSave
"
,
"identifier"
:
"Power
Memory
"
,
"dataType"
:
{
"dataType"
:
{
"specs"
:
{
"specs"
:
{
"0"
:
"关闭"
,
"0"
:
"关闭"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment