opcua 0.18 → 0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85b04352361150d99adee5b0b2ca5b5c97556affccf4d0247a6d8c4f574dca88
4
- data.tar.gz: fb689c1e775847bd9921a70029334533052cf54cae2ec4e0733de26ee5058eb5
3
+ metadata.gz: d8dcaa5330c6deae969a19a92bc28135e7f36fe6874751fd9bd326b842146fe0
4
+ data.tar.gz: 78ee9260ae642df11ce37a8c31efcfec1163d934bcf2a45e136825c1283dfdec
5
5
  SHA512:
6
- metadata.gz: 1f45bf2700c9a6870c1797951e8d00891b8fc7e9a704674eb04696d1f1e00cde69cb55fff521437cc6534e5ea5dba6d28956866e950840647d4edf94721996e4
7
- data.tar.gz: 75be7819729e8b69e169e37cfd1290e57760ab5429c86d46d392690634c748a568590669e2aebcaa6f36294125291be2664ec25e314108e391aae9ace45f6229
6
+ metadata.gz: b24d0482f69adce2ca411693536ead0d4c303dda52eb287bcca371dd27b3a621b2c5ca86446b646b811b856b73f7015f95c43bb23a8938ba18fe7027d46a4ceb
7
+ data.tar.gz: 8c24ada718c0effed4a142bf31d1f0a557793ca833ca38dd242f847336967d81892478033e33c2ccbac2ac53664e2e761adffc62ea9d1a84757456c616f1b00c
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OPC-UA Ruby Bindings (open62541)
2
2
 
3
- The development of OPC UA applications takes currently a lot of effort. This is caused by the large possibilities of the OPC UA specification. With this implemtation we want to define some conventions, which shoud make the technology more useable.
3
+ The development of OPC UA applications takes currently a lot of effort. This is caused by the large possibilities of the OPC UA specification. With this implementation we want to define some conventions, which shoud make the technology more useable.
4
4
 
5
5
  ## Table of Contents
6
6
 
@@ -33,32 +33,28 @@ Copyright (C) 2019-* Jürgen "eTM" Mangler <juergen.mangler@gmail.com>. opcua-sm
33
33
 
34
34
  ```sh
35
35
  # Debian/Ubuntu
36
- apt install build-essential cmake-curses-gui libmbedtls-dev libxml2-dev libxslt-dev libz-dev libssl-dev libicu-dev
36
+ apt install build-essential cmake-curses-gui libmbedtls-dev libxml2-dev libxslt-dev libz-dev libssl-dev libicu-dev
37
37
  # Fedora/Redhat
38
38
  dnf install @buildsys-build @development-tools cmake libxml2-devel libxslt-devel zlib-devel libicu-devel mbedtls-devel
39
39
  ```
40
40
 
41
- Dependency: https://github.com/open62541/open62541 > 0.4 (master branch as of 2019-04-26)
41
+ Dependency: https://github.com/open62541/open62541 > 1.1 (master branch as of 2020-06-04)
42
42
 
43
43
  ```sh
44
44
  git clone https://github.com/open62541/open62541.git
45
45
  cd open62541
46
- mkdir build
47
- cd build
48
- cmake ..
49
- ccmake ..
50
- # Configuration, see picture below
46
+ mkdir build && cd build
47
+ cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_AMALGAMATION=ON -DUA_ENABLE_ENCRYPTION=ON -DUA_ENABLE_ENCRYPTION_MBEDTLS=ON ..
51
48
  make
52
49
  sudo make install
53
50
  gem install opcua
54
51
  ```
55
52
 
56
- ![ccmake Config](config.png)
57
-
58
53
  If the installation works correctly, but examples are still complaining about missing lib62541.so, try this:
59
54
 
60
55
  ```sh
61
- sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf # add to libs path
56
+ sudo echo "/usr/local/lib" >> /etc/ld.so.conf.d/local.conf # add to libs path
57
+ sudo echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local.conf # add to libs path
62
58
  sudo ldconfig # update libs
63
59
  sudo ldconfig -p | grep libopen62541 # check if its there
64
60
  ```
@@ -75,7 +71,7 @@ The server has following functions:
75
71
  * Find nodes in the adress space
76
72
  * Loop for getting real life data
77
73
 
78
- Every server application uses the Demonite gem, which allows to run the server as service.
74
+ Every server application uses the Daemonite gem, which allows to run the server as service.
79
75
  ```ruby
80
76
  Daemonite.new do
81
77
  on startup do |opts|
@@ -101,7 +97,7 @@ server.add_namespace "https://yourdomain/testserver"
101
97
  ```
102
98
 
103
99
 
104
- #### Create ObjectTypes
100
+ #### Create ObjectTypes
105
101
 
106
102
  Basically all new created types are subtypes of the _BaseObjectType_. With ```server.types.add_object_type(:TestObjectType)``` a new type is defined in the information model. All nodes of the new created type are defined in the ```tap{}``` region.
107
103
 
@@ -137,7 +133,7 @@ With ```.add_object(:TestObject)``` a new object named _TestObject_ is added. Th
137
133
 
138
134
  ##### Add Method
139
135
 
