opcua 0.8 → 0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cert/cert.h +52 -52
- data/cert/cert_key.h +99 -99
- data/example/server.rb +53 -31
- data/ext/opcua/client/client.c +24 -20
- data/ext/opcua/client/client.h +2 -3
- data/ext/opcua/server/server.c +301 -123
- data/ext/opcua/server/server.h +6 -3
- data/ext/opcua/values.h +15 -1
- data/opcua.gemspec +1 -1
- metadata +2 -2
data/ext/opcua/server/server.h
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
#include <ruby.h>
|
|
2
|
+
#include <ruby/intern.h>
|
|
2
3
|
#include <stdio.h>
|
|
3
4
|
#include <open62541.h>
|
|
4
5
|
#include <malloc.h>
|
|
5
6
|
#include "../log_none.h"
|
|
6
|
-
#include "../values.h"
|
|
7
7
|
#include "../strnautocat.h"
|
|
8
8
|
|
|
9
9
|
typedef struct server_struct {
|
|
10
10
|
UA_ServerConfig *config;
|
|
11
|
-
UA_Server *
|
|
11
|
+
UA_Server *master;
|
|
12
12
|
UA_UInt16 default_ns;
|
|
13
|
+
bool debug;
|
|
14
|
+
VALUE methods;
|
|
13
15
|
} server_struct;
|
|
14
16
|
|
|
15
17
|
typedef struct node_struct {
|
|
16
|
-
server_struct *
|
|
18
|
+
server_struct *master;
|
|
17
19
|
UA_NodeId id;
|
|
20
|
+
VALUE method;
|
|
18
21
|
} node_struct;
|
data/ext/opcua/values.h
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
/* -- */
|
|
2
|
+
VALUE mTYPES = Qnil;
|
|
3
|
+
|
|
4
|
+
static void Init_types() {/*{{{*/
|
|
5
|
+
mTYPES = rb_define_module_under(mOPCUA,"TYPES");
|
|
6
|
+
rb_define_const(mTYPES, "DATETIME", INT2NUM(UA_TYPES_DATETIME ));
|
|
7
|
+
rb_define_const(mTYPES, "BOOLEAN", INT2NUM(UA_TYPES_BOOLEAN ));
|
|
8
|
+
rb_define_const(mTYPES, "DOUBLE", INT2NUM(UA_TYPES_DOUBLE ));
|
|
9
|
+
rb_define_const(mTYPES, "INT32", INT2NUM(UA_TYPES_INT32 ));
|
|
10
|
+
rb_define_const(mTYPES, "INT16", INT2NUM(UA_TYPES_INT16 ));
|
|
11
|
+
rb_define_const(mTYPES, "UINT32", INT2NUM(UA_TYPES_UINT32 ));
|
|
12
|
+
rb_define_const(mTYPES, "UINT16", INT2NUM(UA_TYPES_UINT16 ));
|
|
13
|
+
rb_define_const(mTYPES, "STRING", INT2NUM(UA_TYPES_STRING ));
|
|
14
|
+
}/*}}}*/
|
|
15
|
+
|
|
2
16
|
static VALUE extract_value(UA_Variant value) { //{{{
|
|
3
17
|
VALUE ret = rb_ary_new2(2);
|
|
4
18
|
rb_ary_store(ret,0,Qnil);
|
|
@@ -7,7 +21,7 @@ static VALUE extract_value(UA_Variant value) { //{{{
|
|
|
7
21
|
if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_DATETIME])) {
|
|
8
22
|
UA_DateTime raw = *(UA_DateTime *) value.data;
|
|
9
23
|
rb_ary_store(ret,0,rb_time_new(UA_DateTime_toUnixTime(raw),0));
|
|
10
|
-
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.
|
|
24
|
+
rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.DateTime")));
|
|
11
25
|
} else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_BOOLEAN])) {
|
|
12
26
|
UA_Boolean raw = *(UA_Boolean *) value.data;
|
|
13
27
|
rb_ary_store(ret,0,raw ? Qtrue : Qfalse);
|
data/opcua.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "opcua"
|
|
3
|
-
s.version = "0.
|
|
3
|
+
s.version = "0.9"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.license = "LGPL-3.0"
|
|
6
6
|
s.summary = "Preliminary release of opcua (open62541) ruby bindings. C performance, Ruby elegance, simplicity, and productivity."
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opcua
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.9'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: tools
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2019-05-
|
|
12
|
+
date: 2019-05-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: daemonite
|