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
34eda340
Commit
34eda340
authored
Oct 22, 2020
by
尹佳钦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2020/10/22
parent
4a1ab0ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
34 deletions
+28
-34
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
...p/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
+26
-34
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
+2
-0
No files found.
platform/zigbee/app/builder/Z3GatewayHost/rpc_api/src/rpc_interface_parse.c
View file @
34eda340
...
@@ -72,43 +72,29 @@ rpc_table_s rpc_table[]={
...
@@ -72,43 +72,29 @@ rpc_table_s rpc_table[]={
void
kk_tsl_msg_ack
(
char
*
productCode
,
char
*
deviceCode
)
{
cJSON
*
root
=
rpc_cJSON_CreateObject
();
cJSON
*
info
=
rpc_cJSON_CreateObject
();
cJSON
*
payload
=
rpc_cJSON_CreateObject
();
rpc_cJSON_AddItemToObject
(
root
,
"info"
,
info
);
rpc_cJSON_AddItemToObject
(
root
,
"payload"
,
payload
);
rpc_cJSON_AddStringToObject
(
info
,
"msgType"
,
"/thing/service/property/get_reply"
);
rpc_cJSON_AddStringToObject
(
info
,
"productCode"
,
productCode
);
rpc_cJSON_AddStringToObject
(
info
,
"deviceCode"
,
deviceCode
);
rpc_cJSON_AddStringToObject
(
payload
,
"msgId"
,
"*******"
);
jrpc_send_msg
(
root
);
}
static
int
send_result_resp
(
cJSON
*
result
,
static
int
send_result_resp
(
cJSON
*
result
,
cJSON
*
id
)
{
cJSON
*
id
)
{
#if 0
int return_value = 0;
cJSON *info_root = rpc_cJSON_CreateObject();
if(info_root){
rpc_cJSON_AddStringToObject(info_root, "msgType", "");
rpc_cJSON_AddStringToObject(info_root, "productType", "");
rpc_cJSON_AddStringToObject(info_root, "productCode", "");
rpc_cJSON_AddStringToObject(info_root, "deviceCode", "");
}
cJSON *payload_root = rpc_cJSON_CreateObject();
if(payload_root){
rpc_cJSON_AddItemToObject(payload_root, "msgId", id);
rpc_cJSON_AddItemToObject(payload_root, "code", result);
rpc_cJSON_AddStringToObject(payload_root, "data", "{}");
}
cJSON *result_root = rpc_cJSON_CreateObject();
if(result_root){
rpc_cJSON_AddItemToObject(result_root, "info", info_root);
rpc_cJSON_AddItemToObject(result_root, "payload", payload_root);
}
char * str_result = rpc_cJSON_Print(result_root);
printf("send json:\n%s\n",str_result);
return_value = kk_sendData2CCU(str_result, strlen(str_result));
free(str_result);
rpc_cJSON_Delete(result_root);
return return_value;
#else
return
0
;
return
0
;
#endif
}
}
...
@@ -183,12 +169,13 @@ static int invoke_procedure(struct jrpc_server *server,
...
@@ -183,12 +169,13 @@ static int invoke_procedure(struct jrpc_server *server,
}
}
static
int
eval_request
(
struct
jrpc_server
*
server
,
cJSON
*
root
)
{
static
int
eval_request
(
struct
jrpc_server
*
server
,
cJSON
*
root
)
{
cJSON
*
params
,
*
id
,
*
mac
,
*
info
,
*
msgType
,
*
payload
;
cJSON
*
params
,
*
id
,
*
deviceCode
,
*
productCode
,
*
info
,
*
msgType
,
*
payload
;
info
=
rpc_cJSON_GetObjectItem
(
root
,
"info"
);
info
=
rpc_cJSON_GetObjectItem
(
root
,
"info"
);
if
(
info
!=
NULL
){
if
(
info
!=
NULL
){
msgType
=
rpc_cJSON_GetObjectItem
(
info
,
"msgType"
);
msgType
=
rpc_cJSON_GetObjectItem
(
info
,
"msgType"
);
mac
=
rpc_cJSON_GetObjectItem
(
info
,
"deviceCode"
);
deviceCode
=
rpc_cJSON_GetObjectItem
(
info
,
"deviceCode"
);
productCode
=
rpc_cJSON_GetObjectItem
(
info
,
"productCode"
);
}
}
payload
=
rpc_cJSON_GetObjectItem
(
root
,
"payload"
);
payload
=
rpc_cJSON_GetObjectItem
(
root
,
"payload"
);
if
(
payload
!=
NULL
){
if
(
payload
!=
NULL
){
...
@@ -196,13 +183,18 @@ static int eval_request(struct jrpc_server *server, cJSON *root) {
...
@@ -196,13 +183,18 @@ static int eval_request(struct jrpc_server *server, cJSON *root) {
params
=
rpc_cJSON_GetObjectItem
(
payload
,
"params"
);
params
=
rpc_cJSON_GetObjectItem
(
payload
,
"params"
);
id
=
rpc_cJSON_GetObjectItem
(
payload
,
"msgId"
);
id
=
rpc_cJSON_GetObjectItem
(
payload
,
"msgId"
);
}
}
if
(
id
!=
NULL
&&
params
!=
NULL
&&
msgType
!=
NULL
&&
mac
!=
NULL
){
if
(
id
!=
NULL
&&
params
!=
NULL
&&
msgType
!=
NULL
&&
deviceCode
!=
NULL
){
cJSON
*
id_copy
=
NULL
;
cJSON
*
id_copy
=
NULL
;
id_copy
=
(
id
->
type
==
cJSON_String
)
?
rpc_cJSON_CreateString
(
id
->
valuestring
)
:
\
id_copy
=
(
id
->
type
==
cJSON_String
)
?
rpc_cJSON_CreateString
(
id
->
valuestring
)
:
\
rpc_cJSON_CreateNumber
(
id
->
valueint
);
rpc_cJSON_CreateNumber
(
id
->
valueint
);
if
(
strcmp
(
msgType
->
valuestring
,
"/thing/service/property/get"
)
==
0
)
kk_tsl_msg_ack
(
productCode
->
valuestring
,
deviceCode
->
valuestring
);
return
invoke_procedure
(
server
,
msgType
->
valuestring
,
return
invoke_procedure
(
server
,
msgType
->
valuestring
,
params
,
id_copy
,
mac
);
params
,
id_copy
,
deviceCode
);
}
}
...
...
platform/zigbee/app/builder/Z3GatewayHost/yjq_ezsp.c
View file @
34eda340
...
@@ -95,6 +95,7 @@ extern void test_123(int val);
...
@@ -95,6 +95,7 @@ extern void test_123(int val);
extern
void
kk_ota_test111
();
extern
void
kk_ota_test111
();
extern
void
kk_ota_test123123123
();
extern
void
kk_ota_test123123123
();
extern
void
aaaBBB
();
extern
void
aaaBBB
();
extern
void
kk_tsl_msg_ack
(
char
*
productCode
,
char
*
deviceCode
);
void
kk_message_process
(
char
*
messageString
)
void
kk_message_process
(
char
*
messageString
)
{
{
...
@@ -121,6 +122,7 @@ void kk_message_process(char *messageString)
...
@@ -121,6 +122,7 @@ void kk_message_process(char *messageString)
}
}
if
(
MEMCOMPARE
(
messageString
,
"AT+TEST
\r\n
"
,
len
)
==
0
){
if
(
MEMCOMPARE
(
messageString
,
"AT+TEST
\r\n
"
,
len
)
==
0
){
aaaBBB
();
aaaBBB
();
kk_tsl_msg_ack
(
"123"
,
"456"
);
}
}
}
}
...
...
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