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
9e08072d
Commit
9e08072d
authored
Apr 25, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Enable subscriber part of server.
parent
a6953d1c
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
352 additions
and
0 deletions
+352
-0
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+324
-0
coupler/opc-ua-server/server.c
coupler/opc-ua-server/server.c
+28
-0
No files found.
coupler/opc-ua-server/keep_alive_subscriber.h
0 → 100644
View file @
9e08072d
This diff is collapsed.
Click to expand it.
coupler/opc-ua-server/server.c
View file @
9e08072d
...
...
@@ -40,6 +40,7 @@ static int COUPLER_ID = 0;
UA_Server
*
server
;
#include "keep_alive_publisher.h"
#include "keep_alive_subscriber.h"
// The default port of OPC-UA server
const
int
DEFAULT_OPC_UA_PORT
=
4840
;
...
...
@@ -261,6 +262,33 @@ int main(int argc, char **argv)
enablePublishHeartBeat
(
server
,
config
);
}
// XXX: subscribe part
/* Add PubSubConnection */
UA_ServerConfig_addPubSubTransportLayer
(
config
,
UA_PubSubTransportLayerUDPMP
());
UA_StatusCode
return_value
=
UA_STATUSCODE_GOOD
;
UA_String
transportProfile
=
UA_STRING
(
"http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"
);
UA_NetworkAddressUrlDataType
networkAddressUrl
=
{
UA_STRING_NULL
,
UA_STRING
(
"opc.udp://224.0.0.22:4840/"
)};
return_value
|=
addPubSubConnectionXXX
(
server
,
&
transportProfile
,
&
networkAddressUrl
);
if
(
return_value
!=
UA_STATUSCODE_GOOD
)
return
EXIT_FAILURE
;
/* Add ReaderGroup to the created PubSubConnection */
return_value
|=
addReaderGroup
(
server
);
if
(
return_value
!=
UA_STATUSCODE_GOOD
)
return
EXIT_FAILURE
;
/* Add DataSetReader to the created ReaderGroup */
return_value
|=
addDataSetReader
(
server
);
if
(
return_value
!=
UA_STATUSCODE_GOOD
)
return
EXIT_FAILURE
;
/* Add SubscribedVariables to the created DataSetReader */
return_value
|=
addSubscribedVariables
(
server
,
readerIdentifier
);
if
(
return_value
!=
UA_STATUSCODE_GOOD
)
return
EXIT_FAILURE
;
// EOF: subscribe
// run server
UA_StatusCode
retval
=
UA_Server_run
(
server
,
&
running
);
UA_Server_delete
(
server
);
...
...
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