smartware 0.2.8 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/smartware.rb +2 -0
- data/lib/smartware/drivers/card_reader/ict3_k5.rb +48 -313
- data/lib/smartware/drivers/cash_acceptor/ccnet.rb +212 -144
- data/lib/smartware/drivers/cash_acceptor/dummy.rb +11 -33
- data/lib/smartware/drivers/common/ccnet_connection.rb +135 -0
- data/lib/smartware/drivers/common/command_based_device.rb +101 -0
- data/lib/smartware/drivers/common/sankyo_connection.rb +154 -0
- data/lib/smartware/interfaces/cash_acceptor.rb +53 -101
- data/lib/smartware/service.rb +17 -12
- data/lib/smartware/version.rb +1 -1
- data/smartware.gemspec +1 -0
- metadata +21 -2
data/lib/smartware/service.rb
CHANGED
@@ -8,21 +8,24 @@ module Smartware
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def start
|
11
|
-
|
12
|
-
|
11
|
+
EventMachine.epoll
|
12
|
+
EventMachine.run do
|
13
|
+
@interfaces = @config["interfaces"].map do |config|
|
14
|
+
interface = Smartware::Interface.const_get(config['name']).new config
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
+
DRb::DRbServer.new config["uri"], interface
|
17
|
+
end
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
unless @config["connection_timeout"].nil?
|
20
|
+
Thread.new do
|
21
|
+
begin
|
22
|
+
monitor = ConnectionMonitor.new @config["connection_timeout"].to_i
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
monitor.run
|
25
|
+
rescue => e
|
26
|
+
Smartware::Logging.logger.error "Exception in connection monitor thread: #{e}"
|
27
|
+
e.backtrace.each { |line| Smartware::Logging.logger.error line }
|
28
|
+
end
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
@@ -31,6 +34,8 @@ module Smartware
|
|
31
34
|
|
32
35
|
def stop
|
33
36
|
@interfaces.each &:stop_service
|
37
|
+
|
38
|
+
EventMachine.stop_event_loop
|
34
39
|
end
|
35
40
|
|
36
41
|
def join
|
data/lib/smartware/version.rb
CHANGED
data/smartware.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.3'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: smartkiosk-common
|
@@ -124,6 +124,22 @@ dependencies:
|
|
124
124
|
- - ! '>='
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: eventmachine
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
type: :runtime
|
136
|
+
prerelease: false
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
127
143
|
description: Smartware is the Smartkiosk hardware control daemon
|
128
144
|
email:
|
129
145
|
- e.sudarchikov@roundlake.ru
|
@@ -153,6 +169,9 @@ files:
|
|
153
169
|
- lib/smartware/drivers/card_reader/ict3_k5.rb
|
154
170
|
- lib/smartware/drivers/cash_acceptor/ccnet.rb
|
155
171
|
- lib/smartware/drivers/cash_acceptor/dummy.rb
|
172
|
+
- lib/smartware/drivers/common/ccnet_connection.rb
|
173
|
+
- lib/smartware/drivers/common/command_based_device.rb
|
174
|
+
- lib/smartware/drivers/common/sankyo_connection.rb
|
156
175
|
- lib/smartware/drivers/modem/dummy.rb
|
157
176
|
- lib/smartware/drivers/modem/standard.rb
|
158
177
|
- lib/smartware/drivers/printer/dummy.rb
|