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
b53e8978
Commit
b53e8978
authored
Feb 20, 2023
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup comments.
parent
25fce131
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
62 deletions
+0
-62
coupler/keep_alive_publisher.h
coupler/keep_alive_publisher.h
+0
-20
coupler/keep_alive_subscriber.h
coupler/keep_alive_subscriber.h
+0
-42
No files found.
coupler/keep_alive_publisher.h
View file @
b53e8978
...
@@ -8,8 +8,6 @@ UA_NodeId connectionIdent, publishedDataSetIdent, writerGroupIdent;
...
@@ -8,8 +8,6 @@ UA_NodeId connectionIdent, publishedDataSetIdent, writerGroupIdent;
static
void
addPubSubConnection
(
UA_Server
*
server
,
UA_String
*
transportProfile
,
static
void
addPubSubConnection
(
UA_Server
*
server
,
UA_String
*
transportProfile
,
UA_NetworkAddressUrlDataType
*
networkAddressUrl
){
UA_NetworkAddressUrlDataType
*
networkAddressUrl
){
/* Details about the connection configuration and handling are located
* in the pubsub connection tutorial */
UA_PubSubConnectionConfig
connectionConfig
;
UA_PubSubConnectionConfig
connectionConfig
;
memset
(
&
connectionConfig
,
0
,
sizeof
(
connectionConfig
));
memset
(
&
connectionConfig
,
0
,
sizeof
(
connectionConfig
));
connectionConfig
.
name
=
UA_STRING
(
"UADP Connection 1"
);
connectionConfig
.
name
=
UA_STRING
(
"UADP Connection 1"
);
...
@@ -27,13 +25,6 @@ static void addPubSubConnection(UA_Server *server, UA_String *transportProfile,
...
@@ -27,13 +25,6 @@ static void addPubSubConnection(UA_Server *server, UA_String *transportProfile,
UA_Server_addPubSubConnection
(
server
,
&
connectionConfig
,
&
connectionIdent
);
UA_Server_addPubSubConnection
(
server
,
&
connectionConfig
,
&
connectionIdent
);
}
}
/**
* **PublishedDataSet handling**
*
* The PublishedDataSet (PDS) and PubSubConnection are the toplevel entities and
* can exist alone. The PDS contains the collection of the published fields. All
* other PubSub elements are directly or indirectly linked with the PDS or
* connection. */
static
void
addPublishedDataSet
(
UA_Server
*
server
)
{
static
void
addPublishedDataSet
(
UA_Server
*
server
)
{
/* The PublishedDataSetConfig contains all necessary public
/* The PublishedDataSetConfig contains all necessary public
* information for the creation of a new PublishedDataSet */
* information for the creation of a new PublishedDataSet */
...
@@ -45,11 +36,6 @@ static void addPublishedDataSet(UA_Server *server) {
...
@@ -45,11 +36,6 @@ static void addPublishedDataSet(UA_Server *server) {
UA_Server_addPublishedDataSet
(
server
,
&
publishedDataSetConfig
,
&
publishedDataSetIdent
);
UA_Server_addPublishedDataSet
(
server
,
&
publishedDataSetConfig
,
&
publishedDataSetIdent
);
}
}
/**
* **WriterGroup handling**
*
* The WriterGroup (WG) is part of the connection and contains the primary
* configuration parameters for the message creation. */
static
void
addWriterGroup
(
UA_Server
*
server
)
{
static
void
addWriterGroup
(
UA_Server
*
server
)
{
/* Now we create a new WriterGroupConfig and add the group to the existing
/* Now we create a new WriterGroupConfig and add the group to the existing
* PubSubConnection. */
* PubSubConnection. */
...
@@ -81,12 +67,6 @@ static void addWriterGroup(UA_Server *server) {
...
@@ -81,12 +67,6 @@ static void addWriterGroup(UA_Server *server) {
UA_UadpWriterGroupMessageDataType_delete
(
writerGroupMessage
);
UA_UadpWriterGroupMessageDataType_delete
(
writerGroupMessage
);
}
}
/**
* **DataSetWriter handling**
*
* A DataSetWriter (DSW) is the glue between the WG and the PDS. The DSW is
* linked to exactly one PDS and contains additional information for the
* message generation. */
static
void
addDataSetWriter
(
UA_Server
*
server
)
{
static
void
addDataSetWriter
(
UA_Server
*
server
)
{
/* We need now a DataSetWriter within the WriterGroup. This means we must
/* We need now a DataSetWriter within the WriterGroup. This means we must
* create a new DataSetWriterConfig and add call the addWriterGroup function. */
* create a new DataSetWriterConfig and add call the addWriterGroup function. */
...
...
coupler/keep_alive_subscriber.h
View file @
b53e8978
...
@@ -4,9 +4,7 @@
...
@@ -4,9 +4,7 @@
#include <open62541/server.h>
#include <open62541/server.h>
#include <open62541/server_config_default.h>
#include <open62541/server_config_default.h>
#include <open62541/types_generated.h>
#include <open62541/types_generated.h>
#include "ua_pubsub.h"
#include "ua_pubsub.h"
#include <stdio.h>
#include <stdio.h>
#include <signal.h>
#include <signal.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -104,13 +102,6 @@ static UA_StatusCode addPubSubConnectionSubscriber(UA_Server *server, UA_String
...
@@ -104,13 +102,6 @@ static UA_StatusCode addPubSubConnectionSubscriber(UA_Server *server, UA_String
return
retval
;
return
retval
;
}
}
/**
* **ReaderGroup**
*
* ReaderGroup is used to group a list of DataSetReaders. All ReaderGroups are
* created within a PubSubConnection and automatically deleted if the connection
* is removed. All network message related filters are only available in the DataSetReader. */
/* Add ReaderGroup to the created connection */
static
UA_StatusCode
addReaderGroup
(
UA_Server
*
server
)
{
static
UA_StatusCode
addReaderGroup
(
UA_Server
*
server
)
{
if
(
server
==
NULL
)
{
if
(
server
==
NULL
)
{
return
UA_STATUSCODE_BADINTERNALERROR
;
return
UA_STATUSCODE_BADINTERNALERROR
;
...
@@ -126,15 +117,6 @@ static UA_StatusCode addReaderGroup(UA_Server *server) {
...
@@ -126,15 +117,6 @@ static UA_StatusCode addReaderGroup(UA_Server *server) {
return
retval
;
return
retval
;
}
}
/**
* **DataSetReader**
*
* DataSetReader can receive NetworkMessages with the DataSetMessage
* of interest sent by the Publisher. DataSetReader provides
* the configuration necessary to receive and process DataSetMessages
* on the Subscriber side. DataSetReader must be linked with a
* SubscribedDataSet and be contained within a ReaderGroup. */
/* Add DataSetReader to the ReaderGroup */
static
UA_StatusCode
addDataSetReader
(
UA_Server
*
server
)
{
static
UA_StatusCode
addDataSetReader
(
UA_Server
*
server
)
{
if
(
server
==
NULL
)
{
if
(
server
==
NULL
)
{
return
UA_STATUSCODE_BADINTERNALERROR
;
return
UA_STATUSCODE_BADINTERNALERROR
;
...
@@ -143,11 +125,6 @@ static UA_StatusCode addDataSetReader(UA_Server *server) {
...
@@ -143,11 +125,6 @@ static UA_StatusCode addDataSetReader(UA_Server *server) {
UA_StatusCode
retval
=
UA_STATUSCODE_GOOD
;
UA_StatusCode
retval
=
UA_STATUSCODE_GOOD
;
memset
(
&
readerConfig
,
0
,
sizeof
(
UA_DataSetReaderConfig
));
memset
(
&
readerConfig
,
0
,
sizeof
(
UA_DataSetReaderConfig
));
readerConfig
.
name
=
UA_STRING
(
"DataSet Reader 1"
);
readerConfig
.
name
=
UA_STRING
(
"DataSet Reader 1"
);
/* Parameters to filter which DataSetMessage has to be processed
* by the DataSetReader */
/* 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
=
PUBLISHER_ID
;
UA_UInt16
publisherIdentifier
=
PUBLISHER_ID
;
readerConfig
.
publisherId
.
type
=
&
UA_TYPES
[
UA_TYPES_UINT16
];
readerConfig
.
publisherId
.
type
=
&
UA_TYPES
[
UA_TYPES_UINT16
];
readerConfig
.
publisherId
.
data
=
&
publisherIdentifier
;
readerConfig
.
publisherId
.
data
=
&
publisherIdentifier
;
...
@@ -162,11 +139,6 @@ static UA_StatusCode addDataSetReader(UA_Server *server) {
...
@@ -162,11 +139,6 @@ static UA_StatusCode addDataSetReader(UA_Server *server) {
return
retval
;
return
retval
;
}
}
/**
* **SubscribedDataSet**
*
* Set SubscribedDataSet type to TargetVariables data type.
* Add subscribedvariables to the DataSetReader */
static
UA_StatusCode
addSubscribedVariables
(
UA_Server
*
server
,
UA_NodeId
dataSetReaderId
)
{
static
UA_StatusCode
addSubscribedVariables
(
UA_Server
*
server
,
UA_NodeId
dataSetReaderId
)
{
if
(
server
==
NULL
)
if
(
server
==
NULL
)
return
UA_STATUSCODE_BADINTERNALERROR
;
return
UA_STATUSCODE_BADINTERNALERROR
;
...
@@ -193,12 +165,6 @@ static UA_StatusCode addSubscribedVariables(UA_Server *server, UA_NodeId dataSet
...
@@ -193,12 +165,6 @@ static UA_StatusCode addSubscribedVariables(UA_Server *server, UA_NodeId dataSet
folderBrowseName
,
UA_NODEID_NUMERIC
(
0
,
folderBrowseName
,
UA_NODEID_NUMERIC
(
0
,
UA_NS0ID_BASEOBJECTTYPE
),
oAttr
,
NULL
,
&
folderId
);
UA_NS0ID_BASEOBJECTTYPE
),
oAttr
,
NULL
,
&
folderId
);
/**
* **TargetVariables**
*
* The SubscribedDataSet option TargetVariables defines a list of Variable mappings between
* received DataSet fields and target Variables in the Subscriber AddressSpace.
* The values subscribed from the Publisher are updated in the value field of these variables */
/* Create the TargetVariables with respect to DataSetMetaData fields */
/* Create the TargetVariables with respect to DataSetMetaData fields */
UA_FieldTargetVariable
*
targetVars
=
(
UA_FieldTargetVariable
*
)
UA_FieldTargetVariable
*
targetVars
=
(
UA_FieldTargetVariable
*
)
UA_calloc
(
readerConfig
.
dataSetMetaData
.
fieldsSize
,
sizeof
(
UA_FieldTargetVariable
));
UA_calloc
(
readerConfig
.
dataSetMetaData
.
fieldsSize
,
sizeof
(
UA_FieldTargetVariable
));
...
@@ -241,14 +207,6 @@ static UA_StatusCode addSubscribedVariables(UA_Server *server, UA_NodeId dataSet
...
@@ -241,14 +207,6 @@ static UA_StatusCode addSubscribedVariables(UA_Server *server, UA_NodeId dataSet
return
retval
;
return
retval
;
}
}
/**
* **DataSetMetaData**
*
* The DataSetMetaData describes the content of a DataSet. It provides the information necessary to decode
* DataSetMessages on the Subscriber side. DataSetMessages received from the Publisher are decoded into
* DataSet and each field is updated in the Subscriber based on datatype match of TargetVariable fields of Subscriber
* and PublishedDataSetFields of Publisher */
/* Define MetaData for TargetVariables */
static
void
fillTestDataSetMetaData
(
UA_DataSetMetaDataType
*
pMetaData
)
{
static
void
fillTestDataSetMetaData
(
UA_DataSetMetaDataType
*
pMetaData
)
{
if
(
pMetaData
==
NULL
)
{
if
(
pMetaData
==
NULL
)
{
return
;
return
;
...
...
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