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
89883e6e
Commit
89883e6e
authored
Jan 04, 2022
by
陈伟灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cwc' into 'master'
【修改内容】1,增加情景面板绑定灯控设备取反控制失败的BUG See merge request chenweican/k-sdk!166
parents
271dd399
4897154a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
midware/midware/scene/kk_scene_handle.c
midware/midware/scene/kk_scene_handle.c
+20
-9
tsl/product_3124.json
tsl/product_3124.json
+1
-1
No files found.
midware/midware/scene/kk_scene_handle.c
View file @
89883e6e
...
@@ -540,7 +540,12 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
...
@@ -540,7 +540,12 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
}
}
}
else
{
}
else
{
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
//开启/关闭取反操作
if
(
strcmp
(
ptr
->
actionInfo
->
info
.
propertyName
,
"PowerSwitch"
)
==
0
&&
strcmp
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"2"
)
==
0
){
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
"10"
);
}
else
{
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
}
}
}
cJSON_AddNumberToObject
(
info
,
MSG_SCENE_DELAY
,
ptr
->
actionInfo
->
info
.
delay
);
cJSON_AddNumberToObject
(
info
,
MSG_SCENE_DELAY
,
ptr
->
actionInfo
->
info
.
delay
);
...
@@ -1120,6 +1125,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
...
@@ -1120,6 +1125,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
cJSON
*
action
;
cJSON
*
action
;
cJSON
*
item
;
cJSON
*
item
;
cJSON
*
type
;
cJSON
*
type
;
char
typeStr
[
128
]
=
{
0
};
cJSON
*
delay
;
cJSON
*
delay
;
cJSON
*
exeucteSceneId
;
cJSON
*
exeucteSceneId
;
cJSON
*
identifier
;
cJSON
*
identifier
;
...
@@ -1149,22 +1155,26 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
...
@@ -1149,22 +1155,26 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
while
(
item
!=
NULL
){
while
(
item
!=
NULL
){
printf
(
"+++
\r\n
"
);
printf
(
"+++
\r\n
"
);
type
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_TYPE
);
type
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_TYPE
);
if
(
type
==
NULL
)
return
FAIL_RETURN
;
if
(
type
==
NULL
){
memcpy
(
typeStr
,
"action/thing/setProperty"
,
strlen
(
"action/thing/setProperty"
));
}
else
{
memcpy
(
typeStr
,
type
->
valuestring
,
strlen
(
type
->
valuestring
));
}
/*内嵌场景设置*/
/*内嵌场景设置*/
if
(
!
strcmp
(
type
->
valuestring
,
"action/scene"
)){
if
(
!
strcmp
(
type
Str
,
"action/scene"
)){
delay
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_DELAY
);
delay
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_DELAY
);
if
(
delay
==
NULL
)
return
FAIL_RETURN
;
if
(
delay
==
NULL
)
return
FAIL_RETURN
;
exeucteSceneId
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_SCENEID
);
exeucteSceneId
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_SCENEID
);
if
(
exeucteSceneId
==
NULL
)
return
FAIL_RETURN
;
if
(
exeucteSceneId
==
NULL
)
return
FAIL_RETURN
;
kk_scene_insert_scene_embed
(
delay
->
valueint
,
exeucteSceneId
->
valuestring
,
sceneId
);
kk_scene_insert_scene_embed
(
delay
->
valueint
,
exeucteSceneId
->
valuestring
,
sceneId
);
}
}
else
if
(
!
strcmp
(
type
->
valuestring
,
"action/thing/invokeService"
)){
//场景服务,包含场景使能等
else
if
(
!
strcmp
(
type
Str
,
"action/thing/invokeService"
)){
//场景服务,包含场景使能等
identifier
=
cJSON_GetObjectItem
(
item
,
MSG_INDENTIFIER_STR
);
identifier
=
cJSON_GetObjectItem
(
item
,
MSG_INDENTIFIER_STR
);
if
(
identifier
==
NULL
)
return
FAIL_RETURN
;
if
(
identifier
==
NULL
)
return
FAIL_RETURN
;
arg
=
cJSON_GetObjectItem
(
item
,
MSG_COMMON_ARGS
);
arg
=
cJSON_GetObjectItem
(
item
,
MSG_COMMON_ARGS
);
if
(
arg
==
NULL
)
return
FAIL_RETURN
;
if
(
arg
==
NULL
)
return
FAIL_RETURN
;
argStr
=
cJSON_PrintUnformatted
(
arg
);
argStr
=
cJSON_PrintUnformatted
(
arg
);
kk_scene_insert_scene_invokeService
(
type
->
valuestring
,
identifier
->
valuestring
,
argStr
,
sceneId
);
kk_scene_insert_scene_invokeService
(
type
Str
,
identifier
->
valuestring
,
argStr
,
sceneId
);
free
(
argStr
);
free
(
argStr
);
}
}
else
else
...
@@ -1185,11 +1195,11 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
...
@@ -1185,11 +1195,11 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
int
idelay
=
delay
->
valueint
;
int
idelay
=
delay
->
valueint
;
if
(
propertyValue
->
type
==
cJSON_String
){
if
(
propertyValue
->
type
==
cJSON_String
){
kk_subDev_set_action_by_productType
(
productType
->
valuestring
,
roomId
->
valuestring
,
sceneId
,
propertyName
->
valuestring
,
kk_subDev_set_action_by_productType
(
productType
->
valuestring
,
roomId
->
valuestring
,
sceneId
,
propertyName
->
valuestring
,
propertyValue
->
valuestring
,
type
->
valuestring
,
idelay
);
propertyValue
->
valuestring
,
type
Str
,
idelay
);
}
else
{
}
else
{
char
*
str
=
cJSON_PrintUnformatted
(
propertyValue
);
char
*
str
=
cJSON_PrintUnformatted
(
propertyValue
);
kk_subDev_set_action_by_productType
(
productType
->
valuestring
,
roomId
->
valuestring
,
sceneId
,
propertyName
->
valuestring
,
kk_subDev_set_action_by_productType
(
productType
->
valuestring
,
roomId
->
valuestring
,
sceneId
,
propertyName
->
valuestring
,
str
,
type
->
valuestring
,
idelay
);
str
,
type
Str
,
idelay
);
free
(
str
);
free
(
str
);
}
}
...
@@ -1258,11 +1268,12 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
...
@@ -1258,11 +1268,12 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
kk_scene_action_add
(
node
->
fatherDeviceCode
,
sceneId
,
info
);
kk_scene_action_add
(
node
->
fatherDeviceCode
,
sceneId
,
info
);
res
=
kk_scene_insert_scene_action
(
type
->
valuestring
,
node
->
deviceCode
,
iepnum
,
//printf("---------------------------------DEBUG CWC[%s][%d]\n",__FUNCTION__,__LINE__);
res
=
kk_scene_insert_scene_action
(
typeStr
,
node
->
deviceCode
,
iepnum
,
info
.
propertyName
,
propertyValueStr
,
idelay
,
sceneId
,
node
->
fatherDeviceCode
);
info
.
propertyName
,
propertyValueStr
,
idelay
,
sceneId
,
node
->
fatherDeviceCode
);
}
else
{
}
else
{
res
=
kk_scene_insert_scene_action
(
type
->
valuestring
,
node
->
deviceCode
,
iepnum
,
res
=
kk_scene_insert_scene_action
(
type
Str
,
node
->
deviceCode
,
iepnum
,
propertyName
->
valuestring
,
propertyValueStr
,
idelay
,
sceneId
,
node
->
fatherDeviceCode
);
propertyName
->
valuestring
,
propertyValueStr
,
idelay
,
sceneId
,
node
->
fatherDeviceCode
);
}
}
...
...
tsl/product_3124.json
View file @
89883e6e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"productType"
:
"sensor"
,
"productType"
:
"sensor"
,
"version"
:
"1.1"
,
"version"
:
"1.1"
,
"profile"
:
{
"profile"
:
{
"heartbeat"
:
"
12
00"
,
"heartbeat"
:
"
3
00"
,
"productCode"
:
"3124"
,
"productCode"
:
"3124"
,
"productName"
:
"肖邦系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
"productName"
:
"肖邦系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
},
},
...
...
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