Skip to contentSkip to conversation

open62541: open source implementation of OPC/UA

PATCH New Jacob Stiffler 1 participant 3 messages Nov 28, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 open62541: open source implementation of OPC/UA

---
 ...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
meta-arago-extras/recipes-connectivity/open62541/open62541/0001-examples-client-allow-configurable-server.patch new file +52 -0
new file mode 100644
index 0000000..1cf89a9
@@ -0,0 +1,52 @@
+From da2b9a741c3116a7774989f6338976c00a4c0496 Mon Sep 17 00:00:00 2001
+From: Jacob Stiffler <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-arago-extras/recipes-connectivity/open62541/open62541_git.bb new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/3 packagegroups: addons: add open62541 packages

---
 .../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(-)
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb +5 -2
index 8106caf..a374cf6 100644
@@ -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 \
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bb +3 -1
index f0177ef..b55167d 100644
@@ -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"
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/3 nativesdk-packagegroup-arago-sdk-host: add open62541 examples

In reply to Jacob Stiffler

* The examples can be used to test remote OPC/UA connections between target platform and SDK host.

---
 .../packagegroups/nativesdk-packagegroup-arago-sdk-host.bb            | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-arago-extras/recipes-core/packagegroups/nativesdk-packagegroup-arago-sdk-host.bb +3 -1
index 4f8e62b..54466b7 100644
@@ -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} = "\
Signature · 1 line
2.7.4