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
b2415feb
Commit
b2415feb
authored
Sep 17, 2021
by
陈伟灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yjq' into 'master'
场景存action时问题修改 See merge request chenweican/k-sdk!139
parents
dea90ebe
e407562a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
midware/midware/dm/kk_sub_db.c
midware/midware/dm/kk_sub_db.c
+3
-2
midware/midware/scene/kk_scene_handle.c
midware/midware/scene/kk_scene_handle.c
+15
-2
No files found.
midware/midware/dm/kk_sub_db.c
View file @
b2415feb
...
@@ -657,7 +657,8 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen
...
@@ -657,7 +657,8 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen
if
(
property
==
NULL
){
if
(
property
==
NULL
){
continue
;
continue
;
}
}
if
(
strstr
(
property
->
identifier
,
propertyName
)
!=
NULL
){
char
*
ptr
=
strstr
(
property
->
identifier
,
propertyName
);
if
(
ptr
!=
NULL
&&
(
ptr
-
property
->
identifier
==
0
)
){
if
(
gw_support_scene
){
if
(
gw_support_scene
){
kk_scene_action_detail_t
info
=
{
0
};
kk_scene_action_detail_t
info
=
{
0
};
memcpy
(
info
.
deviceCode
,
node
->
deviceCode
,
strlen
(
node
->
deviceCode
));
memcpy
(
info
.
deviceCode
,
node
->
deviceCode
,
strlen
(
node
->
deviceCode
));
...
...
midware/midware/scene/kk_scene_handle.c
View file @
b2415feb
...
@@ -621,8 +621,18 @@ static int kk_scene_parse_trigger_detail(const char *type,const cJSON *item,cons
...
@@ -621,8 +621,18 @@ static int kk_scene_parse_trigger_detail(const char *type,const cJSON *item,cons
if
(
compareType
==
NULL
)
return
FAIL_RETURN
;
if
(
compareType
==
NULL
)
return
FAIL_RETURN
;
compareValue
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_COMPAREVALUE
);
compareValue
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_COMPAREVALUE
);
if
(
compareValue
==
NULL
)
return
FAIL_RETURN
;
if
(
compareValue
==
NULL
)
return
FAIL_RETURN
;
if
(
!
strcmp
(
propertyName
->
valuestring
,
"BodySensorNoActive"
)){
if
(
!
strcmp
(
compareValue
->
valuestring
,
"0"
)){
res
=
kk_scene_insert_scene_trigger
(
type
,
deviceCode
->
valuestring
,
ep
,
"MotionAlarmState"
,
compareType
->
valuestring
,
"1"
,
sceneId
,
isAnd
);
}
}
else
{
res
=
kk_scene_insert_scene_trigger
(
type
,
deviceCode
->
valuestring
,
ep
,
res
=
kk_scene_insert_scene_trigger
(
type
,
deviceCode
->
valuestring
,
ep
,
propertyName
->
valuestring
,
compareType
->
valuestring
,
compareValue
->
valuestring
,
sceneId
,
isAnd
);
propertyName
->
valuestring
,
compareType
->
valuestring
,
compareValue
->
valuestring
,
sceneId
,
isAnd
);
}
if
(
res
!=
SUCCESS_RETURN
){
if
(
res
!=
SUCCESS_RETURN
){
ERROR_PRINT
(
"kk_scene_parse_scene_trigger fail!!!
\n
"
);
ERROR_PRINT
(
"kk_scene_parse_scene_trigger fail!!!
\n
"
);
}
}
...
@@ -2036,8 +2046,11 @@ int kk_scene_query_trigger_info(const char *deviceCode,cJSON *param)
...
@@ -2036,8 +2046,11 @@ int kk_scene_query_trigger_info(const char *deviceCode,cJSON *param)
cJSON
*
item
=
cJSON_GetObjectItem
(
param
,
identifier
);
cJSON
*
item
=
cJSON_GetObjectItem
(
param
,
identifier
);
if
(
item
!=
NULL
){
if
(
item
!=
NULL
){
propertyValueType
=
kk_dm_get_property_type
(
deviceCode
,
identifier
);
propertyValueType
=
kk_dm_get_property_type
(
deviceCode
,
identifier
);
res
=
kk_scene_check_value
(
compareType
,
compareValue
,
item
,
propertyValueType
);
res
=
kk_scene_check_value
(
compareType
,
compareValue
,
item
,
propertyValueType
);
if
(
res
==
SUCCESS_RETURN
){
if
(
res
==
SUCCESS_RETURN
){
INFO_PRINT
(
"[%d]kk_scene_check_condition enter!!!
\n
"
,
__LINE__
);
INFO_PRINT
(
"[%d]kk_scene_check_condition enter!!!
\n
"
,
__LINE__
);
res
=
kk_scene_check_condition
(
sceneId
);
res
=
kk_scene_check_condition
(
sceneId
);
if
(
res
==
SUCCESS_RETURN
){
if
(
res
==
SUCCESS_RETURN
){
...
...
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