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
Nikola Balog
osie
Commits
0f7f8e16
Commit
0f7f8e16
authored
Jan 26, 2023
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better printouts.
parent
cd417d61
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
coupler/opc-ua-server/keep_alive_publisher.h
coupler/opc-ua-server/keep_alive_publisher.h
+1
-1
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+7
-3
No files found.
coupler/opc-ua-server/keep_alive_publisher.h
View file @
0f7f8e16
...
...
@@ -138,7 +138,7 @@ void callbackTicHeartBeat()
{
/* Increase periodically heart beats of the server */
HEART_BEATS
+=
1
;
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_USERLAND
,
"
\t
heart_beat %d"
,
HEART_BEATS
);
//
UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "\theart_beat %d", HEART_BEATS);
// set OPC UA's heat_beat node value
UA_NodeId
myFloatNodeId
=
UA_NODEID_STRING
(
1
,
"heart_beat"
);
...
...
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
0f7f8e16
...
...
@@ -58,9 +58,9 @@ static void dataChangeNotificationCallback(UA_Server *server, UA_UInt32 monitore
// split <ID>.<heart_beats>, just converting to int is enough
coupler_id
=
(
int
)
heart_beat
;
if
(
coupler_id
!=
COUPLER_ID
)
{
UA_LOG_INFO
(
UA_Log_Stdout
,
\
UA_LOGCATEGORY_USERLAND
,
\
"HEART BEAT: %d (%ld)"
,
coupler_id
,
milli_seconds_now
);
//
UA_LOG_INFO(UA_Log_Stdout, \
//
UA_LOGCATEGORY_USERLAND, \
//
"HEART BEAT: %d (%ld)", coupler_id, milli_seconds_now);
// convert coupler_id to str
char
*
coupler_id_str
=
convertInt2Str
(
coupler_id
);
...
...
@@ -309,6 +309,10 @@ void callbackCheckHeartBeat() {
}
else
{
// all good, we received a keep alive in time
if
(
CURRENT_STATE
==
STATE_NO_INITIAL_HEART_BEAT
)
{
// initial keep alive received, printout
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_USERLAND
,
"INITIAL HEART BEAT received: %s"
,
coupler_id_str
);
}
CURRENT_STATE
=
STATE_UP
;
}
}
...
...
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