140
- Methods are added with the ```.add_method(:TestMethod)``` function. Per default the method has no input and output arguments. By adding additional arguments you can define input arguments. The code for defining a method with input arguments looks like
136
+ Methods are added with the ```.add_method(:TestMethod)``` function. Per default the method has no input and output arguments. By adding additional arguments you can define input arguments. The code for defining a method with input arguments looks like
141
137
  ```ruby
142
138
  t.add_method :TestMethod, inputarg1: OPCUA::TYPES::STRING, inputarg2: OPCUA::TYPES::DATETIME do |node, inputarg1, inputarg2|
143
139
  #do some stuff here
@@ -148,7 +144,7 @@ in the ```do...end```section you write the code which should be executed by call
148
144
 
149
145
  #### Manifest Objects
150
146
 
151
- ObjectTypes can be instiantiated with the ```.manifest``` method.
147
+ ObjectTypes can be instiantiated with the ```.manifest``` method.
152
148
 
153
149
  ```ruby
154
150
  testobject =server.objects.manifest(:TestObjectType, to)
@@ -164,7 +160,7 @@ testobject.delete!
164
160
 
165
161
  #### Find Nodes in the Addressspace
166
162
 
167
- To get a specific node you should use the ```.find``` method.
163
+ To get a specific node you should use the ```.find``` method.
168
164
  ```ruby
169
165
  tv = to.find :TestVariable
170
166
  ```
@@ -195,7 +191,7 @@ You can assign vlaues without definig a datatype. The correct _DataType_ will be
195
191
  #### Loop for getting Real Life Data
196
192
  The server loop looks like follows:
197
193
  ```ruby
198
- run do
194
+ run do
199
195
  sleep server.run
200
196
  to.value = 'Testvariable1'
201
197
  p to.value
@@ -204,7 +200,7 @@ The server loop looks like follows:
204
200
  end
205
201
  ```
206
202
 
207
- The loop starts with ```sleep server.run```. This is recommended by the open62541 developer. With the ```.value``` function you can write or get the value of a node.
203
+ The loop starts with ```sleep server.run```. This is recommended by the open62541 developer. With the ```.value``` function you can write or get the value of a node.
208
204
 
209
205
  ### Client
210
206
  TBD. See examples subdirectory.
data/Rakefile CHANGED
@@ -28,10 +28,16 @@ Gem::PackageTask.new(spec) do |pkg|
28
28
  FileUtils.ln_sf "#{pkg.name}.gem", "pkg/#{spec.name}.gem"
29
29
  end
30
30
 
31
- task :push => :gem do |r|
31
+ task :push => :gem do
32
32
  `gem push pkg/opcua.gem`
33
33
  end
34
34
 
35
- task :install => :gem do |r|
35
+ task :install => :gem do
36
36
  `gem install pkg/opcua.gem`
37
37
  end
38
+
39
+ task :clean do
40
+ FileUtils.rm_rf(File.join(__dir__,'tmp'))
41
+ FileUtils.rm_rf(File.join(__dir__,'lib','opcua','client.so'))
42
+ FileUtils.rm_rf(File.join(__dir__,'lib','opcua','server.so'))
43
+ end
@@ -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, 0x46, 0x2d, 0x1b, 0x12, 0x4a, 0xae, 0x88, 0xed, 0xa5,
4
- 0xdd, 0xbe, 0xe3, 0x9b, 0x50, 0x2e, 0xec, 0x6b, 0x28, 0x15, 0x4f, 0x30,
3
+ 0x02, 0x02, 0x14, 0x76, 0x85, 0x88, 0xf4, 0x2b, 0xce, 0xa3, 0xe1, 0xcf,
4
+ 0x6b, 0xfe, 0xee, 0x14, 0x02, 0xd8, 0x25, 0xa4, 0x09, 0x5b, 0x26, 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, 0x32, 0x30, 0x30, 0x33, 0x31, 0x38, 0x31,
9
- 0x37, 0x33, 0x33, 0x35, 0x39, 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x33,
10
- 0x30, 0x38, 0x31, 0x37, 0x33, 0x33, 0x35, 0x39, 0x5a, 0x30, 0x15, 0x31,
8
+ 0x61, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x31, 0x32, 0x35, 0x31,
9
+ 0x31, 0x31, 0x39, 0x30, 0x38, 0x5a, 0x17, 0x0d, 0x32, 0x32, 0x30, 0x31,
10
+ 0x31, 0x35, 0x31, 0x31, 0x31, 0x39, 0x30, 0x38, 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, 0xc7, 0xf0, 0xff, 0x6d, 0xed, 0xd0, 0xf2,
16
- 0x3c, 0x0f, 0x8f, 0xce, 0x17, 0x49, 0x2a, 0x82, 0x44, 0x37, 0x09, 0x3c,
17
- 0x31, 0xf5, 0x56, 0xe7, 0x63, 0x76, 0x20, 0x2e, 0x6f, 0xb6, 0xc9, 0x78,
18
- 0x8d, 0xbb, 0x2a, 0x57, 0x1b, 0x0b, 0xdf, 0x93, 0xda, 0xbe, 0x17, 0x19,
19
- 0xc3, 0x53, 0x0c, 0xd3, 0x3a, 0x63, 0xef, 0xc4, 0x58, 0x70, 0x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x04, 0x16, 0x04, 0x14, 0x08, 0x0d, 0xc8, 0xe7, 0xe4, 0x35, 0x67,
39
+ 0x1c, 0x33, 0xd6, 0xcc, 0xf2, 0xc1, 0x52, 0x94, 0x78, 0x15, 0xee, 0x47,
40
+ 0x8b, 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
- 0x05, 0x76, 0x65, 0xf3, 0xc1, 0xa8, 0x68, 0x71, 0x3b, 0x31, 0xd7, 0xbb,
48
- 0x50, 0x60, 0x0e, 0xa6, 0x76, 0x1e, 0x47, 0x41, 0x4d, 0x8d, 0x80, 0x01,
49
- 0x04, 0xec, 0x56, 0xad, 0xe9, 0x02, 0xb6, 0xfa, 0x73, 0x67, 0x85, 0xcc,
50
- 0xa8, 0x8b, 0x4c, 0x51, 0x48, 0x19, 0x4e, 0xe0, 0x72, 0xe3, 0x67, 0xbc,
51
- 0xb0, 0x14, 0x2b, 0xd1, 0x9b, 0x38, 0x26, 0xd9, 0xa8, 0x86, 0x4a, 0xea,
52
- 0x7b, 0x1a, 0x5f, 0x3e, 0x81, 0xbf, 0xeb, 0x49, 0xbc, 0x06, 0x98, 0xbb,
53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, 0xa7, 0x18, 0x84, 0xdc, 0xe4, 0x8f, 0xc2,
61
+ 0xe9, 0xcf, 0xf3, 0xa3, 0xa8, 0x42, 0x8e, 0xe7, 0x92, 0x87, 0x00, 0x94,
62
+ 0x51, 0x3a, 0xae, 0x33, 0x66, 0xc9, 0xc5, 0x90, 0xd4, 0x31, 0x70, 0x2d,
63
+ 0x19, 0x35, 0x1a, 0x4a, 0x49, 0x06, 0x00, 0x4c, 0x48, 0xe5, 0x40, 0xd4,
64
+ 0xb0, 0x3d, 0x04, 0xc9, 0xce, 0x57, 0x6c, 0x4c, 0x01, 0x87, 0x19, 0x22,
65
+ 0xd6, 0xb7, 0x2f, 0x31, 0x32, 0x7a, 0x3c, 0x20, 0xc2, 0xfe, 0x85, 0x2c,
66
+ 0x5b, 0x04, 0xcb, 0x86, 0xf8, 0x1c, 0x66, 0x08, 0x7d, 0x73, 0x91, 0x14,
67
+ 0x74, 0x6e, 0xa8, 0xc4, 0x3f, 0x70, 0xb6, 0xa7, 0xde, 0x77, 0xc4, 0x1a,
68
+ 0x24, 0x93, 0x25, 0xb7
69
69
  };
