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
Martin Manchev
osie
Commits
a98c0ae2
Commit
a98c0ae2
authored
Apr 20, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify structure of Pub/Sub variables' structure and make it now generic.
parent
538090e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
coupler/opc-ua-server/keep_alive.h
coupler/opc-ua-server/keep_alive.h
+3
-5
coupler/opc-ua-server/server.c
coupler/opc-ua-server/server.c
+2
-2
No files found.
coupler/opc-ua-server/keep_alive.h
View file @
a98c0ae2
...
...
@@ -99,17 +99,15 @@ typedef struct PublishedVariable {
char
*
name
;
char
*
description
;
void
*
UA_RESTRICT
pdefaultValue
;
UA_DataType
type
;
int
type
;
}
PublishedVariable
;
static
void
addPubSubVariable
(
UA_Server
*
server
,
PublishedVariable
varDetails
)
{
UA_VariableAttributes
attr
=
UA_VariableAttributes_default
;
//UA_Variant_setScalar(&attr.value, varDetails.pdefaultValue, &varDetails.type);
UA_Variant_setScalar
(
&
attr
.
value
,
varDetails
.
pdefaultValue
,
&
UA_TYPES
[
UA_TYPES_INT32
]);
//XXX: hard-code for INT32 only, make generic
UA_Variant_setScalar
(
&
attr
.
value
,
varDetails
.
pdefaultValue
,
&
UA_TYPES
[
varDetails
.
type
]);
attr
.
description
=
UA_LOCALIZEDTEXT
(
"en-US"
,
varDetails
.
description
);
attr
.
displayName
=
UA_LOCALIZEDTEXT
(
"en-US"
,
varDetails
.
description
);
//attr.dataType = varDetails.type.typeId;
attr
.
dataType
=
UA_TYPES
[
UA_TYPES_INT32
].
typeId
;
//XXX: hard-code for INT32 only, make generic
attr
.
dataType
=
UA_TYPES
[
varDetails
.
type
].
typeId
;
attr
.
accessLevel
=
UA_ACCESSLEVELMASK_READ
|
UA_ACCESSLEVELMASK_WRITE
;
UA_Server_addVariableNode
(
server
,
UA_NODEID_STRING
(
1
,
varDetails
.
name
),
...
...
coupler/opc-ua-server/server.c
View file @
a98c0ae2
...
...
@@ -267,14 +267,14 @@ int main(int argc, char **argv)
.
name
=
"heart_beat"
,
.
description
=
"Heart beat"
,
.
pdefaultValue
=
&
defaultInt32
,
.
type
=
UA_TYPES
[
UA_TYPES_INT32
]
.
type
=
UA_TYPES
_INT32
},
// representing the ID of the coupler
{
.
name
=
"id"
,
.
description
=
"ID"
,
.
pdefaultValue
=
&
couplerID
,
.
type
=
UA_TYPES
[
UA_TYPES_INT32
]
.
type
=
UA_TYPES
_INT32
}
};
...
...
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