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
e9599f1d
Commit
e9599f1d
authored
Sep 17, 2020
by
chen.weican
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】恢复子设备删除功能
【提交人】陈伟灿
parent
e6ffee28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_set.c
...zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_set.c
+38
-0
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_set.h
...zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_set.h
+2
-0
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
+6
-2
No files found.
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_set.c
View file @
e9599f1d
...
...
@@ -5,6 +5,44 @@
//emberAfAppPrintln("[tsl report:Gloabl] OnOff~~~~~~~~~");
//cJSON *rpc_Control(jrpc_context * ctx, cJSON *params, cJSON *id,cJSON *mac)
cJSON
*
kk_topo_change_operation
(
jrpc_context
*
ctx
,
cJSON
*
params
,
cJSON
*
id
,
cJSON
*
mac
)
{
int
res
=
0
;
cJSON
*
changeTypeStr
=
NULL
;
uint8_t
eui64
[
EUI64_SIZE
];
uint16_t
nodeId
=
0
;
UTIL_LOG_INFO
(
"
\n
********************kk_topo_change_operation********************
\n
"
);
if
(
params
==
NULL
){
set_json_error_type
(
ctx
,
JRPC_INVALID_PARAMS
,
MSG_INVALID_PARAMS
);
goto
error_return
;
}
else
{
changeTypeStr
=
rpc_cJSON_GetObjectItem
(
params
,
MSG_TOPO_CHANGE_TYPE_STR
);
if
(
changeTypeStr
!=
NULL
&&
changeTypeStr
->
valueint
==
1
){
cJSON
*
deviceArray
=
rpc_cJSON_GetObjectItem
(
params
,
MSG_TOPO_CHANGE_DEVICES_STR
);
if
(
deviceArray
==
NULL
){
goto
error_return
;
}
cJSON
*
item
=
deviceArray
->
child
;
while
(
item
!=
NULL
){
char
*
deviceCode
=
rpc_cJSON_GetObjectItem
(
item
,
MSG_DEVICE_CODE_STR
)
->
valuestring
;
rpc_get_mac
(
deviceCode
,
eui64
);
nodeId
=
emberAfDeviceTableGetNodeIdFromEui64
(
eui64
);
kk_zdo_leave_request
(
nodeId
,
true
,
false
);
item
=
item
->
next
;
}
}
}
return
rpc_cJSON_CreateNumber
(
res
);
error_return:
return
rpc_cJSON_CreateNull
();
}
int
kk_tsl_utils_memtok
(
_IN_
char
*
input
,
_IN_
char
*
delimiter
,
_IN_
int
index
,
_OU_
int
*
offset
)
{
int
item_index
=
0
;
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_set.h
View file @
e9599f1d
...
...
@@ -2,6 +2,8 @@
#define __KK_TSL_PROPERTY_SET_H
#include "kk_test.h"
cJSON
*
kk_topo_change_operation
(
jrpc_context
*
ctx
,
cJSON
*
params
,
cJSON
*
id
,
cJSON
*
mac
);
cJSON
*
kk_tsl_property_operation
(
jrpc_context
*
ctx
,
cJSON
*
params
,
cJSON
*
id
,
cJSON
*
mac
);
...
...
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
View file @
e9599f1d
...
...
@@ -16,8 +16,9 @@
#define KK_REPORT_DEVICE_JOINED_TYPE "/thing/topo/add"
#define KK_REPORT_DEVICE_LEFT_TYPE "/thing/topo/delete"
#define KK_REPORT_DEVICE_LEFT_TYPE
"/thing/topo/delete"
#define KK_REPORT_ATTRIBUTE_TYPE "/thing/event/property/post"
#define KK_DEVICE_TOPO_CHANGE_TYPE "/thing/topo/change"
#define KK_IPC_VERSION "1.0"
#define KK_REPORT_DEVICE_JOINED_METHOD "thing.topo.add"
...
...
@@ -30,6 +31,8 @@
#define TEST_PRODUCT_CODE "24"
#define GW2CCU_PROTOCOL "tcp"
#define MSG_TOPO_CHANGE_TYPE_STR "changeType"
#define MSG_TOPO_CHANGE_DEVICES_STR "devices"
...
...
@@ -47,7 +50,8 @@ int kk_sendData2CCU(char* data, int len);
#define RPC_KK_TEST_FUNCTION_TABLE \
{(
rpc_function
*
)
kk_tsl_property_operation
,
"/thing/service/property/set"
},
\
{(
rpc_function
*
)
kk_tsl_property_operation
,
KK_READ_ATTRIBUTE_METHOD
}
{(
rpc_function
*
)
kk_tsl_property_operation
,
KK_READ_ATTRIBUTE_METHOD
},
\
{(
rpc_function
*
)
kk_topo_change_operation
,
KK_DEVICE_TOPO_CHANGE_TYPE
}
...
...
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