70
70
  unsigned int cert_der_len = 796;
@@ -1,103 +1,103 @@
1
1
  unsigned char cert_key_der[] = {
2
- 0x30, 0x82, 0x04, 0xa2, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
3
- 0xc7, 0xf0, 0xff, 0x6d, 0xed, 0xd0, 0xf2, 0x3c, 0x0f, 0x8f, 0xce, 0x17,
4
- 0x49, 0x2a, 0x82, 0x44, 0x37, 0x09, 0x3c, 0x31, 0xf5, 0x56, 0xe7, 0x63,
5
- 0x76, 0x20, 0x2e, 0x6f, 0xb6, 0xc9, 0x78, 0x8d, 0xbb, 0x2a, 0x57, 0x1b,
6
- 0x0b, 0xdf, 0x93, 0xda, 0xbe, 0x17, 0x19, 0xc3, 0x53, 0x0c, 0xd3, 0x3a,
7
- 0x63, 0xef, 0xc4, 0x58, 0x70, 0x6a, 0xa6, 0x3b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0xbd,
96
+ 0x46, 0x22, 0x63, 0x77, 0x81, 0x43, 0x4f, 0x3e, 0x52, 0x1b, 0x1a, 0xf3,
97
+ 0x1c, 0x88, 0x6d, 0x7f, 0xfc, 0x64, 0xfa, 0x13, 0x1d, 0x90, 0x84, 0x42,
98
+ 0x33, 0x1e, 0x9b, 0xd5, 0x32, 0x19, 0x34, 0x8e, 0xee, 0xad, 0x43, 0x7a,
99
+ 0xe6, 0xac, 0xab, 0xce, 0xf3, 0xeb, 0xcc, 0xef, 0xbb, 0xc0, 0x22, 0x77,
100
+ 0x4f, 0x87, 0x6b, 0x29, 0xd3, 0x78, 0xc0, 0x30, 0xee, 0xbc, 0x17, 0x29,
101
+ 0x9b, 0x15, 0x82, 0x85, 0x6e, 0x9d
102
102
  };
103
- unsigned int cert_key_der_len = 1190;
103
+ unsigned int cert_key_der_len = 1194;
@@ -14,7 +14,7 @@ Daemonite.new do
14
14
  t.add_object :M, mt, OPCUA::MANDATORY
15
15
  }
16
16
 
17
- tools = server.objects.instantiate(:KalimatC34, tt)
17
+ tools = server.objects.manifest(:KalimatC34, tt)
18
18
 
19
19
  run do
