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
1699fe75
Commit
1699fe75
authored
Aug 26, 2020
by
黄振令
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】1.解决设备上报格式错误
【提交人】huang.zhenling
parent
bbbee50e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
616 additions
and
612 deletions
+616
-612
platform/zigbee/app/builder/Z3GatewayHost/kk_test.c
platform/zigbee/app/builder/Z3GatewayHost/kk_test.c
+7
-5
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
+2
-2
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
...p/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
+2
-2
platform/zigbee/protocol/zigbee/app/framework/plugin/device-table/device-table.c
...l/zigbee/app/framework/plugin/device-table/device-table.c
+605
-603
No files found.
platform/zigbee/app/builder/Z3GatewayHost/kk_test.c
View file @
1699fe75
...
@@ -7,13 +7,15 @@ extern kk_tsl_zigbee_map_t g_tsl_zigbee_map [];
...
@@ -7,13 +7,15 @@ extern kk_tsl_zigbee_map_t g_tsl_zigbee_map [];
static
void
kk_rpc_send_message
(
cJSON
*
data
,
char
*
msgtype
,
char
*
method
,
EmberEUI64
mac
)
static
void
kk_rpc_send_message
(
cJSON
*
data
,
char
*
msgtype
,
char
*
method
,
EmberEUI64
mac
)
{
{
static
uint16_t
msgid
;
static
uint16_t
msgid
;
char
msgIdString
[
10
];
char
msgIdString
[
10
]
=
{
0
};
char
macString
[
19
]
=
{
0
};
cJSON
*
info
=
rpc_cJSON_CreateObject
();
cJSON
*
info
=
rpc_cJSON_CreateObject
();
if
(
info
!=
NULL
){
if
(
info
!=
NULL
){
rpc_cJSON_AddStringToObject
(
info
,
"msgType"
,
msgtype
);
rpc_cJSON_AddStringToObject
(
info
,
"msgType"
,
msgtype
);
rpc_cJSON_AddStringToObject
(
info
,
"productCode"
,
""
);
rpc_cJSON_AddStringToObject
(
info
,
"productCode"
,
"24"
);
rpc_cJSON_AddStringToObject
(
info
,
"deviceCode"
,
""
);
rpc_eui64ToString
(
mac
,
macString
);
rpc_cJSON_AddStringToObject
(
info
,
"deviceCode"
,
macString
);
}
}
cJSON
*
payload
=
rpc_cJSON_CreateObject
();
cJSON
*
payload
=
rpc_cJSON_CreateObject
();
if
(
payload
!=
NULL
){
if
(
payload
!=
NULL
){
...
@@ -64,8 +66,8 @@ void kk_rpc_reportDevices(kk_report_device_s device)
...
@@ -64,8 +66,8 @@ void kk_rpc_reportDevices(kk_report_device_s device)
rpc_cJSON_AddAppVersionToObject
(
devicesJson
,
device
.
AppVersion
);
rpc_cJSON_AddAppVersionToObject
(
devicesJson
,
device
.
AppVersion
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"deviceType"
,
"1"
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"deviceType"
,
"1"
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"deviceCode"
,
"2"
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"deviceCode"
,
"2"
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"productType"
,
TEST_PRODUCT_CODE
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"productType"
,
"3"
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"productCode"
,
"4"
);
rpc_cJSON_AddStringToObject
(
devicesJson
,
"productCode"
,
TEST_PRODUCT_CODE
);
kk_sub_tsl_add
(
device
.
mac
,
TEST_PRODUCT_CODE
);
kk_sub_tsl_add
(
device
.
mac
,
TEST_PRODUCT_CODE
);
kk_rpc_report_devices
(
devicesJson
,
device
.
mac
);
kk_rpc_report_devices
(
devicesJson
,
device
.
mac
);
}
}
...
...
platform/zigbee/app/builder/Z3GatewayHost/kk_test.h
View file @
1699fe75
...
@@ -6,12 +6,12 @@
...
@@ -6,12 +6,12 @@
#include "RPC_API.h"
#include "RPC_API.h"
#define KK_REPORT_DEVICE_JOINED_TYPE "/thing/topo/add"
#define KK_REPORT_DEVICE_JOINED_TYPE "/thing/topo/add"
#define KK_REPORT_ATTRIBUTE_TYPE "/thing/
service/property/repor
t"
#define KK_REPORT_ATTRIBUTE_TYPE "/thing/
event/property/pos
t"
#define KK_IPC_VERSION "1.0"
#define KK_IPC_VERSION "1.0"
#define KK_REPORT_DEVICE_JOINED_METHOD "thing.topo.add"
#define KK_REPORT_DEVICE_JOINED_METHOD "thing.topo.add"
#define KK_REPORT_DEVICE_LEAVE_METHOD "thing.topo.leave"
#define KK_REPORT_DEVICE_LEAVE_METHOD "thing.topo.leave"
#define KK_REPORT_ATTRIBUTE_METHOD "thing.
service.property.repor
t"
#define KK_REPORT_ATTRIBUTE_METHOD "thing.
event.property.pos
t"
#define KK_READ_ATTRIBUTE_METHOD "thing.service.property.get"
#define KK_READ_ATTRIBUTE_METHOD "thing.service.property.get"
#define TEST_PRODUCT_CODE "24"
#define TEST_PRODUCT_CODE "24"
...
...
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
View file @
1699fe75
...
@@ -346,7 +346,7 @@ int addGW_and_getIP(char* ip){
...
@@ -346,7 +346,7 @@ int addGW_and_getIP(char* ip){
close
(
sk_recv
);
close
(
sk_recv
);
return
-
1
;
return
-
1
;
}
}
printf
(
"addGW_and_getIP allan ==============
\n
"
);
char
info
[]
=
"{
\"
msgtype
\"
:
\"
/thing/topo/add
\"
,
\"
productType
\"
:
\"
gw
\"
,
\"
productCode
\"
:
\"
2
\"
,
\"
deviceCode
\"
:
\"
1122334455667788
\"
}"
;
char
info
[]
=
"{
\"
msgtype
\"
:
\"
/thing/topo/add
\"
,
\"
productType
\"
:
\"
gw
\"
,
\"
productCode
\"
:
\"
2
\"
,
\"
deviceCode
\"
:
\"
1122334455667788
\"
}"
;
char
payload
[]
=
"{
\"
msgId
\"
:
\"
1
\"
,
\"
version
\"
:
\"
1.0
\"
,
\"
params
\"
:{
\"
deviceCode
\"
:
\"
1122334455667788
\"
,
\"
productCode
\"
:
\"
2
\"
,
\"
mac
\"
:
\"
1122334455667788
\"
}}"
;
char
payload
[]
=
"{
\"
msgId
\"
:
\"
1
\"
,
\"
version
\"
:
\"
1.0
\"
,
\"
params
\"
:{
\"
deviceCode
\"
:
\"
1122334455667788
\"
,
\"
productCode
\"
:
\"
2
\"
,
\"
mac
\"
:
\"
1122334455667788
\"
}}"
;
cJSON
*
root
=
cJSON_CreateObject
();
cJSON
*
root
=
cJSON_CreateObject
();
...
@@ -356,7 +356,7 @@ int addGW_and_getIP(char* ip){
...
@@ -356,7 +356,7 @@ int addGW_and_getIP(char* ip){
cJSON_AddItemToObject
(
root
,
"payload"
,
payloadObj
);
cJSON_AddItemToObject
(
root
,
"payload"
,
payloadObj
);
char
*
outbuf
=
cJSON_Print
(
root
);
char
*
outbuf
=
cJSON_Print
(
root
);
cJSON_Delete
(
root
);
cJSON_Delete
(
root
);
printf
(
"addGW_and_getIP allan ===========111111===
\n
"
);
while
(
1
)
while
(
1
)
{
{
if
((
iSendbytes
=
sendto
(
sock
,
outbuf
,
strlen
(
outbuf
)
+
1
,
0
,
(
struct
sockaddr
*
)
&
Addrto
,
sizeof
(
struct
sockaddr
)))
==
-
1
)
if
((
iSendbytes
=
sendto
(
sock
,
outbuf
,
strlen
(
outbuf
)
+
1
,
0
,
(
struct
sockaddr
*
)
&
Addrto
,
sizeof
(
struct
sockaddr
)))
==
-
1
)
...
...
platform/zigbee/protocol/zigbee/app/framework/plugin/device-table/device-table.c
View file @
1699fe75
This diff is collapsed.
Click to expand it.
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