opcua 0.8 → 0.9
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40ef6e1e7d5811b00dff5fe8daa7671275982d53a8855683e4d821994e5d0a70
|
4
|
+
data.tar.gz: c98b8047328c957acf3d66398cbceecc11ea0bad80ac5335a1668be987f937a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45c3491d321d66d85583398d897e2aab10db564cbc9b292bc391f03d747b566a976df9ce93c354d5d01c891faa987f9bd6e337dc880e4ff9886d0eaf6c4ada45
|
7
|
+
data.tar.gz: bb5ba0109735859f65fc0dcb1ab5b06289927e978ca8a3f7e252861510b153272c6aaaf3bb2e1240c317fb2ad9b1cfc6fa544ab3c6e53c426d7b0ebd745bd67e
|
data/cert/cert.h
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
unsigned char cert_der[] = {
|
2
2
|
0x30, 0x82, 0x03, 0x18, 0x30, 0x82, 0x02, 0x00, 0xa0, 0x03, 0x02, 0x01,
|
3
|
-
0x02, 0x02, 0x14,
|
4
|
-
|
3
|
+
0x02, 0x02, 0x14, 0x1a, 0x52, 0xa3, 0x4f, 0xca, 0x24, 0xed, 0xba, 0x86,
|
4
|
+
0x05, 0x6b, 0x44, 0xd2, 0xf3, 0x73, 0x1d, 0x2d, 0xe0, 0x88, 0x5e, 0x30,
|
5
5
|
0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b,
|
6
6
|
0x05, 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
|
7
7
|
0x03, 0x0c, 0x0a, 0x72, 0x75, 0x62, 0x79, 0x2d, 0x6f, 0x70, 0x63, 0x75,
|
8
|
-
0x61, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x35,
|
9
|
-
0x30,
|
10
|
-
|
8
|
+
0x61, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x35, 0x32, 0x37, 0x32,
|
9
|
+
0x30, 0x30, 0x34, 0x31, 0x36, 0x5a, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x35,
|
10
|
+
0x31, 0x36, 0x32, 0x30, 0x30, 0x34, 0x31, 0x36, 0x5a, 0x30, 0x15, 0x31,
|
11
11
|
0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0a, 0x72, 0x75,
|
12
12
|
0x62, 0x79, 0x2d, 0x6f, 0x70, 0x63, 0x75, 0x61, 0x30, 0x82, 0x01, 0x22,
|
13
13
|
0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
|
14
14
|
0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a,
|
15
|
-
0x02, 0x82, 0x01, 0x01, 0x00,
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
15
|
+
0x02, 0x82, 0x01, 0x01, 0x00, 0x95, 0xed, 0xb3, 0xf7, 0xed, 0xe0, 0xa3,
|
16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c4, 0x79, 0xad, 0x01,
|
30
|
+
0xda, 0x74, 0xa9, 0x16, 0x1c, 0x01, 0x43, 0xe9, 0x2c, 0xcc, 0x62, 0x2b,
|
31
|
+
0xc0, 0x24, 0x4e, 0xfa, 0xc7, 0xbe, 0x1f, 0xed, 0xcb, 0xe2, 0x43, 0x12,
|
32
|
+
0xe3, 0x8d, 0x22, 0x0d, 0xc7, 0x94, 0xc5, 0x5a, 0x2a, 0x40, 0x4e, 0xaa,
|
33
|
+
0xba, 0xd5, 0xf6, 0x06, 0x86, 0xbf, 0x53, 0x86, 0x7e, 0x5e, 0x6f, 0x38,
|
34
|
+
0xde, 0x07, 0x07, 0x76, 0xf0, 0x32, 0x25, 0x23, 0x56, 0xb0, 0x4a, 0x16,
|
35
|
+
0x8f, 0x32, 0xaa, 0xc8, 0x1b, 0x27, 0xc9, 0xe3, 0x27, 0xdd, 0xfa, 0xa9,
|
36
|
+
0xb3, 0xac, 0xc4, 0xcc, 0x25, 0xe9, 0xb5, 0xb7, 0x37, 0x02, 0x03, 0x01,
|
37
37
|
0x00, 0x01, 0xa3, 0x60, 0x30, 0x5e, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d,
|
38
|
-
0x0e, 0x04, 0x16, 0x04, 0x14,
|
39
|
-
|
40
|
-
|
38
|
+
0x0e, 0x04, 0x16, 0x04, 0x14, 0x10, 0x1c, 0x46, 0xe6, 0x89, 0x14, 0xe0,
|
39
|
+
0xe3, 0x05, 0x8b, 0x74, 0xdd, 0x57, 0x74, 0xf9, 0x4b, 0x8e, 0x40, 0xdc,
|
40
|
+
0xbd, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
|
41
41
|
0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x1d,
|
42
42
|
0x11, 0x04, 0x15, 0x30, 0x13, 0x86, 0x11, 0x72, 0x75, 0x62, 0x79, 0x2d,
|
43
43
|
0x6f, 0x70, 0x63, 0x75, 0x61, 0x3a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
|
44
44
|
0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04,
|
45
45
|
0x03, 0x02, 0x05, 0xa0, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
|
46
46
|
0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00,
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
47
|
+
0x15, 0x04, 0xfb, 0x2d, 0x82, 0xaa, 0xc1, 0x88, 0xd2, 0x96, 0x6d, 0x40,
|
48
|
+
0x39, 0x1b, 0x1d, 0xe4, 0xb2, 0xf9, 0xa5, 0x99, 0xf8, 0xd7, 0x3d, 0xc9,
|
49
|
+
0xb1, 0x15, 0x53, 0xaf, 0xb3, 0xd7, 0xd5, 0x6e, 0x2a, 0x04, 0x22, 0x84,
|
50
|
+
0x87, 0x66, 0x09, 0xb3, 0x7e, 0xea, 0xa2, 0x53, 0xd9, 0x5c, 0x80, 0x15,
|
51
|
+
0x0b, 0x71, 0xff, 0x3a, 0x43, 0xd0, 0x08, 0x35, 0xe5, 0x98, 0xb7, 0xe6,
|
52
|
+
0xa5, 0xc0, 0x59, 0x98, 0xde, 0xae, 0x86, 0x33, 0xf9, 0x65, 0xbe, 0x61,
|
53
|
+
0x92, 0x50, 0x28, 0x8b, 0x42, 0x2b, 0x15, 0x4f, 0x5b, 0x00, 0x00, 0x73,
|
54
|
+
0x90, 0x32, 0x35, 0x0c, 0xe5, 0x07, 0xe3, 0x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
|
69
69
|
};
|
70
70
|
unsigned int cert_der_len = 796;
|
data/cert/cert_key.h
CHANGED
@@ -1,103 +1,103 @@
|
|
1
1
|
unsigned char cert_key_der[] = {
|
2
2
|
0x30, 0x82, 0x04, 0xa3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
0x00,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
0x0a,
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
3
|
+
0x95, 0xed, 0xb3, 0xf7, 0xed, 0xe0, 0xa3, 0x4e, 0x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xf0, 0x0f, 0x65, 0x9e, 0xb6, 0x5e, 0xd0, 0xc0, 0xd0, 0xd7, 0x6f, 0x7d,
|
101
|
+
0x62, 0xe3, 0x23
|
102
102
|
};
|
103
103
|
unsigned int cert_key_der_len = 1191;
|
data/example/server.rb
CHANGED
@@ -3,46 +3,68 @@ require_relative '../lib/opcua/server'
|
|
3
3
|
#require 'opcua/server'
|
4
4
|
|
5
5
|
Daemonite.new do
|
6
|
+
on startup do
|
7
|
+
@opts['server'] = OPCUA::Server.new
|
8
|
+
@opts['server'].add_namespace "https://centurio.work/kelch"
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
t.add_variable :SollWertX
|
12
|
-
t.add_variable :SollWertY
|
13
|
-
t.add_variable :SollWertZ
|
14
|
-
}
|
15
|
-
tt = server.types.add_object_type(:ToolType).tap{ |t|
|
16
|
-
t.add_variable :ToolNumber
|
17
|
-
t.add_variable :DuploNumber
|
18
|
-
t.add_variable :testValue1
|
19
|
-
t.add_object(:Measurements, server.types.folder).tap{ |u|
|
20
|
-
u.add_object :M, mt, OPCUA::OPTIONAL
|
10
|
+
mt = @opts['server'].types.add_object_type(:MeasurementType).tap{ |t|
|
11
|
+
t.add_variable :SollWertX
|
12
|
+
t.add_variable :SollWertY
|
13
|
+
t.add_variable :SollWertZ
|
21
14
|
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
15
|
+
tt = @opts['server'].types.add_object_type(:ToolType).tap{ |t|
|
16
|
+
t.add_variable :SollWertX
|
17
|
+
t.add_variable :SollWertY
|
18
|
+
t.add_variable :SollWertZ
|
19
|
+
t.add_variable :ToolNumber
|
20
|
+
t.add_variable :DuploNumber
|
21
|
+
t.add_variable :testValue1
|
22
|
+
t.add_method :testMethod, test1: OPCUA::TYPES::STRING, test2: OPCUA::TYPES::DATETIME do |node, test1, test2, test4|
|
23
|
+
ns, nid = node.id
|
24
|
+
p nid
|
25
|
+
p test1
|
26
|
+
p test2
|
27
|
+
p test4
|
28
|
+
puts 'me'
|
29
|
+
# do something
|
30
|
+
end
|
31
|
+
t.add_object(:Measurements, @opts['server'].types.folder).tap{ |u|
|
32
|
+
u.add_object :M, mt, OPCUA::OPTIONAL
|
33
|
+
}
|
34
|
+
}
|
35
|
+
pt = @opts['server'].types.add_object_type(:PresetterType).tap{ |t|
|
36
|
+
t.add_variable :ManufacturerName
|
37
|
+
t.add_object(:Tools, @opts['server'].types.folder).tap{ |u|
|
38
|
+
u.add_object :Tool, tt, OPCUA::OPTIONAL
|
39
|
+
}
|
27
40
|
}
|
28
|
-
}
|
29
41
|
|
30
|
-
|
42
|
+
tools = @opts['server'].objects.manifest(:KalimatC34, pt).find(:Tools)
|
31
43
|
|
32
|
-
|
33
|
-
|
34
|
-
|
44
|
+
t1 = tools.manifest(:Tool1,tt)
|
45
|
+
t2 = tools.manifest(:Tool2,tt)
|
46
|
+
t3 = tools.manifest(:Tool3,tt)
|
35
47
|
|
36
|
-
|
48
|
+
@opts[:tn] = t1.find(:ToolNumber)
|
37
49
|
|
38
|
-
|
39
|
-
|
40
|
-
|
50
|
+
measurments_t1 = t1.find(:Measurements)
|
51
|
+
measurments_t1.manifest(:M1,mt)
|
52
|
+
measurments_t1.manifest(:M2,mt)
|
41
53
|
|
42
|
-
|
54
|
+
rescue => e
|
55
|
+
puts e.message
|
56
|
+
end
|
43
57
|
|
44
58
|
run do
|
45
|
-
|
46
|
-
|
59
|
+
GC.start
|
60
|
+
sleep @opts['server'].run
|
61
|
+
@opts[:tn].value = Time.now
|
62
|
+
rescue => e
|
63
|
+
puts e.message
|
64
|
+
end
|
65
|
+
|
66
|
+
on exit do
|
67
|
+
# we could disconnect here, but OPCUA::Server does not have an explicit disconnect
|
68
|
+
puts 'bye.'
|
47
69
|
end
|
48
70
|
end.loop!
|
data/ext/opcua/client/client.c
CHANGED
@@ -6,6 +6,8 @@ VALUE mOPCUA = Qnil;
|
|
6
6
|
VALUE cClient = Qnil;
|
7
7
|
VALUE cNode = Qnil;
|
8
8
|
|
9
|
+
#include "../values.h"
|
10
|
+
|
9
11
|
/* -- */
|
10
12
|
static void node_free(node_struct *ns) { //{{{
|
11
13
|
if (ns != NULL) {
|
@@ -19,7 +21,7 @@ static VALUE node_alloc(VALUE klass, client_struct *client, UA_NodeId nodeid) {
|
|
19
21
|
if (ns == NULL)
|
20
22
|
rb_raise(rb_eNoMemError, "No memory left for node.");
|
21
23
|
|
22
|
-
ns->
|
24
|
+
ns->master = client;
|
23
25
|
ns->id = nodeid;
|
24
26
|
ns->on_change = Qnil;
|
25
27
|
|
@@ -29,11 +31,11 @@ static VALUE node_alloc(VALUE klass, client_struct *client, UA_NodeId nodeid) {
|
|
29
31
|
static VALUE node_value(VALUE self) { //{{{
|
30
32
|
node_struct *ns;
|
31
33
|
Data_Get_Struct(self, node_struct, ns);
|
32
|
-
if (!ns->
|
34
|
+
if (!ns->master->started) rb_raise(rb_eRuntimeError, "Client disconnected.");
|
33
35
|
|
34
36
|
UA_Variant value;
|
35
37
|
UA_Variant_init(&value);
|
36
|
-
UA_StatusCode retval = UA_Client_readValueAttribute(ns->
|
38
|
+
UA_StatusCode retval = UA_Client_readValueAttribute(ns->master->master, ns->id, &value);
|
37
39
|
|
38
40
|
VALUE ret = Qnil;
|
39
41
|
if (retval == UA_STATUSCODE_GOOD) {
|
@@ -46,7 +48,7 @@ static VALUE node_value(VALUE self) { //{{{
|
|
46
48
|
static VALUE node_on_change(VALUE self) { //{{{
|
47
49
|
node_struct *ns;
|
48
50
|
Data_Get_Struct(self, node_struct, ns);
|
49
|
-
if (!ns->
|
51
|
+
if (!ns->master->started) rb_raise(rb_eRuntimeError, "Client disconnected.");
|
50
52
|
|
51
53
|
if (!rb_block_given_p())
|
52
54
|
rb_raise(rb_eArgError, "you need to supply a block with #on_change");
|
@@ -54,8 +56,8 @@ static VALUE node_on_change(VALUE self) { //{{{
|
|
54
56
|
ns->on_change = rb_block_proc();
|
55
57
|
rb_gc_register_address(&ns->on_change);
|
56
58
|
|
57
|
-
rb_ary_push(ns->
|
58
|
-
ns->
|
59
|
+
rb_ary_push(ns->master->subs,self);
|
60
|
+
ns->master->subs_changed = true;
|
59
61
|
|
60
62
|
return self;
|
61
63
|
} //}}}
|
@@ -65,10 +67,10 @@ static void client_free(client_struct *pss) { //{{{
|
|
65
67
|
if (pss != NULL) {
|
66
68
|
if (!pss->firstrun) {
|
67
69
|
// do we need to delete the individual monResponse (#UA_MonitoredItemCreateResult_clear)?
|
68
|
-
UA_Client_Subscriptions_deleteSingle(pss->
|
70
|
+
UA_Client_Subscriptions_deleteSingle(pss->master,pss->subscription_response.subscriptionId);
|
69
71
|
}
|
70
|
-
UA_Client_disconnect(pss->
|
71
|
-
UA_Client_delete(pss->
|
72
|
+
UA_Client_disconnect(pss->master);
|
73
|
+
UA_Client_delete(pss->master);
|
72
74
|
free(pss);
|
73
75
|
}
|
74
76
|
} //}}}
|
@@ -78,8 +80,8 @@ static VALUE client_alloc(VALUE self) { //{{{
|
|
78
80
|
if (pss == NULL)
|
79
81
|
rb_raise(rb_eNoMemError, "No memory left for OPCUA client.");
|
80
82
|
|
81
|
-
pss->
|
82
|
-
pss->config = UA_Client_getConfig(pss->
|
83
|
+
pss->master = UA_Client_new();
|
84
|
+
pss->config = UA_Client_getConfig(pss->master);
|
83
85
|
pss->firstrun = true;
|
84
86
|
pss->started = true;
|
85
87
|
pss->debug = true;
|
@@ -141,11 +143,11 @@ static VALUE client_init(VALUE self,VALUE url,VALUE user,VALUE pass) { //{{{
|
|
141
143
|
// /* Listing endpoints */
|
142
144
|
// UA_EndpointDescription* endpointArray = NULL;
|
143
145
|
// size_t endpointArraySize = 0;
|
144
|
-
// retval = UA_Client_getEndpoints(pss->
|
146
|
+
// retval = UA_Client_getEndpoints(pss->master, "opc.tcp://localhost:4840",
|
145
147
|
// &endpointArraySize, &endpointArray);
|
146
148
|
// if(retval != UA_STATUSCODE_GOOD) {
|
147
149
|
// UA_Array_delete(endpointArray, endpointArraySize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
|
148
|
-
// UA_Client_delete(pss->
|
150
|
+
// UA_Client_delete(pss->master);
|
149
151
|
// return EXIT_FAILURE;
|
150
152
|
// }
|
151
153
|
// printf("%i endpoints found\n", (int)endpointArraySize);
|
@@ -182,7 +184,7 @@ static VALUE client_init(VALUE self,VALUE url,VALUE user,VALUE pass) { //{{{
|
|
182
184
|
//}}}
|
183
185
|
|
184
186
|
if (NIL_P(user) || NIL_P(pass)) {
|
185
|
-
retval = UA_Client_connect(pss->
|
187
|
+
retval = UA_Client_connect(pss->master,nstr);
|
186
188
|
} else {
|
187
189
|
VALUE vustr = rb_obj_as_string(user);
|
188
190
|
if (NIL_P(vustr) || TYPE(vustr) != T_STRING) {
|
@@ -198,7 +200,7 @@ static VALUE client_init(VALUE self,VALUE url,VALUE user,VALUE pass) { //{{{
|
|
198
200
|
}
|
199
201
|
char *pstr = (char *)StringValuePtr(vpstr);
|
200
202
|
|
201
|
-
retval = UA_Client_connect_username(pss->
|
203
|
+
retval = UA_Client_connect_username(pss->master, nstr, ustr, pstr);
|
202
204
|
}
|
203
205
|
if (retval != UA_STATUSCODE_GOOD) {
|
204
206
|
pss->started = false;
|
@@ -292,7 +294,7 @@ static void client_run_iterate(VALUE key) { //{{{
|
|
292
294
|
UA_MonitoredItemCreateRequest monRequest = UA_MonitoredItemCreateRequest_default(ns->id);
|
293
295
|
|
294
296
|
UA_MonitoredItemCreateResult monResponse =
|
295
|
-
UA_Client_MonitoredItems_createDataChange(ns->
|
297
|
+
UA_Client_MonitoredItems_createDataChange(ns->master->master, ns->master->subscription_response.subscriptionId,
|
296
298
|
UA_TIMESTAMPSTORETURN_BOTH,
|
297
299
|
monRequest, (void *)ns->on_change, client_run_handler, NULL);
|
298
300
|
|
@@ -308,7 +310,7 @@ static VALUE client_run(VALUE self) { //{{{
|
|
308
310
|
if (pss->firstrun) {
|
309
311
|
pss->firstrun = false;
|
310
312
|
pss->subs_changed = false;
|
311
|
-
pss->subscription_response = UA_Client_Subscriptions_create(pss->
|
313
|
+
pss->subscription_response = UA_Client_Subscriptions_create(pss->master, pss->subscription_request, NULL, NULL, NULL);
|
312
314
|
if (pss->subscription_response.responseHeader.serviceResult != UA_STATUSCODE_GOOD)
|
313
315
|
rb_raise(rb_eRuntimeError, "Subscription could not be created.");
|
314
316
|
|
@@ -316,7 +318,7 @@ static VALUE client_run(VALUE self) { //{{{
|
|
316
318
|
client_run_iterate(rb_ary_entry(pss->subs,i));
|
317
319
|
}
|
318
320
|
}
|
319
|
-
UA_Client_run_iterate(pss->
|
321
|
+
UA_Client_run_iterate(pss->master, 100);
|
320
322
|
|
321
323
|
return self;
|
322
324
|
} //}}}
|
@@ -327,9 +329,9 @@ static VALUE client_disconnect(VALUE self) { //{{{
|
|
327
329
|
|
328
330
|
if (!pss->firstrun) {
|
329
331
|
// do we need to delete the individual monResponse (#UA_MonitoredItemCreateResult_clear)?
|
330
|
-
UA_Client_Subscriptions_deleteSingle(pss->
|
332
|
+
UA_Client_Subscriptions_deleteSingle(pss->master,pss->subscription_response.subscriptionId);
|
331
333
|
}
|
332
|
-
UA_Client_disconnect(pss->
|
334
|
+
UA_Client_disconnect(pss->master);
|
333
335
|
pss->started = false;
|
334
336
|
|
335
337
|
return self;
|
@@ -341,6 +343,8 @@ void Init_client(void) {
|
|
341
343
|
cClient = rb_define_class_under(mOPCUA, "Client", rb_cObject);
|
342
344
|
cNode = rb_define_class_under(mOPCUA, "cNode", rb_cObject);
|
343
345
|
|
346
|
+
Init_types();
|
347
|
+
|
344
348
|
rb_define_alloc_func(cClient, client_alloc);
|
345
349
|
rb_define_method(cClient, "initialize", client_init, 3);
|
346
350
|
rb_define_method(cClient, "disconnect", client_disconnect, 0);
|