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
nexedi
osie
Commits
b55ee0b9
Commit
b55ee0b9
authored
May 06, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable heart beat checks only if we have list of IDs to check.
parent
ba769996
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
coupler/opc-ua-server/cli.h
coupler/opc-ua-server/cli.h
+9
-6
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+5
-4
coupler/opc-ua-server/server.c
coupler/opc-ua-server/server.c
+1
-0
No files found.
coupler/opc-ua-server/cli.h
View file @
b55ee0b9
...
...
@@ -19,7 +19,7 @@ static struct argp_option options[] = {
{
"heart-beat"
,
'b'
,
"0"
,
0
,
"Publish heart beat to other couplers."
},
{
"heart-beat-interval"
,
't'
,
"500"
,
0
,
"Heart beat interval in ms."
},
{
"heart-beat-id-list"
,
'l'
,
""
,
0
,
"Comma separated list of IDs of couplers to watch for heart beats. \
If
heart beat is missing coupler goes to safe mode."
},
If a
heart beat is missing coupler goes to safe mode."
},
{
"network-address-url-data-type"
,
'n'
,
"opc.udp://224.0.0.22:4840/"
,
0
,
"Netwrok address URL type used for Pub/Sub."
},
{
0
}
...
...
@@ -114,6 +114,7 @@ void handleCLI(int argc, char **argv) {
arguments
.
certificate
=
""
;
arguments
.
id
=
DEFAULT_COUPLER_ID
;
arguments
.
heart_beat_interval
=
DEFAULT_HEART_BEAT_INTERVAL
;
arguments
.
heart_beat_id_list
=
""
;
arguments
.
network_address_url_data_type
=
NETWORK_ADDRESS_URL_DATA_TYPE
;
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
0
,
&
arguments
);
...
...
@@ -160,10 +161,12 @@ void handleCLI(int argc, char **argv) {
char
*
tk
=
strtok
(
arguments
.
heart_beat_id_list
,
","
);
while
(
tk
!=
NULL
)
{
// from CLI we get a comma separated list on INTs representing coupler' ID
result
=
strtol
(
tk
,
&
eptr
,
16
);
HEART_BEAT_ID_LIST
[
i
++
]
=
result
;
tk
=
strtok
(
NULL
,
","
);
}
// from CLI we get a comma separated list on INTs representing coupler' ID
result
=
strtol
(
tk
,
&
eptr
,
16
);
HEART_BEAT_ID_LIST
[
i
++
]
=
result
;
// enable heart beat checks
ENABLE_HEART_BEAT_CHECK
=
true
;
tk
=
strtok
(
NULL
,
","
);
}
}
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
b55ee0b9
...
...
@@ -196,10 +196,11 @@ static UA_StatusCode addSubscribedVariables(UA_Server *server, UA_NodeId dataSet
UA_NODEID_NUMERIC
(
0
,
UA_NS0ID_BASEDATAVARIABLETYPE
),
vAttr
,
NULL
,
&
newNode
);
/*monitor variable*/
UA_MonitoredItemCreateRequest
monRequest
=
UA_MonitoredItemCreateRequest_default
(
newNode
);
UA_Server_createDataChangeMonitoredItem
(
server
,
UA_TIMESTAMPSTORETURN_SOURCE
,
monRequest
,
NULL
,
dataChangeNotificationCallback
);
if
(
ENABLE_HEART_BEAT_CHECK
)
{
UA_MonitoredItemCreateRequest
monRequest
=
UA_MonitoredItemCreateRequest_default
(
newNode
);
UA_Server_createDataChangeMonitoredItem
(
server
,
UA_TIMESTAMPSTORETURN_SOURCE
,
monRequest
,
NULL
,
dataChangeNotificationCallback
);
}
/* For creating Targetvariables */
UA_FieldTargetDataType_init
(
&
targetVars
[
i
].
targetVariable
);
targetVars
[
i
].
targetVariable
.
attributeId
=
UA_ATTRIBUTEID_VALUE
;
...
...
coupler/opc-ua-server/server.c
View file @
b55ee0b9
...
...
@@ -49,6 +49,7 @@ const int DEFAULT_COUPLER_ID = 0;
int
OPC_UA_PORT
;
bool
ENABLE_HEART_BEAT
=
false
;
bool
ENABLE_HEART_BEAT_CHECK
=
false
;
bool
ENABLE_X509
=
false
;
bool
ENABLE_USERNAME_PASSWORD_AUTHENTICATION
=
false
;
char
*
USERNAME
;
...
...
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