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
3fda7a8e
Commit
3fda7a8e
authored
Apr 25, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move to proper place.
parent
ab3176a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
23 deletions
+19
-23
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+17
-0
coupler/opc-ua-server/server.c
coupler/opc-ua-server/server.c
+2
-23
No files found.
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
3fda7a8e
...
...
@@ -235,3 +235,20 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
pMetaData
->
fields
[
1
].
name
=
UA_STRING
(
"ID (subscribed)"
);
pMetaData
->
fields
[
1
].
valueRank
=
-
1
;
/* scalar */
}
static
int
enableSubscribeToHeartBeat
(
UA_Server
*
erver
,
UA_ServerConfig
*
config
){
// enable subscribe to keep-alive messages
UA_ServerConfig_addPubSubTransportLayer
(
config
,
UA_PubSubTransportLayerUDPMP
());
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/"
)};
addPubSubConnectionXXX
(
server
,
&
transportProfile
,
&
networkAddressUrl
);
/* Add ReaderGroup to the created PubSubConnection */
addReaderGroup
(
server
);
/* Add DataSetReader to the created ReaderGroup */
addDataSetReader
(
server
);
/* Add SubscribedVariables to the created DataSetReader */
addSubscribedVariables
(
server
,
readerIdentifier
);
}
coupler/opc-ua-server/server.c
View file @
3fda7a8e
...
...
@@ -257,34 +257,13 @@ int main(int argc, char **argv)
}
#endif
// enable publish keep-alive
// enable publish keep-alive
messages
if
(
arguments
.
heart_beat
)
{
enablePublishHeartBeat
(
server
,
config
);
}
// enable subscribe to keep-alive messages
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
;
enableSubscribeToHeartBeat
(
server
,
config
);
// run server
UA_StatusCode
retval
=
UA_Server_run
(
server
,
&
running
);
...
...
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