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
96e4d3ac
Commit
96e4d3ac
authored
Aug 03, 2020
by
whmaizmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】修改属性上报导致死机的问题
【提交人】陈伟灿
parent
fc689d49
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
7 deletions
+16
-7
src/midware/dm/kk_dm_mng.c
src/midware/dm/kk_dm_mng.c
+6
-2
src/midware/midware.c
src/midware/midware.c
+1
-1
src/midware/tsl_handle/kk_tsl_api.c
src/midware/tsl_handle/kk_tsl_api.c
+7
-3
src/midware/tsl_handle/kk_tsl_common.h
src/midware/tsl_handle/kk_tsl_common.h
+1
-1
src/midware/tsl_handle/kk_tsl_parse.c
src/midware/tsl_handle/kk_tsl_parse.c
+1
-0
No files found.
src/midware/dm/kk_dm_mng.c
View file @
96e4d3ac
...
@@ -180,9 +180,13 @@ int dm_mgr_init(void)
...
@@ -180,9 +180,13 @@ int dm_mgr_init(void)
/*----------to do************************ */
/*----------to do************************ */
//HAL_GetProductKey(product_key);
//HAL_GetProductKey(product_key);
//HAL_GetDeviceName(device_name);
//HAL_GetDeviceName(device_name);
memset
(
product_key
,
0x0
,
sizeof
(
product_key
));
memset
(
device_name
,
0x0
,
sizeof
(
device_name
));
memcpy
(
product_key
,
"a1OYuSBt23u"
,
strlen
(
"a1OYuSBt23u"
));
memcpy
(
device_name
,
"aIqEbWno8yDdsjCX15iq"
,
strlen
(
"aIqEbWno8yDdsjCX15iq"
));
//_dm_mgr_legacy_thing_created(IOTX_DM_LOCAL_NODE_DEVID);
//_dm_mgr_legacy_thing_created(IOTX_DM_LOCAL_NODE_DEVID);
res
=
dm_mgr_device_create
(
KK_DM_DEVICE_SUBDEV
,
product_key
,
product_key
,
device_secret
,
&
devId
);
res
=
dm_mgr_device_create
(
KK_DM_DEVICE_SUBDEV
,
product_key
,
device_name
,
device_secret
,
&
devId
);
if
(
res
!=
SUCCESS_RETURN
)
{
if
(
res
!=
SUCCESS_RETURN
)
{
goto
ERROR
;
goto
ERROR
;
}
}
...
...
src/midware/midware.c
View file @
96e4d3ac
...
@@ -28,7 +28,7 @@ void mid_cb(void* data, int len){
...
@@ -28,7 +28,7 @@ void mid_cb(void* data, int len){
{
{
topic
=
cJSON_GetObjectItem
(
json
,
"topic"
);
topic
=
cJSON_GetObjectItem
(
json
,
"topic"
);
payload
=
cJSON_GetObjectItem
(
json
,
"payload"
);
payload
=
cJSON_GetObjectItem
(
json
,
"payload"
);
kk_tsl_service_property_set
(
topic
->
valuestring
,
payload
->
valuestring
);
kk_tsl_service_property_set
(
topic
->
valuestring
,
payload
->
valuestring
,
strlen
(
payload
->
valuestring
),
NULL
);
}
}
kk_ipc_send
(
IPC_MID2PLAT
,
data
,
len
);
kk_ipc_send
(
IPC_MID2PLAT
,
data
,
len
);
}
}
...
...
src/midware/tsl_handle/kk_tsl_api.c
View file @
96e4d3ac
...
@@ -716,6 +716,9 @@ int kk_tsl_service_property_set(const char *topic, const char *payload, unsigned
...
@@ -716,6 +716,9 @@ int kk_tsl_service_property_set(const char *topic, const char *payload, unsigned
dm_msg_response
(
&
request
,
&
response
,
"{}"
,
strlen
(
"{}"
),
NULL
);
dm_msg_response
(
&
request
,
&
response
,
"{}"
,
strlen
(
"{}"
),
NULL
);
kk_tsl_post_property
(
devid
,
NULL
);
return
SUCCESS_RETURN
;
return
SUCCESS_RETURN
;
}
}
...
@@ -809,7 +812,8 @@ static int _kk_tsl_post_property_add(_IN_ void *handle, _IN_ char *identifier, _
...
@@ -809,7 +812,8 @@ static int _kk_tsl_post_property_add(_IN_ void *handle, _IN_ char *identifier, _
if
(
res
!=
SUCCESS_RETURN
)
{
if
(
res
!=
SUCCESS_RETURN
)
{
return
FAIL_RETURN
;
return
FAIL_RETURN
;
}
}
res
=
kk_tsl_assemble_property
(
dapi_property
->
devid
,
identifier
,
identifier_len
,
dapi_property
->
lite
);
res
=
kk_tsl_assemble_property
(
node
->
dev_shadow
,
identifier
,
identifier_len
,
dapi_property
->
lite
);
if
(
res
!=
SUCCESS_RETURN
)
{
if
(
res
!=
SUCCESS_RETURN
)
{
return
FAIL_RETURN
;
return
FAIL_RETURN
;
}
}
...
@@ -899,12 +903,12 @@ int kk_tsl_post_property_end(_IN_ void **handle)
...
@@ -899,12 +903,12 @@ int kk_tsl_post_property_end(_IN_ void **handle)
int
kk_tsl_post_property
(
int
devId
,
const
char
*
property_identifier
)
int
kk_tsl_post_property
(
int
devId
,
const
char
*
property_identifier
)
{
{
int
res
=
0
,
devid
=
0
,
msgid
=
0
,
property_identifier_len
=
0
,
post_property_reply
=
0
;
int
res
=
0
,
msgid
=
0
,
property_identifier_len
=
0
,
post_property_reply
=
0
;
void
*
property_handle
=
NULL
;
void
*
property_handle
=
NULL
;
kk_tsl_api_ctx_t
*
kk_tsl_api_ctx
=
_kk_tsl_api_get_ctx
();
kk_tsl_api_ctx_t
*
kk_tsl_api_ctx
=
_kk_tsl_api_get_ctx
();
_kk_tsl_api_lock
();
_kk_tsl_api_lock
();
res
=
kk_tsl_post_property_start
(
dev
i
d
,
&
property_handle
);
res
=
kk_tsl_post_property_start
(
dev
I
d
,
&
property_handle
);
if
(
res
!=
SUCCESS_RETURN
)
{
if
(
res
!=
SUCCESS_RETURN
)
{
_kk_tsl_api_lock
();
_kk_tsl_api_lock
();
return
FAIL_RETURN
;
return
FAIL_RETURN
;
...
...
src/midware/tsl_handle/kk_tsl_common.h
View file @
96e4d3ac
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
#define KK_TSL_KEY_ITEM "item"
#define KK_TSL_KEY_ITEM "item"
#define KK_MSG_KEY_DELIMITER '.'
#define KK_MSG_KEY_DELIMITER '.'
#define KK_URI_SERVICE_DELIMITER '/'
#define KK_URI_SERVICE_DELIMITER '/'
#define KK_URI_OFFSET
1
#define KK_URI_OFFSET
0
//Special Service And Event
//Special Service And Event
#define KK_TSL_SPECIAL_SERVICE_SET_IDENTIFIER "set"
#define KK_TSL_SPECIAL_SERVICE_SET_IDENTIFIER "set"
...
...
src/midware/tsl_handle/kk_tsl_parse.c
View file @
96e4d3ac
...
@@ -1479,6 +1479,7 @@ int kk_tsl_assemble_property(_IN_ kk_tsl_t *shadow, _IN_ char *identifier, _IN_
...
@@ -1479,6 +1479,7 @@ int kk_tsl_assemble_property(_IN_ kk_tsl_t *shadow, _IN_ char *identifier, _IN_
for
(
index
=
0
;
index
<
shadow
->
property_number
;
index
++
)
{
for
(
index
=
0
;
index
<
shadow
->
property_number
;
index
++
)
{
property
=
shadow
->
properties
+
index
;
property
=
shadow
->
properties
+
index
;
if
((
strlen
(
property
->
identifier
)
==
identifier_len
)
&&
if
((
strlen
(
property
->
identifier
)
==
identifier_len
)
&&
(
memcmp
(
property
->
identifier
,
identifier
,
identifier_len
)
==
0
))
{
(
memcmp
(
property
->
identifier
,
identifier
,
identifier_len
)
==
0
))
{
/* dm_log_debug("Property Found: %.*s",identifier_len,identifier); */
/* dm_log_debug("Property Found: %.*s",identifier_len,identifier); */
...
...
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