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
Martin Manchev
osie
Commits
89669a4b
Commit
89669a4b
authored
Apr 27, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add to list the IDs of the coupler .
parent
6d326efb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+15
-2
No files found.
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
89669a4b
...
...
@@ -33,9 +33,22 @@ static void dataChangeNotificationCallback(UA_Server *server, UA_UInt32 monitore
// filter out ID from Data Set
if
(
UA_Variant_hasScalarType
(
&
var
->
value
,
&
UA_TYPES
[
UA_TYPES_UINT32
]))
{
unsigned
int
coupler_id
=
*
(
UA_UInt32
*
)
var
->
value
.
data
;
// care for other coupler_id NOT ourselves
if
(
coupler_id
!=
COUPLER_ID
)
{
// care for other coupler_id NOT ourselves
addItem
(
&
SUBSCRIBER_DICT
,
"foo"
,
"bar"
);
// convert coupler_id to str
int
length
=
snprintf
(
NULL
,
0
,
"%d"
,
coupler_id
);
char
*
coupler_id_str
=
malloc
(
length
+
1
);
snprintf
(
coupler_id_str
,
length
+
1
,
"%d"
,
coupler_id
);
// convert micro seconds to str
length
=
snprintf
(
NULL
,
0
,
"%ld"
,
micro_seconds
);
char
*
micro_seconds_str
=
malloc
(
length
+
1
);
snprintf
(
micro_seconds_str
,
length
+
1
,
"%ld"
,
micro_seconds
);
// Add to our local linked list
addItem
(
&
SUBSCRIBER_DICT
,
coupler_id_str
,
micro_seconds_str
);
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_USERLAND
,
"ID = %d, microseconds=%ld"
,
coupler_id
,
micro_seconds
);
}
}
...
...
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