Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sdptr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Corné Lukken
sdptr
Commits
9d6dfd00
Commit
9d6dfd00
authored
2 years ago
by
Corné Lukken
Browse files
Options
Downloads
Patches
Plain Diff
Update source files for testing
parent
fcd1ef4a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+13
-5
13 additions, 5 deletions
Dockerfile
src/opcua/ua_server.cpp
+4
-4
4 additions, 4 deletions
src/opcua/ua_server.cpp
test/c/ua_client/client.c
+1
-1
1 addition, 1 deletion
test/c/ua_client/client.c
with
18 additions
and
10 deletions
Dockerfile
+
13
−
5
View file @
9d6dfd00
FROM
ubuntu:20.04
FROM
debian:bullseye
# Install build tools for sdptr and the C language OPC-UA lib
# Install build tools for sdptr and the C language OPC-UA lib
RUN
apt-get update
&&
\
RUN
apt-get update
&&
\
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
software-properties-common
&&
\
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
software-properties-common
&&
\
DEBIAN_FRONTEND
=
noninteractive add-apt-repository ppa:open62541-team/ppa
&&
\
apt-get update
&&
\
apt-get update
&&
\
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
autoconf automake git make g++ build-essential pkg-config libboost-dev libboost-regex-dev libboost-system-dev libboost-program-options-dev
libopen62541-1-dev libopen62541-1-tools
zlib1g-dev
&&
\
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
autoconf automake git
cmake
make g++ build-essential pkg-config libboost-dev libboost-regex-dev libboost-system-dev libboost-program-options-dev zlib1g-dev
&&
\
apt-get clean
apt-get clean
RUN
git clone
-b
v1.3.4 https://github.com/open62541/open62541
RUN
cd
open62541
&&
git submodule update
--init
--recursive
&&
\
mkdir
build
-p
&&
cd
build/
&&
cmake ..
&&
make
-j
4
&&
make
install
# Remove source
RUN
rm
-rf
open62541
# Copy sdptr
# Copy sdptr
COPY
. /sdptr
COPY
. /sdptr
...
@@ -18,11 +23,14 @@ RUN cd /sdptr && \
...
@@ -18,11 +23,14 @@ RUN cd /sdptr && \
bash
-c
"make -j
`
nproc
`
install"
bash
-c
"make -j
`
nproc
`
install"
# Remove source
# Remove source
RUN
rm
-rf
/sdptr
#
RUN rm -rf /sdptr
# Remove build dependencies
# Remove build dependencies
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get purge
-y
autoconf automake git make g++ build-essential libboost-dev libboost-regex-dev libboost-system-dev libboost-program-options-dev
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get purge
-y
autoconf automake git
cmake
make g++ build-essential libboost-dev libboost-regex-dev libboost-system-dev libboost-program-options-dev
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get autoremove
-y
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get autoremove
-y
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get clean
RUN
DEBIAN_FRONTEND
=
noninteractive apt-get clean
WORKDIR
/sdptr/src
CMD
["sdptr", "--ip_prefix=127.0.", "--nodaemon"]
This diff is collapsed.
Click to expand it.
src/opcua/ua_server.cpp
+
4
−
4
View file @
9d6dfd00
...
@@ -983,14 +983,14 @@ static void ua_add_Variable_boolean(UA_Server *server, const string regname, con
...
@@ -983,14 +983,14 @@ static void ua_add_Variable_boolean(UA_Server *server, const string regname, con
UA_Boolean
*
values
=
NULL
;
UA_Boolean
*
values
=
NULL
;
if
(
is_scalar
)
if
(
is_scalar
)
{
{
//
LOG_F(INFO, "ua_add_variable_boolean scalar: regname=%s size=%u perm=%s", regname.c_str(), size, perm.c_str());
LOG_F
(
INFO
,
"ua_add_variable_boolean scalar: regname=%s size=%u perm=%s"
,
regname
.
c_str
(),
size
,
perm
.
c_str
());
UA_Boolean
value
=
UA_Boolean
(
false
);
UA_Boolean
value
=
UA_Boolean
(
false
);
UA_Variant_setScalar
(
&
vattr
.
value
,
&
value
,
&
UA_TYPES
[
UA_TYPES_BOOLEAN
]);
UA_Variant_setScalar
(
&
vattr
.
value
,
&
value
,
&
UA_TYPES
[
UA_TYPES_BOOLEAN
]);
vattr
.
valueRank
=
UA_VALUERANK_SCALAR
;
vattr
.
valueRank
=
UA_VALUERANK_SCALAR
;
}
}
else
else
{
{
//
LOG_F(INFO, "ua_add_variable_boolean array: regname=%s size=%u perm=%s", regname.c_str(), size, perm.c_str());
LOG_F
(
INFO
,
"ua_add_variable_boolean array: regname=%s size=%u perm=%s"
,
regname
.
c_str
(),
size
,
perm
.
c_str
());
vattr
.
valueRank
=
UA_VALUERANK_ONE_DIMENSION
;
vattr
.
valueRank
=
UA_VALUERANK_ONE_DIMENSION
;
UA_UInt32
myArrayDimensions
[
1
]
=
{(
uint32_t
)
size
};
UA_UInt32
myArrayDimensions
[
1
]
=
{(
uint32_t
)
size
};
...
@@ -1008,8 +1008,8 @@ static void ua_add_Variable_boolean(UA_Server *server, const string regname, con
...
@@ -1008,8 +1008,8 @@ static void ua_add_Variable_boolean(UA_Server *server, const string regname, con
vattr
.
value
.
arrayDimensions
=
myArrayDimensions
;
vattr
.
value
.
arrayDimensions
=
myArrayDimensions
;
vattr
.
value
.
arrayDimensionsSize
=
1
;
vattr
.
value
.
arrayDimensionsSize
=
1
;
//
LOG_F(INFO, "vattr.value: arrayDimensions=%u arrayDimensionsSize=%u arrayLength=%u",
LOG_F
(
INFO
,
"vattr.value: arrayDimensions=%u arrayDimensionsSize=%u arrayLength=%u"
,
//
(uint32_t)vattr.value.arrayDimensions[0], (uint32_t)vattr.value.arrayDimensionsSize, (uint32_t)vattr.value.arrayLength);
(
uint32_t
)
vattr
.
value
.
arrayDimensions
[
0
],
(
uint32_t
)
vattr
.
value
.
arrayDimensionsSize
,
(
uint32_t
)
vattr
.
value
.
arrayLength
);
}
}
UA_DataSource
DataSource
;
UA_DataSource
DataSource
;
...
...
This diff is collapsed.
Click to expand it.
test/c/ua_client/client.c
+
1
−
1
View file @
9d6dfd00
...
@@ -52,7 +52,7 @@ int main(int argc, char *argv[]) {
...
@@ -52,7 +52,7 @@ int main(int argc, char *argv[]) {
/* Connect to a server */
/* Connect to a server */
/* anonymous connect would be: retval = UA_Client_connect(client, "opc.tcp://localhost:4840"); */
/* anonymous connect would be: retval = UA_Client_connect(client, "opc.tcp://localhost:4840"); */
retval
=
UA_Client_connect
_u
sername
(
client
,
"opc.tcp://localhost:4840"
,
"user1"
,
"password"
);
retval
=
UA_Client_connect
U
sername
(
client
,
"opc.tcp://localhost:4840"
,
"user1"
,
"password"
);
if
(
retval
!=
UA_STATUSCODE_GOOD
)
{
if
(
retval
!=
UA_STATUSCODE_GOOD
)
{
UA_Client_delete
(
client
);
UA_Client_delete
(
client
);
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment