opcua_client 0.0.1

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.
@@ -0,0 +1,18 @@
1
+ module OPCUAClient
2
+ class << self
3
+ def new_client
4
+ OPCUAClient::Client.new
5
+ end
6
+
7
+ def start(*args)
8
+ client = OPCUAClient::Client.new
9
+ client.connect(*args)
10
+ yield client
11
+ ensure
12
+ client.disconnect
13
+ end
14
+ end
15
+ end
16
+
17
+ require "opcua_client/opcua_client"
18
+ require "opcua_client/client"
@@ -0,0 +1,22 @@
1
+ module OPCUAClient
2
+ class Client
3
+ def after_session_created(&block)
4
+ @callback_after_session_created = block
5
+ end
6
+
7
+ def after_data_changed(&block)
8
+ @callback_after_data_changed = block
9
+ end
10
+
11
+ def human_state
12
+ state = self.state
13
+
14
+ if state == OPCUAClient::UA_CLIENTSTATE_DISCONNECTED; "UA_CLIENTSTATE_DISCONNECTED"
15
+ elsif state == OPCUAClient::UA_CLIENTSTATE_CONNECTED; "UA_CLIENTSTATE_CONNECTED"
16
+ elsif state == OPCUAClient::UA_CLIENTSTATE_SECURECHANNEL; "UA_CLIENTSTATE_SECURECHANNEL"
17
+ elsif state == OPCUAClient::UA_CLIENTSTATE_SESSION; "UA_CLIENTSTATE_SESSION"
18
+ elsif state == OPCUAClient::UA_CLIENTSTATE_SESSION_RENEWED; "UA_CLIENTSTATE_SESSION_RENEWED"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,3 @@
1
+ module OPCUAClient
2
+ VERSION = "0.0.1".freeze
3
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: opcua_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ritvars Rundzans
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - ritvars.rundzans@makit.lv
16
+ executables: []
17
+ extensions:
18
+ - ext/opcua_client/extconf.rb
19
+ extra_rdoc_files: []
20
+ files:
21
+ - README.md
22
+ - ext/opcua_client/extconf.rb
23
+ - ext/opcua_client/opcua_client.c
24
+ - ext/opcua_client/open62541.c
25
+ - ext/opcua_client/open62541.h
26
+ - lib/opcua_client.rb
27
+ - lib/opcua_client/client.rb
28
+ - lib/opcua_client/version.rb
29
+ homepage: https://github.com/mak-it/opcua-client-ruby
30
+ licenses:
31
+ - MIT
32
+ metadata: {}
33
+ post_install_message:
34
+ rdoc_options:
35
+ - "--charset=UTF-8"
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.4.0
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubyforge_project:
50
+ rubygems_version: 2.7.9
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Basic OPC-UA client library for Ruby. Uses open62541 (https://open62541.org)
54
+ under the hood.
55
+ test_files: []