Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
nexedi
osie
Commits
dd9a3a37
Commit
dd9a3a37
authored
May 04, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle case of not yet sent initial heart beat from a coupler.
parent
fbb20ccc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+9
-4
No files found.
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
dd9a3a37
...
@@ -262,7 +262,8 @@ void callbackCheckHeartBeat() {
...
@@ -262,7 +262,8 @@ void callbackCheckHeartBeat() {
* Check if for liveness of related couplers. Called upon a certain interval.
* Check if for liveness of related couplers. Called upon a certain interval.
* If a related coupler is down got to safe mode.
* If a related coupler is down got to safe mode.
*/
*/
int
i
,
coupler_id
;
int
i
,
coupler_id
,
last_seen_timestamp_int
,
timestamp_delta
;
bool
is_down
;
unsigned
long
int
milli_seconds
=
getMilliSecondsSinceEpoch
();
unsigned
long
int
milli_seconds
=
getMilliSecondsSinceEpoch
();
size_t
n
=
sizeof
(
HEART_BEAT_ID_LIST
)
/
sizeof
(
HEART_BEAT_ID_LIST
[
0
]);
size_t
n
=
sizeof
(
HEART_BEAT_ID_LIST
)
/
sizeof
(
HEART_BEAT_ID_LIST
[
0
]);
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
...
@@ -274,15 +275,19 @@ void callbackCheckHeartBeat() {
...
@@ -274,15 +275,19 @@ void callbackCheckHeartBeat() {
//UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "Check ID=%s, last_seen=%s", coupler_id_str, last_seen_timestamp);
//UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "Check ID=%s, last_seen=%s", coupler_id_str, last_seen_timestamp);
if
(
last_seen_timestamp
!=
NULL
){
if
(
last_seen_timestamp
!=
NULL
){
// we do have timestamp for this coupler ID
// we do have timestamp for this coupler ID
int
last_seen_timestamp_int
=
atoi
(
last_seen_timestamp
);
last_seen_timestamp_int
=
atoi
(
last_seen_timestamp
);
int
timestamp_delta
=
milli_seconds
-
last_seen_timestamp_int
;
timestamp_delta
=
milli_seconds
-
last_seen_timestamp_int
;
bool
is_down
=
(
timestamp_delta
>
DEFAULT_HEART_BEAT_TIMEOUT_INTERVAL
);
is_down
=
(
timestamp_delta
>
DEFAULT_HEART_BEAT_TIMEOUT_INTERVAL
);
if
(
is_down
)
{
if
(
is_down
)
{
UA_LOG_INFO
(
UA_Log_Stdout
,
\
UA_LOG_INFO
(
UA_Log_Stdout
,
\
UA_LOGCATEGORY_USERLAND
,
\
UA_LOGCATEGORY_USERLAND
,
\
"DOWN: %s (delta=%d)"
,
coupler_id_str
,
timestamp_delta
);
"DOWN: %s (delta=%d)"
,
coupler_id_str
,
timestamp_delta
);
}
}
}
}
else
{
// still no hear beat from this coupler ...
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_USERLAND
,
"NO INITIAL HEART BEAT: %s"
,
coupler_id_str
);
}
}
}
}
}
}
}
...
...
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