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
97359dde
Commit
97359dde
authored
Sep 17, 2021
by
chen.weican
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】修改设置场景导致网关死机bug
【提交人】陈伟灿
parent
717a02b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
midware/midware/scene/kk_scene_handle.c
midware/midware/scene/kk_scene_handle.c
+6
-7
No files found.
midware/midware/scene/kk_scene_handle.c
View file @
97359dde
...
...
@@ -526,10 +526,10 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
cJSON_AddStringToObject
(
info
,
MSG_DEVICE_CODE_STR
,
ptr
->
actionInfo
->
info
.
deviceCode
);
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYNAME
,
ptr
->
actionInfo
->
info
.
propertyName
);
if
((
prtyObj
=
cJSON_Parse
(
ptr
->
actionInfo
->
info
.
propertyValue
))
==
NULL
){
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
}
else
{
if
(
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"{"
)
!=
NULL
&&
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"}"
)
!=
NULL
){
cJSON_AddItemToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
prtyObj
);
}
else
{
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
}
cJSON_AddNumberToObject
(
info
,
MSG_SCENE_DELAY
,
ptr
->
actionInfo
->
info
.
delay
);
...
...
@@ -910,7 +910,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
cJSON
*
epNum
;
int
ArmingStateFlag
=
0
;
int
iepnum
;
char
propertyValueStr
[
255
]
=
{
0
};
char
propertyValueStr
[
DEVICE_PROPERTY_VALUE_MAX
]
=
{
0
};
printf
(
"----->kk_scene_parse_scene_action
\r\n
"
);
...
...
@@ -1006,12 +1006,12 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
if
(
kk_subDev_check_scene_support
(
node
->
fatherDeviceCode
)
==
1
&&
ArmingStateFlag
==
0
){
kk_scene_action_detail_t
info
=
{
0
};
memset
(
propertyValueStr
,
0
,
sizeof
(
propertyValueStr
));
memcpy
(
info
.
deviceCode
,
node
->
deviceCode
,
strlen
(
node
->
deviceCode
));
memcpy
(
info
.
propertyName
,
propertyName
->
valuestring
,
strlen
(
propertyName
->
valuestring
));
if
(
propertyValue
->
type
==
cJSON_Number
){
memset
(
propertyValueStr
,
0
,
sizeof
(
propertyValueStr
));
snprintf
(
propertyValueStr
,
sizeof
(
propertyValueStr
),
"%d"
,
propertyValue
->
valueint
);
}
else
if
(
propertyValue
->
type
==
cJSON_String
){
snprintf
(
propertyValueStr
,
sizeof
(
propertyValueStr
),
"%s"
,
propertyValue
->
valuestring
);
...
...
@@ -1020,7 +1020,6 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
snprintf
(
propertyValueStr
,
sizeof
(
propertyValueStr
),
"%s"
,
str
);
free
(
str
);
}
memcpy
(
info
.
propertyValue
,
propertyValueStr
,
strlen
(
propertyValueStr
));
info
.
epNum
=
iepnum
;
info
.
delay
=
idelay
;
...
...
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