20
20
  sleep server.run
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/ruby
2
+ require_relative '../lib/opcua/client'
3
+
4
+ client = OPCUA::Client.new("opc.tcp://128.130.57.76:4840")
5
+ client.subscription_interval = 100 # default 500
6
+
7
+ if (node = client.get 1, 'DISPLAY_VOLTAGE') # get node from nodeid
8
+ p node
9
+ p node.value
10
+ else
11
+ p 'invalid nodeid'
12
+ end
@@ -0,0 +1 @@
1
+ 14508
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/ruby
2
+ require_relative '../lib/opcua/server'
3
+ #require 'opcua/server'
4
+
5
+ Daemonite.new do
6
+ on startup do |opts|
7
+ opts['server'] = OPCUA::Server.new
8
+ opts['server'].add_namespace "https://centurio.work/kelch"
9
+
10
+ t = opts['server'].types.add_object_type(:Test).tap{ |t|
11
+ t.add_variable_rw :Wert do |node,value,external|
12
+ p node.id
13
+ p value
14
+ p external
15
+ end
16
+ }
17
+
18
+ v = opts['server'].objects.manifest(:Tester, t)
19
+
20
+ opts['value'] = v.find :Wert
21
+ rescue => e
22
+ puts e.message
23
+ end
24
+
25
+ run do |opts|
26
+ opts['server'].run
27
+ opts['value'].value = rand
28
+ sleep 1
29
+ rescue => e
30
+ puts e.message
31
+ end
32
+
33
+ on exit do
34
+ # we could disconnect here, but OPCUA::Server does not have an explicit disconnect
35
+ puts 'bye.'
36
+ end
37
+ end.loop!
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/ruby
2
+ require_relative '../lib/opcua/server'
3
+
4
+ Daemonite.new do
5
+ on startup do |opts|
6
+ srv = opts['server'] = OPCUA::Server.new
7
+ srv.import_UA # FIX
8
+ srv.import_nodeset File::read('nodeset1.xml')
9
+ srv.import_nodeset File::read('nodeset1.xml')
10
+ srv.import_nodeset File::read('nodeset1.xml')
11
+ DI = srv.imports['http://xxxxx/DI']
12
+ AID = srv.imports['http://xxxxx/AutoID']
13
+
14
+ srv.objects
15
+
16
+ # ab 106 im nodesets.rb
17
+ x = srv.data_types.add(qualifiedname,referencetype=UA::HasSubtype,nodeid=rand())
18
+ x.displayname['en-US'] = 'rrr'
19
+ x.displayname['de'] = 'rrr'
20
+ x.displayname.delete('de')
21
+
22
+ srv.data_types.bla.blurg.add(wieheissts')
23
+ srv.data_types.bla.blurg.push(wieheissts')
24
+ srv.data_types.bla.blurg.<<('wieheissts')
25
+ x = srv.data_types.bla.find name: 'bla', type: SUBXXXX
26
+ [x] = srv.data_types.bla.find_all name: 'bla', type: SUBXXXX
27
+ [x] = srv.data_types.bla.select name: 'bla', type: SUBXXXX
28
+ srv.data_types.bla.parent
29
+
30
+ # srv.event_types
31
+ # srv.interfaces_types
32
+
33
+ srv.reference_types.add(qualifiedname,symmetric,referencetype,nodeid)
34
+ srv.reference_types.add_symmetric(qualifiedname,referencetype,nodeid)
35
+
36
+ srv.variable_types
37
+ srv.object_types
38
+
39
+ p server.add_namespace "https://centurio.work/kelch"
40
+ p server.active_namespace
41
+ server.active_namespace = 0
42
+ p server.active_namespace
43
+ p server.namespaces
44
+
45
+
46
+ tools = opts['server'].objects.manifest(:KalimatC34, pt).find(:Tools)
47
+
48
+ t1 = tools.manifest(:Tool1,tt)
49
+ t2 = tools.manifest(:Tool2,tt)
50
+ t3 = tools.manifest(:Tool3,tt)
51
+
52
+ opts[:tn] = t1.find(:ToolNumber)
53
+ opts[:tn].description = 'test test'
54
+ opts[:tn].value = [0,1]
55
+ p opts[:tn].description
56
+ p opts[:tn].to_s
57
+ p opts[:tn].name
58
+
59
+ measurments_t1 = t1.find(:Measurements)
60
+ measurments_t1.manifest(:M1,mt)
61
+ m2 = measurments_t1.manifest(:M2,mt)
62
+ rescue => e
63
+ puts e.message
64
+ end
65
+
66
+
67
+ counter = 0
68
+ run do |opts|
69
+ GC.start
70
+ sleep opts['server'].run
71
+ # if counter % 100 == 0
72
+ # opts[:tn].value = [counter, counter]
73
+ # # opts[:tn].value = 1
74
+ # p opts[:tn].value
75
+ # end
76
+ # counter += 1
77
+ rescue => e
78
+ puts e.message
79
+ end
80
+
81
+ on exit do
82
+ # we could disconnect here, but OPCUA::Server does not have an explicit disconnect
83
+ puts 'bye.'
84
+ end
85
+ end.loop!
@@ -320,7 +320,7 @@ static VALUE client_init(VALUE self,VALUE url,VALUE user,VALUE pass) { //{{{
320
320
  }
321
321
  char *pstr = (char *)StringValuePtr(vpstr);
322
322
 
323
- retval = UA_Client_connect_username(pss->master, nstr, ustr, pstr);
323
+ retval = UA_Client_connectUsername(pss->master, nstr, ustr, pstr);
324
324
  }
325
325
  if (retval != UA_STATUSCODE_GOOD) {
326
326
  pss->started = false;
@@ -154,8 +154,16 @@ bool value_to_variant(VALUE value, UA_Variant *variant, UA_UInt32 proposal) { //
154
154
  case T_SYMBOL:
155
155
  {
156
156
  VALUE str = rb_obj_as_string(value);
157
- UA_String tmp = UA_STRING(StringValuePtr(str));
158
- UA_Variant_setScalarCopy(variant, &tmp, &UA_TYPES[UA_TYPES_STRING]);
157
+ if (proposal == UA_TYPES_BYTESTRING) {
158
+ UA_ByteString tmp = UA_BYTESTRING(StringValuePtr(str));
159
+ UA_Variant_setScalarCopy(variant, &tmp, &UA_TYPES[UA_TYPES_BYTESTRING]);
160
+ } else if (proposal == UA_TYPES_NODEID) {
161
+ UA_NodeId tmp = UA_NODEID(StringValuePtr(str));
162
+ UA_Variant_setScalarCopy(variant, &tmp, &UA_TYPES[UA_TYPES_NODEID]);
163
+ } else {
164
+ UA_String tmp = UA_STRING(StringValuePtr(str));
165
+ UA_Variant_setScalarCopy(variant, &tmp, &UA_TYPES[UA_TYPES_STRING]);
166
+ }
159
167
  done = true;
160
168
  break;
161
169
  }
@@ -175,12 +183,15 @@ void Init_types(VALUE mOPCUA) {/*{{{*/
175
183
  mTYPES = rb_define_module_under(mOPCUA,"TYPES");
176
184
  rb_define_const(mTYPES, "DATETIME", INT2NUM(UA_TYPES_DATETIME ));
177
185
  rb_define_const(mTYPES, "BOOLEAN", INT2NUM(UA_TYPES_BOOLEAN ));
186
+ rb_define_const(mTYPES, "FLOAT", INT2NUM(UA_TYPES_FLOAT ));
178
187
  rb_define_const(mTYPES, "DOUBLE", INT2NUM(UA_TYPES_DOUBLE ));
179
188
  rb_define_const(mTYPES, "INT32", INT2NUM(UA_TYPES_INT32 ));
180
189
  rb_define_const(mTYPES, "INT16", INT2NUM(UA_TYPES_INT16 ));
181
190
  rb_define_const(mTYPES, "UINT32", INT2NUM(UA_TYPES_UINT32 ));
182
191
  rb_define_const(mTYPES, "UINT16", INT2NUM(UA_TYPES_UINT16 ));
183
192
  rb_define_const(mTYPES, "STRING", INT2NUM(UA_TYPES_STRING ));
193
+ rb_define_const(mTYPES, "BYTESTRING", INT2NUM(UA_TYPES_BYTESTRING ));
194
+ rb_define_const(mTYPES, "NODEID", INT2NUM(UA_TYPES_NODEID ));
184
195
  }/*}}}*/
185
196
 
186
197
  static VALUE UA_TYPES_DATETIME_to_value(UA_DateTime data) { //{{{
@@ -189,6 +200,9 @@ static VALUE UA_TYPES_DATETIME_to_value(UA_DateTime data) { //{{{
189
200
  static VALUE UA_TYPES_BOOLEAN_to_value(UA_Boolean data) { //{{{
190
201
  return data ? Qtrue : Qfalse;
191
202
  } //}}}
203
+ static VALUE UA_TYPES_FLOAT_to_value(UA_Float data) { //{{{
204
+ return DBL2NUM((double)data);
205
+ } //}}}
192
206
  static VALUE UA_TYPES_DOUBLE_to_value(UA_Double data) { //{{{
193
207
  return DBL2NUM(data);
194
208
  } //}}}
@@ -213,6 +227,9 @@ static VALUE UA_TYPES_UINT16_to_value(UA_UInt16 data) { //{{{
213
227
  static VALUE UA_TYPES_STRING_to_value(UA_String data) { //{{{
214
228
  return rb_str_export_locale(rb_str_new((char *)(data.data),data.length));
215
229
  } //}}}
230
+ static VALUE UA_TYPES_BYTESTRING_to_value(UA_ByteString data) { //{{{
231
+ return rb_str_export_locale(rb_str_new((char *)(data.data),data.length));
232
+ } //}}}
216
233
 
217
234
  VALUE extract_value(UA_Variant value) { //{{{
218
235
  VALUE ret = rb_ary_new2(2);
@@ -228,6 +245,9 @@ VALUE extract_value(UA_Variant value) { //{{{
228
245
  } else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_BOOLEAN])) {
229
246
  rb_ary_store(ret,0,UA_TYPES_BOOLEAN_to_value(*(UA_Boolean *)value.data));
230
247
  rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Boolean")));
248
+ } else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_FLOAT])) {
249
+ rb_ary_store(ret,0,UA_TYPES_FLOAT_to_value(*(UA_Float *)value.data));
250
+ rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Float")));
231
251
  } else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_DOUBLE])) {
232
252
  rb_ary_store(ret,0,UA_TYPES_DOUBLE_to_value(*(UA_Double *)value.data));
233
253
  rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Double")));
@@ -252,6 +272,11 @@ VALUE extract_value(UA_Variant value) { //{{{
252
272
  } else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_STRING])) {
253
273
  rb_ary_store(ret,0,UA_TYPES_STRING_to_value(*(UA_String *)value.data));
254
274
  rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.String")));
275
+ } else if (UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_BYTESTRING])) {
276
+ rb_ary_store(ret,0,UA_TYPES_BYTESTRING_to_value(*(UA_ByteString *)value.data));
277
+ rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.String")));
278
+ } else {
279
+ //printf("Unknown Datatype\n");
255
280
  }
