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
dea90ebe
Commit
dea90ebe
authored
Sep 17, 2021
by
陈伟灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cwc' into 'master'
Cwc See merge request chenweican/k-sdk!138
parents
5fc03437
e7e9517c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
13 deletions
+37
-13
application/kcloud/kcloud_main.c
application/kcloud/kcloud_main.c
+1
-1
midware/midware/dm/kk_dm_msg.c
midware/midware/dm/kk_dm_msg.c
+14
-0
midware/midware/dm/kk_sync_data.c
midware/midware/dm/kk_sync_data.c
+9
-3
midware/midware/midware.c
midware/midware/midware.c
+1
-1
midware/midware/scene/kk_scene_handle.c
midware/midware/scene/kk_scene_handle.c
+11
-7
nx5_soc_gw/smarthome_z3gw_nx5
nx5_soc_gw/smarthome_z3gw_nx5
+0
-0
tsl/product_3099.json
tsl/product_3099.json
+1
-1
No files found.
application/kcloud/kcloud_main.c
View file @
dea90ebe
...
...
@@ -97,7 +97,7 @@ extern int kk_info_report_start(void);
int
main
(
int
argc
,
char
*
argv
[])
{
int
rc
=
0
;
open
(
"kcloud"
,
LOG_PID
,
LOG_USER
);
open
log
(
"kcloud"
,
LOG_PID
,
LOG_USER
);
/*set the callback to get the device date to cloud*/
KK_Ccuid_init
();
kk_ipc_init
(
IPC_APP2MID
,(
ipc_cb
*
)
KK_Data_FromDev
,
NULL
,
NULL
);
...
...
midware/midware/dm/kk_dm_msg.c
View file @
dea90ebe
...
...
@@ -1074,9 +1074,11 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params)
int
nums
=
0
;
int
idx
=
0
;
int
i
=
0
;
int
versionFlag
=
0
;
dm_mgr_dev_node_t
*
node
=
NULL
;
kk_tsl_data_t
*
property
=
NULL
;
cJSON
*
propertyItem
=
NULL
;
cJSON
*
versionItem
=
NULL
;
char
tmpValue
[
20
]
=
{
0
};
kk_dm_property_e_t
propertyInfoBuf
[
DEVICE_PROPERTY_NUM_MAX
];
kk_dm_property_e_t
subPropertyInfoBuf
;
...
...
@@ -1097,6 +1099,8 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params)
//printf("dm_msg_thing_property_post_by_identify:%s\n",params->valuestring);
memset
(
propertyInfoBuf
,
0x0
,
sizeof
(
kk_dm_property_e_t
)
*
DEVICE_PROPERTY_NUM_MAX
);
memset
(
&
subPropertyInfoBuf
,
0x0
,
sizeof
(
kk_dm_property_e_t
));
versionItem
=
cJSON_GetObjectItem
(
params
,
"version"
);
nums
=
node
->
dev_shadow
->
property_number
;
for
(
idx
=
0
;
idx
<
nums
;
idx
++
){
property
=
(
kk_tsl_data_t
*
)(
node
->
dev_shadow
->
properties
+
idx
);
...
...
@@ -1122,6 +1126,13 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params)
}
else
{
//printf("---------------------------------->property->identifier:%s\n",property->identifier);
memcpy
(
pFinal
,
property
->
identifier
,
strlen
(
property
->
identifier
));
//memset(propertiesbuf[0],0x0,sizeof(propertiesbuf[0]));
//memcpy(propertiesbuf[0],property->identifier,strlen(property->identifier));
//printf("propertiesbuf[0]:%s,num:%d\n",propertiesbuf[0],num);
//epNumInt = 1;
}
if
(
strcmp
(
property
->
identifier
,
"version"
)
==
0
){
versionFlag
=
1
;
}
propertyItem
=
cJSON_GetObjectItem
(
params
,
property
->
identifier
);
if
(
propertyItem
!=
NULL
){
...
...
@@ -1215,6 +1226,9 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params)
continue
;
}
cJSON_AddStringToObject
(
rootData
,
"epNum"
,
epIdx
);
if
(
versionItem
!=
NULL
&&
versionFlag
==
0
){
cJSON_AddStringToObject
(
rootData
,
"version"
,
versionItem
->
valuestring
);
}
for
(
i
=
0
;
i
<
countPro
;
i
++
){
int
vtype
=
propertyInfoBuf
[
idx
].
info
[
i
].
type
;
if
(
vtype
==
KK_TSL_DATA_TYPE_INT
||
vtype
==
KK_TSL_DATA_TYPE_ENUM
\
...
...
midware/midware/dm/kk_sync_data.c
View file @
dea90ebe
...
...
@@ -856,10 +856,16 @@ static int kk_get_scenes_actions_info(cJSON *actionArray,int id)
cJSON_AddStringToObject
(
actionItem
,
KK_SYNC_SCENE_TYPE_STR
,
type
);
if
((
prtyObj
=
cJSON_Parse
(
propertyValue
))
==
NULL
){
cJSON_AddStringToObject
(
actionItem
,
KK_SYNC_SCENE_PROPERTYVALUE_STR
,
propertyValue
);
if
(
strstr
(
propertyValue
,
"{"
)
!=
NULL
&&
strstr
(
propertyValue
,
"}"
)
!=
NULL
){
prtyObj
=
cJSON_Parse
(
propertyValue
);
if
(
prtyObj
!=
NULL
){
cJSON_AddItemToObject
(
actionItem
,
KK_SYNC_SCENE_PROPERTYVALUE_STR
,
prtyObj
);
}
else
{
cJSON_AddStringToObject
(
actionItem
,
KK_SYNC_SCENE_PROPERTYVALUE_STR
,
propertyValue
);
}
}
else
{
cJSON_Add
ItemToObject
(
actionItem
,
KK_SYNC_SCENE_PROPERTYVALUE_STR
,
prtyObj
);
cJSON_Add
StringToObject
(
actionItem
,
KK_SYNC_SCENE_PROPERTYVALUE_STR
,
propertyValue
);
}
cJSON_AddStringToObject
(
actionItem
,
KK_SYNC_ROOMID_STR
,
room_name
);
...
...
midware/midware/midware.c
View file @
dea90ebe
...
...
@@ -1354,7 +1354,7 @@ int main(const int argc, const char **argv)
//kk_tsl_t *dev_shadow[30] = {NULL};
mid_ctx_t
*
mid_ctx
=
kk_mid_get_ctx
();
open
(
"midware"
,
LOG_PID
,
LOG_USER
);
open
log
(
"midware"
,
LOG_PID
,
LOG_USER
);
memset
(
mid_ctx
,
0
,
sizeof
(
mid_ctx_t
));
HAL_Ccuid_version
();
HAL_Ccuid_init
();
...
...
midware/midware/scene/kk_scene_handle.c
View file @
dea90ebe
...
...
@@ -526,10 +526,15 @@ 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
);
if
(
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"{"
)
!=
NULL
&&
strstr
(
ptr
->
actionInfo
->
info
.
propertyValue
,
"}"
)
!=
NULL
){
prtyObj
=
cJSON_Parse
(
ptr
->
actionInfo
->
info
.
propertyValue
);
if
(
prtyObj
!=
NULL
){
cJSON_AddItemToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
prtyObj
);
}
else
{
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
}
}
else
{
cJSON_Add
ItemToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
prtyObj
);
cJSON_Add
StringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
}
cJSON_AddNumberToObject
(
info
,
MSG_SCENE_DELAY
,
ptr
->
actionInfo
->
info
.
delay
);
...
...
@@ -910,7 +915,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 +1011,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 +1025,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
;
...
...
nx5_soc_gw/smarthome_z3gw_nx5
View file @
dea90ebe
No preview for this file type
tsl/product_3099.json
View file @
dea90ebe
{
"schema"
:
"https://iot-ap.ikonke.com/model/product_3099.json"
,
"productType"
:
"fresh
a
ir"
,
"productType"
:
"fresh
A
ir"
,
"version"
:
"1.0"
,
"profile"
:
{
"heartbeat"
:
"300"
,
...
...
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