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
1
Merge Requests
1
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
a66444c7
Commit
a66444c7
authored
Feb 14, 2025
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support all couplers current coupler depend on, not just the first one.
parent
33fe6425
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
coupler/cli.h
coupler/cli.h
+3
-0
coupler/keep_alive.h
coupler/keep_alive.h
+3
-0
coupler/keep_alive_subscriber.h
coupler/keep_alive_subscriber.h
+9
-1
No files found.
coupler/cli.h
View file @
a66444c7
...
...
@@ -177,6 +177,7 @@ void handleCLI(int argc, char **argv) {
printf
(
"Heart beat interval=%d ms
\n
"
,
arguments
.
heart_beat_interval
);
printf
(
"Heart beat timeout interval=%d ms
\n
"
,
arguments
.
heart_beat_timeout_interval
);
printf
(
"Heart beat ID list=%s
\n
"
,
arguments
.
heart_beat_id_list
);
printf
(
"Heart beat ID list count=%d
\n
"
,
HEART_BEAT_ID_LIST_COUNT
);
printf
(
"Network address URL data type=%s
\n
"
,
arguments
.
network_address_url_data_type
);
printf
(
"Network interface=%s
\n
"
,
arguments
.
network_interface
);
...
...
@@ -219,6 +220,8 @@ void handleCLI(int argc, char **argv) {
// from CLI we get a comma separated list on INTs representing coupler' ID
result
=
strtol
(
tk
,
&
eptr
,
16
);
HEART_BEAT_ID_LIST
[
i
++
]
=
result
;
// add to counter
HEART_BEAT_ID_LIST_COUNT
+=
1
;
// enable heart beat checks
ENABLE_HEART_BEAT_CHECK
=
true
;
tk
=
strtok
(
NULL
,
","
);
...
...
coupler/keep_alive.h
View file @
a66444c7
...
...
@@ -59,6 +59,9 @@ static int HEART_BEAT_TIMEOUT_INTERVAL = DEFAULT_HEART_BEAT_TIMEOUT_INTERVAL;
// assume maximum of 127 couplers!
unsigned
int
HEART_BEAT_ID_LIST
[
127
]
=
{
0
};
// the count of all couplers we depend on.
unsigned
int
HEART_BEAT_ID_LIST_COUNT
=
0
;
// the interval for publishing messages
static
int
PUBLISHING_INTERVAL
=
10
;
...
...
coupler/keep_alive_subscriber.h
View file @
a66444c7
...
...
@@ -65,7 +65,15 @@ static void dataChangeNotificationCallback(UA_Server *server, UA_UInt32 monitore
coupler_id
=
(
int
)
heart_beat
;
// it is completely normal to have same multicast group keep alive
// messages from different couplers thus filter and leave ones we care for
bool
is_coupler_id_interesting
=
(
coupler_id
==
HEART_BEAT_ID_LIST
[
0
]);
bool
is_coupler_id_interesting
=
false
;
for
(
int
i
=
0
;
i
<
HEART_BEAT_ID_LIST_COUNT
;
i
++
)
{
if
(
coupler_id
==
HEART_BEAT_ID_LIST
[
i
]){
// we care for this ID
is_coupler_id_interesting
=
true
;
break
;
}
}
if
((
coupler_id
!=
(
unsigned
int
)
COUPLER_ID
)
&&
(
is_coupler_id_interesting
)){
/*UA_LOG_INFO(UA_Log_Stdout,
UA_LOGCATEGORY_USERLAND,
...
...
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