256
281
  } else if (value.arrayDimensionsSize == 1 || (value.arrayDimensionsSize == 0 && value.arrayLength > 0)) {
257
282
  if (UA_Variant_hasArrayType(&value, &UA_TYPES[UA_TYPES_DATETIME])) {
@@ -268,6 +293,13 @@ VALUE extract_value(UA_Variant value) { //{{{
268
293
  for (int i=0; i < value.arrayLength; i++) {
269
294
  rb_ary_push(res,UA_TYPES_BOOLEAN_to_value(((UA_Boolean *)value.data)[i]));
270
295
  }
296
+ } else if (UA_Variant_hasArrayType(&value, &UA_TYPES[UA_TYPES_FLOAT])) {
297
+ VALUE res = rb_ary_new();
298
+ rb_ary_store(ret,0,res);
299
+ rb_ary_store(ret,1,ID2SYM(rb_intern("VariantType.Float")));
300
+ for (int i=0; i < value.arrayLength; i++) {
301
+ rb_ary_push(res,UA_TYPES_FLOAT_to_value(((UA_Float *)value.data)[i]));
302
+ }
271
303
  } else if (UA_Variant_hasArrayType(&value, &UA_TYPES[UA_TYPES_DOUBLE])) {
272
304
  VALUE res = rb_ary_new();
273
305
  rb_ary_store(ret,0,res);
@@ -335,11 +335,56 @@ static VALUE node_add_method(int argc, VALUE* argv, VALUE self) { //{{{
335
335
  return node_wrap(CLASS_OF(self),node_alloc(parent->master,node_add_method_ua_simple(nstr,parent,opts,blk)));
336
336
  } //}}}
337
337
 
338
- static UA_NodeId node_add_variable_ua(UA_Int32 type, UA_NodeId n, UA_LocalizedText dn, UA_QualifiedName qn, node_struct *parent, UA_Byte accesslevelmask) { //{{{
338
+ static void node_add_variable_callback( //{{{
339
+ UA_Server *server,
340
+ const UA_NodeId *sessionId, void *sessionContext,
341
+ const UA_NodeId *nodeId, void *nodeContext,
342
+ const UA_NumericRange *range, const UA_DataValue *data
343
+ ) {
344
+ node_struct *me = (node_struct *)nodeContext;
345
+ UA_Guid internal = UA_GUID("00000001-0000-0000-0000-000000000000");
346
+
347
+ // if (sessionId->identifierType == UA_NODEIDTYPE_NUMERIC) {
348
+ // printf("sessionId ns=%d;i=%d\n", sessionId->namespaceIndex, sessionId->identifier.numeric);
349
+ // } else if(sessionId->identifierType == UA_NODEIDTYPE_STRING) {
350
+ // printf("sessionId ns=%d;s=%.*s\n", sessionId->namespaceIndex, (int)sessionId->identifier.string.length, sessionId->identifier.string.data);
351
+ // } else if(sessionId->identifierType == UA_NODEIDTYPE_GUID) {
352
+ // if (UA_Guid_equal(&(sessionId->identifier.guid),&internal)) {
353
+ // printf("sessionId internal session\n");
354
+ // } else {
355
+ // printf("sessionId ns=%d;g=%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",sessionId->namespaceIndex,UA_PRINTF_GUID_DATA(sessionId->identifier.guid));
356
+ // }
357
+ // } else if(sessionId->identifierType == UA_NODEIDTYPE_BYTESTRING) {
358
+ // printf("sessionId ns=%d;b=%.*s\n", sessionId->namespaceIndex, (int)sessionId->identifier.string.length, sessionId->identifier.string.data);
359
+ // } else if(UA_NodeId_isNull(sessionId)) {
360
+ // printf("sessionId is null");
361
+ // } else {
362
+ // printf("sessionId ns=%d;unsupported\n",sessionId->namespaceIndex);
363
+ // }
364
+
365
+ VALUE args = rb_ary_new();
366
+ rb_ary_push(args, Data_Wrap_Struct(cVarNode,NULL,NULL,me));
367
+ VALUE para = extract_value(data->value);
368
+ rb_ary_push(args,rb_ary_entry(para,0));
369
+ if (UA_Guid_equal(&(sessionId->identifier.guid),&internal)) {
370
+ rb_ary_push(args,Qfalse);
371
+ } else {
372
+ rb_ary_push(args,Qtrue);
373
+ }
374
+ if (me->method != Qnil) {
375
+ rb_proc_call(me->method,args);
376
+ }
377
+ } //}}}
378
+ static UA_NodeId node_add_variable_ua(UA_Int32 type, UA_NodeId n, UA_LocalizedText dn, UA_QualifiedName qn, node_struct *parent, UA_Byte accesslevelmask, VALUE blk) { //{{{
339
379
  UA_VariableAttributes vAttr = UA_VariableAttributes_default;
340
380
  vAttr.displayName = dn;
341
381
  vAttr.accessLevel = accesslevelmask;
342
382
 
383
+ node_struct *me = node_alloc(parent->master,n);
384
+ me->method = blk;
385
+ rb_gc_register_address(&blk);
386
+ rb_gc_register_address(&me->method);
387
+
343
388
  UA_Server_addVariableNode(parent->master->master,
344
389
  n,
345
390
  parent->id,
@@ -347,9 +392,13 @@ static UA_NodeId node_add_variable_ua(UA_Int32 type, UA_NodeId n, UA_LocalizedTe
347
392
  qn,
348
393
  UA_NODEID_NUMERIC(0, type),
349
394
  vAttr,
350
- NULL,
395
+ (void *)me,
351
396
  NULL);
352
397
 
398
+ UA_ValueCallback callback ;
399
+ callback.onWrite = node_add_variable_callback;
400
+ UA_Server_setVariableNode_valueCallback(parent->master->master, n, callback);
401
+
353
402
  UA_Server_addReference(parent->master->master,
354
403
  n,
355
404
  UA_NODEID_NUMERIC(0, UA_NS0ID_HASMODELLINGRULE),
@@ -357,15 +406,28 @@ static UA_NodeId node_add_variable_ua(UA_Int32 type, UA_NodeId n, UA_LocalizedTe
357
406
  true);
358
407
 
359
408
  return n;
360
- } //}}}
361
- static UA_NodeId node_add_variable_ua_simple(UA_Int32 type, char* nstr, node_struct *parent, UA_Byte accesslevelmask, bool numeric) { //{{{
409
+ } //}}}
410
+ static UA_NodeId node_add_variable_ua_simple(UA_Int32 type, VALUE str, node_struct *parent, UA_Byte accesslevelmask, bool numeric, VALUE blk) { //{{{
411
+ int nodeid = nodecounter++;
412
+ char *nstr = (char *)StringValuePtr(str);
413
+
414
+ UA_NodeId n;
415
+ if (numeric) {
416
+ n = UA_NODEID_NUMERIC(parent->master->default_ns,nodeid);
417
+ rb_hash_aset(parent->master->methods,INT2NUM(nodeid),blk);
418
+ } else {
419
+ n = UA_NODEID_STRING(parent->master->default_ns,nstr);
420
+ rb_hash_aset(parent->master->methods,str,blk);
421
+ }
422
+ rb_gc_register_address(&blk);
362
423
  return node_add_variable_ua(
363
424
  type,
364
- numeric ? UA_NODEID_NUMERIC(parent->master->default_ns,nodecounter++) : UA_NODEID_STRING(parent->master->default_ns,nstr),
425
+ n,
365
426
  UA_LOCALIZEDTEXT("en-US", nstr),
366
427
  UA_QUALIFIEDNAME(parent->master->default_ns, nstr),
367
428
  parent,
368
- accesslevelmask
429
+ accesslevelmask,
430
+ blk
369
431
  );
370
432
  } //}}}
371
433
  static VALUE node_add_variable_wrap(int argc, VALUE* argv, VALUE self, UA_Byte accesslevelmask, bool numeric) { //{{{
@@ -375,22 +437,28 @@ static VALUE node_add_variable_wrap(int argc, VALUE* argv, VALUE self, UA_Byte a
375
437
  rb_raise(rb_eArgError, "wrong number of arguments");
376
438
  }
377
439
 
440
+ Data_Get_Struct(self, node_struct, parent);
441
+ if (!parent->exists) rb_raise(rb_eRuntimeError, "Node does not exist anymore.");
442
+
443
+ VALUE name;
444
+ VALUE ttype;
445
+ VALUE blk;
446
+ rb_gc_register_address(&blk);
447
+
448
+ rb_scan_args(argc, argv, "11&", &name, &ttype, &blk);
449
+
378
450
  UA_UInt32 type;
379
- if (argc == 2 && argv[1] != Qnil) {
380
- type = NUM2INT(argv[1]);
381
- } else {
451
+ if (NIL_P(ttype)) {
382
452
  type = UA_NS0ID_BASEDATAVARIABLETYPE;
453
+ } else {
454
+ type = NUM2INT(ttype);
383
455
  }
384
456
 
385
- Data_Get_Struct(self, node_struct, parent);
386
- if (!parent->exists) rb_raise(rb_eRuntimeError, "Node does not exist anymore.");
387
-
388
- VALUE str = rb_obj_as_string(argv[0]);
457
+ VALUE str = rb_obj_as_string(name);
389
458
  if (NIL_P(str) || TYPE(str) != T_STRING)
390
459
  rb_raise(rb_eTypeError, "cannot convert obj to string");
391
- char *nstr = (char *)StringValuePtr(str);
392
460
 
393
- return node_wrap(cVarNode,node_alloc(parent->master,node_add_variable_ua_simple(type,nstr,parent,accesslevelmask,numeric)));
461
+ return node_wrap(cVarNode,node_alloc(parent->master,node_add_variable_ua_simple(type,str,parent,accesslevelmask,numeric,blk)));
394
462
  } //}}}
395
463
  static VALUE node_add_variable(int argc, VALUE* argv, VALUE self) { //{{{
396
464
  return node_add_variable_wrap(argc,argv,self,UA_ACCESSLEVELMASK_READ,true);
@@ -564,10 +632,22 @@ static UA_StatusCode node_manifest_iter(UA_NodeId child_id, UA_Boolean is_invers
564
632
  UA_BrowsePathResult property = node_browse_path(parent->master->master, child_id, UA_NODEID_NUMERIC(0, UA_NS0ID_HASTYPEDEFINITION), pqn, false);
565
633
  UA_QualifiedName_clear(&pqn);
566
634
 
635
+ VALUE blk;
636
+ if (child_id.identifierType == UA_NODEIDTYPE_NUMERIC) {
637
+ blk = rb_hash_aref(parent->master->methods,INT2NUM(child_id.identifier.numeric));
638
+ } else if (child_id.identifierType == UA_NODEIDTYPE_STRING) {
639
+ blk = rb_hash_aref(parent->master->methods,rb_str_new((const char *)child_id.identifier.string.data,child_id.identifier.string.length));
640
+ } else if (child_id.identifierType == UA_NODEIDTYPE_BYTESTRING) {
641
+ blk = rb_hash_aref(parent->master->methods,rb_str_new((const char *)child_id.identifier.byteString.data,child_id.identifier.byteString.length));
642
+ } else {
643
+ blk = Qnil;
644
+ }
645
+
646
+
567
647
  if (property.statusCode == UA_STATUSCODE_GOOD) {
568
- node_add_variable_ua(UA_NS0ID_PROPERTYTYPE,UA_NODEID_STRING(parent->master->default_ns,buffer),dn,qn,newnode,al);
648
+ node_add_variable_ua(UA_NS0ID_PROPERTYTYPE,UA_NODEID_STRING(parent->master->default_ns,buffer),dn,qn,newnode,al,blk);
569
649
  } else {
570
- node_add_variable_ua(UA_NS0ID_BASEDATAVARIABLETYPE,UA_NODEID_STRING(parent->master->default_ns,buffer),dn,qn,newnode,al);
650
+ node_add_variable_ua(UA_NS0ID_BASEDATAVARIABLETYPE,UA_NODEID_STRING(parent->master->default_ns,buffer),dn,qn,newnode,al,blk);
571
651
  }
572
652
 
573
653
  UA_BrowsePathResult_clear(&property);
@@ -46,11 +46,23 @@ module OPCUA
46
46
  def add_property_rw(*item)
47
47
  item.each { |e| add_property_rw e }
48
48
  end
49
- def add_variables(*item)
50
- item.each { |e| add_variable e }
49
+ def add_variables(*item,&blk)
50
+ item.each do |e|
51
+ if blk.nil?
52
+ add_variable e
53
+ else
54
+ add_variable e, &blk
55
+ end
56
+ end
51
57
  end
52
- def add_variables_rw(*item)
53
- item.each { |e| add_variable_rw e }
58
+ def add_variables_rw(*item,&blk)
59
+ item.each do |e|
60
+ if blk.nil?
61
+ add_variable_rw e
62
+ else
63
+ add_variable_rw e, &blk
64
+ end
65
+ end
54
66
  end
55
67
  end
56
68
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "opcua"
3
- s.version = "0.18"
3
+ s.version = "0.23"
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."
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.required_ruby_version = '>=2.5.0'
17
17
 
18
- s.authors = ['Juergen eTM Mangler','Florian Pauker']
18
+ s.authors = ['Juergen eTM Mangler','Florian Pauker','Matthias Ehrendorfer']
19
19
 
20
20
  s.email = 'juergen.mangler@gmail.com'
21
21
  s.homepage = 'https://github.com/etm/opcua-smart'
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opcua
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.18'
4
+ version: '0.23'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  - Florian Pauker
9
- autorequire:
9
+ - Matthias Ehrendorfer
10
+ autorequire:
10
11
  bindir: tools
11
12
  cert_chain: []
12
- date: 2020-03-18 00:00:00.000000000 Z
13
+ date: 2021-01-25 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: daemonite
@@ -74,6 +75,7 @@ files:
74
75
  - cert/cert.h
75
76
  - cert/cert_key.h
76
77
  - example/bug5.rb
78
+ - example/client_get_float.rb
77
79
  - example/client_get_sync.rb
78
80
  - example/client_get_value.rb
79
81
  - example/client_method.rb
@@ -83,6 +85,9 @@ files:
83
85
  - example/server.rb
84
86
  - example/server_deep.rb
85
87
  - example/server_values.rb
88
+ - example/server_values_callback.pid
89
+ - example/server_values_callback.rb
90
+ - example/server_xml.rb
86
91
  - example/test.rb
87
92
  - ext/opcua/client/client.c
88
93
  - ext/opcua/client/client.h
@@ -121,7 +126,7 @@ homepage: https://github.com/etm/opcua-smart
121
126
  licenses:
122
127
  - LGPL-3.0
123
128
  metadata: {}
124
- post_install_message:
129
+ post_install_message:
125
130
  rdoc_options: []
126
131
  require_paths:
127
132
  - lib
@@ -136,8 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
141
  - !ruby/object:Gem::Version
137
142
  version: '0'
138
143
  requirements: []
139
- rubygems_version: 3.1.2
140
- signing_key:
144
+ rubygems_version: 3.1.4
145
+ signing_key:
141
146
  specification_version: 4
142
147
  summary: Preliminary release of opcua (open62541) ruby bindings. C performance, Ruby
143
148
  elegance, simplicity, and productivity.