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
4ee47ad9
Commit
4ee47ad9
authored
Aug 09, 2021
by
chen.weican
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】修改上线下线topic信息采用本机信息
【提交人】陈伟灿
parent
06b76807
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
midware/midware/dm/kk_dm_mng.c
midware/midware/dm/kk_dm_mng.c
+21
-15
No files found.
midware/midware/dm/kk_dm_mng.c
View file @
4ee47ad9
...
@@ -472,11 +472,13 @@ int dm_mgr_check_heartbeat_timeout(time_t timestamp)
...
@@ -472,11 +472,13 @@ int dm_mgr_check_heartbeat_timeout(time_t timestamp)
if
(
search_node
->
devid
==
KK_DM_DEVICE_CCU_DEVICEID
){
if
(
search_node
->
devid
==
KK_DM_DEVICE_CCU_DEVICEID
){
continue
;
continue
;
}
}
//printf("[%s][%d]search_node->productCode:%s\n",__FUNCTION__,__LINE__,search_node->productCode);
#if 0
//printf("[%s][%d]search_node->hb_timeout:%d\n",__FUNCTION__,__LINE__,search_node->hb_timeout);
printf("[%s][%d]search_node->productCode:%s\n",__FUNCTION__,__LINE__,search_node->productCode);
//printf("[%s][%d]search_node->isOffline:%d\n",__FUNCTION__,__LINE__,search_node->isOffline);
printf("[%s][%d]search_node->hb_timeout:%d\n",__FUNCTION__,__LINE__,search_node->hb_timeout);
//printf("[%s][%d]search_node->timestamp:%d\n",__FUNCTION__,__LINE__,search_node->timestamp);
printf("[%s][%d]search_node->isOffline:%d\n",__FUNCTION__,__LINE__,search_node->isOffline);
//printf("[%s][%d]timestamp:%d\n",__FUNCTION__,__LINE__,timestamp);
printf("[%s][%d]search_node->timestamp:%d\n",__FUNCTION__,__LINE__,search_node->timestamp);
printf("[%s][%d]timestamp:%d\n",__FUNCTION__,__LINE__,timestamp);
#endif
if
((
timestamp
-
search_node
->
timestamp
)
>=
search_node
->
hb_timeout
){
if
((
timestamp
-
search_node
->
timestamp
)
>=
search_node
->
hb_timeout
){
if
(
search_node
->
isOffline
!=
KK_DEV_OFFLINE
){
if
(
search_node
->
isOffline
!=
KK_DEV_OFFLINE
){
dm_mgr_set_dev_onoffline
(
search_node
,
1
);
dm_mgr_set_dev_onoffline
(
search_node
,
1
);
...
@@ -1289,6 +1291,7 @@ int dm_mgr_upstream_status_online(_IN_ int devid)
...
@@ -1289,6 +1291,7 @@ int dm_mgr_upstream_status_online(_IN_ int devid)
if
(
res
!=
SUCCESS_RETURN
)
{
if
(
res
!=
SUCCESS_RETURN
)
{
return
FAIL_RETURN
;
return
FAIL_RETURN
;
}
}
#if 0
if(strlen(node->fatherDeviceCode) > 0){
if(strlen(node->fatherDeviceCode) > 0){
res = dm_mgr_get_device_by_devicecode(node->fatherDeviceCode,&gw_node);
res = dm_mgr_get_device_by_devicecode(node->fatherDeviceCode,&gw_node);
if (res != SUCCESS_RETURN) {
if (res != SUCCESS_RETURN) {
...
@@ -1298,7 +1301,9 @@ int dm_mgr_upstream_status_online(_IN_ int devid)
...
@@ -1298,7 +1301,9 @@ int dm_mgr_upstream_status_online(_IN_ int devid)
memcpy(request.productCode,gw_node->productCode,strlen(gw_node->productCode));
memcpy(request.productCode,gw_node->productCode,strlen(gw_node->productCode));
memcpy(request.deviceCode,gw_node->deviceCode,strlen(gw_node->deviceCode));
memcpy(request.deviceCode,gw_node->deviceCode,strlen(gw_node->deviceCode));
}
else
{
}else
#endif
{
memcpy
(
request
.
productCode
,
node
->
productCode
,
strlen
(
node
->
productCode
));
memcpy
(
request
.
productCode
,
node
->
productCode
,
strlen
(
node
->
productCode
));
memcpy
(
request
.
deviceCode
,
node
->
deviceCode
,
strlen
(
node
->
deviceCode
));
memcpy
(
request
.
deviceCode
,
node
->
deviceCode
,
strlen
(
node
->
deviceCode
));
}
}
...
@@ -1353,16 +1358,17 @@ int dm_mgr_upstream_status_offline(_IN_ int devid)
...
@@ -1353,16 +1358,17 @@ int dm_mgr_upstream_status_offline(_IN_ int devid)
if
(
res
!=
SUCCESS_RETURN
)
{
if
(
res
!=
SUCCESS_RETURN
)
{
return
FAIL_RETURN
;
return
FAIL_RETURN
;
}
}
if
(
strlen
(
node
->
fatherDeviceCode
)
>
0
){
//
if(strlen(node->fatherDeviceCode) > 0){
res
=
dm_mgr_get_device_by_devicecode
(
node
->
fatherDeviceCode
,
&
gw_node
);
//
res = dm_mgr_get_device_by_devicecode(node->fatherDeviceCode,&gw_node);
if
(
res
!=
SUCCESS_RETURN
)
{
//
if (res != SUCCESS_RETURN) {
ERROR_PRINT
(
"ERROR [%s][%d] res:%d
\n
"
,
__FUNCTION__
,
__LINE__
,
res
);
//
ERROR_PRINT("ERROR [%s][%d] res:%d\n",__FUNCTION__,__LINE__,res);
return
FAIL_RETURN
;
//
return FAIL_RETURN;
}
//
}
memcpy
(
request
.
productCode
,
gw_node
->
productCode
,
strlen
(
gw_node
->
productCode
));
//
memcpy(request.productCode,gw_node->productCode,strlen(gw_node->productCode));
memcpy
(
request
.
deviceCode
,
gw_node
->
deviceCode
,
strlen
(
gw_node
->
deviceCode
));
//
memcpy(request.deviceCode,gw_node->deviceCode,strlen(gw_node->deviceCode));
}
else
{
//}else
{
memcpy
(
request
.
productCode
,
node
->
productCode
,
strlen
(
node
->
productCode
));
memcpy
(
request
.
productCode
,
node
->
productCode
,
strlen
(
node
->
productCode
));
memcpy
(
request
.
deviceCode
,
node
->
deviceCode
,
strlen
(
node
->
deviceCode
));
memcpy
(
request
.
deviceCode
,
node
->
deviceCode
,
strlen
(
node
->
deviceCode
));
}
}
...
...
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