Leon Urbas 11 rokov pred
rodič
commit
5c4ebf86d3
2 zmenil súbory, kde vykonal 42 pridanie a 0 odobranie
  1. 23 0
      examples/src/opcuaServer.c
  2. 19 0
      examples/src/simpleTest.c

+ 23 - 0
examples/src/opcuaServer.c

@@ -0,0 +1,23 @@
+/*
+ ============================================================================
+ Name        : opcuaServer.c
+ Author      :
+ Version     :
+ Copyright   : Your copyright notice
+ Description :
+ ============================================================================
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "UA_stack.h"
+
+
+int main(void) {
+	UA_Stack_init(&UA_TransportLayerDescriptorTcpBinary,16664);
+	while (UA_TRUE) {
+		sleep(10);
+	}
+	return EXIT_SUCCESS;
+}

+ 19 - 0
examples/src/simpleTest.c

@@ -0,0 +1,19 @@
+/*
+ * main.c
+ *
+ *  Created on: 07.03.2014
+ *      Author: mrt
+ */
+#include <stdio.h>
+#include "opcua.h"
+int main() {
+	// given
+	UA_Int32 pos = 0;
+	UA_Byte src[] = { UA_INT32_NS0 | UA_VARIANT_ENCODINGMASKTYPE_ARRAY, 0x02, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
+	UA_Variant dst;
+	// when
+	UA_Int32 retval = UA_Variant_decode(src, &pos, &dst);
+	UA_Variant_deleteMembers(&dst);
+	return 0;
+}
+