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
725eedf8
Commit
725eedf8
authored
Apr 26, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define once, use N times.
parent
6f0a1c34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
coupler/opc-ua-server/keep_alive.h
coupler/opc-ua-server/keep_alive.h
+6
-0
coupler/opc-ua-server/keep_alive_publisher.h
coupler/opc-ua-server/keep_alive_publisher.h
+2
-6
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+4
-5
No files found.
coupler/opc-ua-server/keep_alive.h
0 → 100644
View file @
725eedf8
// a hard coded writer group, data set and publisher ID$
// (should be same for publisher / subscriber)$
const
int
WRITER_GROUP_ID
=
100
;
const
int
DATASET_WRITER_ID
=
62541
;
const
int
PUBLISHER_ID
=
2234
;
coupler/opc-ua-server/keep_alive_publisher.h
View file @
725eedf8
...
...
@@ -2,6 +2,8 @@
Keep alive implementation for couplers based on OPC UA's pub/sub mechanism
*/
#include "keep_alive.h"
// global HEART BEATs of coupler$
static
unsigned
int
HEART_BEATS
=
0
;
...
...
@@ -15,12 +17,6 @@ unsigned int HEART_BEAT_ID_LIST[] = {0, 0, 0, 0, 0, 0, 0, 0};
// the interval for publishing messages
const
int
PUBLISHING_INTERVAL
=
100
;
// a hard coded writer group, data set and publisher ID
// (should be same for publisher / subscriber)
const
int
WRITER_GROUP_ID
=
100
;
const
int
DATASET_WRITER_ID
=
62541
;
const
int
PUBLISHER_ID
=
2234
;
UA_NodeId
connectionIdent
,
publishedDataSetIdent
,
writerGroupIdent
;
static
void
addPubSubConnection
(
UA_Server
*
server
,
UA_String
*
transportProfile
,
...
...
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
725eedf8
...
...
@@ -40,8 +40,7 @@ static void dataChangeNotificationCallback(UA_Server *server, UA_UInt32 monitore
// filter out heart_beat from Data Set
if
(
UA_Variant_hasScalarType
(
&
var
->
value
,
&
UA_TYPES
[
UA_TYPES_FLOAT
]))
{
float
heart_beat
=
*
(
UA_Float
*
)
var
->
value
.
data
;
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_USERLAND
,
"heart_beat = %f"
,
heart_beat
);
//UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "heart_beat = %f", heart_beat);
}
}
...
...
@@ -115,11 +114,11 @@ static UA_StatusCode addDataSetReader(UA_Server *server) {
/* The following parameters are used to show that the data published by
* tutorial_pubsub_publish.c is being subscribed and is being updated in
* the information model */
UA_UInt16
publisherIdentifier
=
2234
;
UA_UInt16
publisherIdentifier
=
PUBLISHER_ID
;
readerConfig
.
publisherId
.
type
=
&
UA_TYPES
[
UA_TYPES_UINT16
];
readerConfig
.
publisherId
.
data
=
&
publisherIdentifier
;
readerConfig
.
writerGroupId
=
100
;
readerConfig
.
dataSetWriterId
=
62541
;
readerConfig
.
writerGroupId
=
WRITER_GROUP_ID
;
readerConfig
.
dataSetWriterId
=
DATASET_WRITER_ID
;
/* Setting up Meta data configuration in DataSetReader */
fillTestDataSetMetaData
(
&
readerConfig
.
dataSetMetaData
);
...
...
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