Discussion:
[meta-arago] [master/rocko][PATCH 1/3] open62541: open source implementation of OPC/UA
Jacob Stiffler
2018-11-28 20:24:03 UTC
Permalink
Signed-off-by: Jacob Stiffler <j-***@ti.com>
---
...examples-client-allow-configurable-server.patch | 52 ++++++++++++++++++++
.../open62541/open62541_git.bb | 57 ++++++++++++++++++++++
2 files changed, 109 insertions(+)
create mode 100644 meta-arago-extras/recipes-connectivity/open62541/open62541/0001-examples-client-allow-configurable-server.patch
create mode 100644 meta-arago-extras/recipes-connectivity/open62541/open62541_git.bb

diff --git a/meta-arago-extras/recipes-connectivity/open62541/open62541/0001-examples-client-allow-configurable-server.patch b/meta-arago-extras/recipes-connectivity/open62541/open62541/0001-examples-client-allow-configurable-server.patch
new file mode 100644
index 0000000..1cf89a9
--- /dev/null
+++ b/meta-arago-extras/recipes-connectivity/open62541/open62541/0001-examples-client-allow-configurable-server.patch
@@ -0,0 +1,52 @@
+From da2b9a741c3116a7774989f6338976c00a4c0496 Mon Sep 17 00:00:00 2001
+From: Jacob Stiffler <j-***@ti.com>
+Date: Wed, 28 Nov 2018 14:31:22 -0500
+Subject: [PATCH] examples: client: allow configurable server
+
+* Enable a remote server URL to be provided as an argument.
+* Default to localhost if no arguments are provided.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jacob Stiffler <j-***@ti.com>
+---
+ examples/client.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/examples/client.c b/examples/client.c
+index c3147b7..90ab1c7 100644
+--- a/examples/client.c
++++ b/examples/client.c
+@@ -25,12 +25,17 @@ nodeIter(UA_NodeId childId, UA_Boolean isInverse, UA_NodeId referenceTypeId, voi
+ }
+
+ int main(int argc, char *argv[]) {
++ char *ua_server = "opc.tcp://localhost:4840";
++ if(argc > 1) {
++ ua_server = argv[1];
++ }
++
+ UA_Client *client = UA_Client_new(UA_ClientConfig_default);
+
+ /* Listing endpoints */
+ UA_EndpointDescription* endpointArray = NULL;
+ size_t endpointArraySize = 0;
+- UA_StatusCode retval = UA_Client_getEndpoints(client, "opc.tcp://localhost:4840",
++ UA_StatusCode retval = UA_Client_getEndpoints(client, ua_server,
+ &endpointArraySize, &endpointArray);
+ if(retval != UA_STATUSCODE_GOOD) {
+ UA_Array_delete(endpointArray, endpointArraySize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
+@@ -46,8 +51,8 @@ int main(int argc, char *argv[]) {
+ UA_Array_delete(endpointArray,endpointArraySize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
+
+ /* Connect to a server */
+- /* anonymous connect would be: retval = UA_Client_connect(client, "opc.tcp://localhost:4840"); */
+- retval = UA_Client_connect_username(client, "opc.tcp://localhost:4840", "user1", "password");
++ /* anonymous connect would be: retval = UA_Client_connect(client, ua_server); */
++ retval = UA_Client_connect_username(client, ua_server, "user1", "password");
+ if(retval != UA_STATUSCODE_GOOD) {
+ UA_Client_delete(client);
+ return (int)retval;
+--
+2.7.4
+
diff --git a/meta-arago-extras/recipes-connectivity/open62541/open62541_git.bb b/meta-arago-extras/recipes-connectivity/open62541/open62541_git.bb
new file mode 100644
index 0000000..1166e26
--- /dev/null
+++ b/meta-arago-extras/recipes-connectivity/open62541/open62541_git.bb
@@ -0,0 +1,57 @@
+SUMMARY = "Open source implementation of OPC UA"
+HOMEPAGE = "http://open62541.org/"
+LICENSE = "MPL-2.0"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
+
+SRC_URI = "git://github.com/open62541/open62541.git;protocol=https;branch=${BRANCH} \
+ file://0001-examples-client-allow-configurable-server.patch"
+
+BRANCH = "0.3"
+SRCREV = "9f46963240854d9a65d1784a3d2d8440c70157e8"
+
+PV = "0.3-rc4+git${SRCPV}"
+
+inherit cmake python3native
+
+DEPENDS += "python3-six-native libcheck"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES=1 -DUA_BUILD_UNIT_TESTS=1"
+
+PACKAGECONFIG[sharedlibs] = "-DBUILD_SHARED_LIBS=1,-DBUILD_SHARED_LIBS=0,,"
+PACKAGECONFIG[encrypt] = "-DUA_ENABLE_ENCRYPTION=1 -DMBEDTLS_FOLDER_LIBRARY=${STAGING_LIBDIR} -DMBEDTLS_FOLDER_INCLUDE=${STAGING_INCDIR},-DUA_ENABLE_ENCRYPTION=0,mbedtls,"
+
+# Current mbedtls is not sufficient.
+PACKAGECONFIG ?= ""
+
+do_install_append() {
+ # header file is not installed by default
+ install -d ${D}${includedir}
+ install -m 644 ${B}/open62541.h ${D}${includedir}
+
+ # Install examples
+ install -d "${D}${datadir}/${BPN}/examples"
+ for example in ${B}/bin/examples/*
+ do
+ install -m 755 "$example" "${D}${datadir}/${BPN}/examples"
+ done
+
+ # Install unittests
+ install -d "${D}${datadir}/${BPN}/tests"
+ for test in ${B}/bin/tests/*
+ do
+ install -m 755 "$test" "${D}${datadir}/${BPN}/tests"
+ done
+}
+
+PACKAGES =+ "${PN}-examples ${PN}-tests"
+FILES_${PN}-dev += "${libdir}/cmake/*"
+FILES_${PN}-examples += "${datadir}/${BPN}/examples"
+FILES_${PN}-tests += "${datadir}/${BPN}/tests"
+
+# Allow staticdev package to be empty incase sharedlibs is switched on
+ALLOW_EMPTY_${PN}-staticdev = "1"
+
+BBCLASSEXTEND = "native nativesdk"
--
2.7.4
Jacob Stiffler
2018-11-28 20:24:04 UTC
Permalink
Signed-off-by: Jacob Stiffler <j-***@ti.com>
---
.../packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb | 7 +++++--
.../recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bb | 4 +++-
2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb
index 8106caf..a374cf6 100644
--- a/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb
+++ b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb
@@ -1,12 +1,15 @@
DESCRIPTION = "Task to install headers and libraries related to addons into the SDK"
LICENSE = "MIT"
-PR = "r39"
+PR = "r40"

PACKAGE_ARCH = "${MACHINE_ARCH}"

inherit packagegroup

-UTILS = "libdrm-dev"
+UTILS = "libdrm-dev \
+ open62541-dev \
+ open62541-staticdev \
+ "

UTILS_append_keystone = "\
kernel-dev \
diff --git a/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bb b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bb
index f0177ef..b55167d 100644
--- a/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bb
+++ b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Task to install additional utilities/demos for SDKs"
LICENSE = "MIT"
-PR = "r70"
+PR = "r71"

PACKAGE_ARCH = "${MACHINE_ARCH}"

@@ -29,6 +29,8 @@ UTILS = " \
strongswan \
kexec \
kdump \
+ open62541-examples \
+ open62541-tests \
"

UTILS_UBOOT_FW = "u-boot-fw-utils"
--
2.7.4
Jacob Stiffler
2018-11-28 20:24:05 UTC
Permalink
* The examples can be used to test remote OPC/UA connections between
target platform and SDK host.

Signed-off-by: Jacob Stiffler <j-***@ti.com>
---
.../packagegroups/nativesdk-packagegroup-arago-sdk-host.bb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-sdk-host.bb b/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-sdk-host.bb
index 4f8e62b..54466b7 100644
--- a/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-sdk-host.bb
+++ b/meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-sdk-host.bb
@@ -1,5 +1,5 @@
SUMMARY = "Host packages for a standalone Arago SDK or external toolchain"
-PR = "r16"
+PR = "r17"
LICENSE = "MIT"

inherit packagegroup nativesdk
@@ -11,6 +11,8 @@ EXTRA_TI_TOOLS = " \
nativesdk-ti-cgt-pru \
nativesdk-clocl \
nativesdk-clacc \
+ nativesdk-open62541-examples \
+ nativesdk-open62541-tests \
"

RDEPENDS_${PN} = "\
--
2.7.4
Loading...