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
6382d317
Commit
6382d317
authored
Apr 25, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define in one place only.
parent
a022805e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
coupler/opc-ua-server/keep_alive_publisher.h
coupler/opc-ua-server/keep_alive_publisher.h
+2
-3
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+2
-2
coupler/opc-ua-server/server.c
coupler/opc-ua-server/server.c
+7
-3
No files found.
coupler/opc-ua-server/keep_alive_publisher.h
View file @
6382d317
...
@@ -191,10 +191,9 @@ static void enablePublishHeartBeat(UA_Server *server, UA_ServerConfig *config){
...
@@ -191,10 +191,9 @@ static void enablePublishHeartBeat(UA_Server *server, UA_ServerConfig *config){
}
}
};
};
UA_String
transportProfile
=
UA_String
transportProfile
=
UA_STRING
(
DEFAULT_TRANSPORT_PROFILE
);
UA_STRING
(
"http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"
);
UA_NetworkAddressUrlDataType
networkAddressUrl
=
UA_NetworkAddressUrlDataType
networkAddressUrl
=
{
UA_STRING_NULL
,
UA_STRING
(
"opc.udp://224.0.0.22:4840/"
)};
{
UA_STRING_NULL
,
UA_STRING
(
DEFAULT_NETWORK_ADDRESS_URL
)};
addPubSubConnection
(
server
,
&
transportProfile
,
&
networkAddressUrl
);
addPubSubConnection
(
server
,
&
transportProfile
,
&
networkAddressUrl
);
addPublishedDataSet
(
server
);
addPublishedDataSet
(
server
);
for
(
i
=
0
;
i
<
countof
(
publishedVariableArray
);
i
++
)
{
for
(
i
=
0
;
i
<
countof
(
publishedVariableArray
);
i
++
)
{
...
...
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
6382d317
...
@@ -238,8 +238,8 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
...
@@ -238,8 +238,8 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
static
int
enableSubscribeToHeartBeat
(
UA_Server
*
server
,
UA_ServerConfig
*
config
){
static
int
enableSubscribeToHeartBeat
(
UA_Server
*
server
,
UA_ServerConfig
*
config
){
// enable subscribe to keep-alive messages
// enable subscribe to keep-alive messages
UA_String
transportProfile
=
UA_STRING
(
"http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"
);
UA_String
transportProfile
=
UA_STRING
(
DEFAULT_TRANSPORT_PROFILE
);
UA_NetworkAddressUrlDataType
networkAddressUrl
=
{
UA_STRING_NULL
,
UA_STRING
(
"opc.udp://224.0.0.22:4840/"
)};
UA_NetworkAddressUrlDataType
networkAddressUrl
=
{
UA_STRING_NULL
,
UA_STRING
(
DEFAULT_NETWORK_ADDRESS_URL
)};
addPubSubConnectionXXX
(
server
,
&
transportProfile
,
&
networkAddressUrl
);
addPubSubConnectionXXX
(
server
,
&
transportProfile
,
&
networkAddressUrl
);
/* Add ReaderGroup to the created PubSubConnection */
/* Add ReaderGroup to the created PubSubConnection */
...
...
coupler/opc-ua-server/server.c
View file @
6382d317
...
@@ -39,14 +39,18 @@ static int COUPLER_ID = 0;
...
@@ -39,14 +39,18 @@ static int COUPLER_ID = 0;
// global server
// global server
UA_Server
*
server
;
UA_Server
*
server
;
#include "keep_alive_publisher.h"
#include "keep_alive_subscriber.h"
// The default port of OPC-UA server
// The default port of OPC-UA server
const
int
DEFAULT_OPC_UA_PORT
=
4840
;
const
int
DEFAULT_OPC_UA_PORT
=
4840
;
const
int
DEFAULT_MODE
=
0
;
const
int
DEFAULT_MODE
=
0
;
const
int
DEFAULT_ID
=
0
;
const
int
DEFAULT_ID
=
0
;
// OPC UA's Pub/Sub profile
char
*
DEFAULT_TRANSPORT_PROFILE
=
"http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"
;
char
*
DEFAULT_NETWORK_ADDRESS_URL
=
"opc.udp://224.0.0.22:4840/"
;
#include "keep_alive_publisher.h"
#include "keep_alive_subscriber.h"
// CLI arguments handling
// CLI arguments handling
const
char
*
argp_program_version
=
"OSIE OPC-UA coupler 0.0.1"
;
const
char
*
argp_program_version
=
"OSIE OPC-UA coupler 0.0.1"
;
const
char
*
argp_program_bug_address
=
"ivan@nexedi.com"
;
const
char
*
argp_program_bug_address
=
"ivan@nexedi.com"
;
...
...
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