da_funk 0.9.1 → 0.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f6796aa8b171f133b5b3a6b0170b61a83651b63
4
- data.tar.gz: f428c3c98ebc985b7ccad5753ef547910bb72e6a
3
+ metadata.gz: 3ffa40cacb07a44394edc805f71b8be32438bfc9
4
+ data.tar.gz: b2f646de25afc556455cf85aea448804f1d95af1
5
5
  SHA512:
6
- metadata.gz: 0701508221650303c1817bdf30f8c833ee1513f3bc4e60e5a3331f664521abd3cd4982c48da6f8183dba4436dd7c3dc88388e27d979b1e3e1453b2582ecfbe0b
7
- data.tar.gz: 2c8ddae58a9c941dcec255840c6d76f7957be7148fdc1113d91125e54afd42ef4f256c502c2cee93475da928fad28d348e4aa08e84641614eee729afd28acc78
6
+ metadata.gz: d158b9803baae2030ee1baeedaa0e41e178bfbd4b6b7550937d22d0755ba729da963def38dec968470d46b5b0259b401cd880561650bf7b0103f22751abd4a4e
7
+ data.tar.gz: 7886ea442d36228ad0299f99069177c9583f3be60ebe20c78a70e45d2aa7f57f4f7e68a098e1f036cec6b0c85509303d2479ca52ba08ac9c655863313e46f4ba
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (0.9.1)
4
+ da_funk (0.9.2)
5
5
  bundler (~> 1.7)
6
6
  cloudwalk_handshake (~> 0.6)
7
7
  funky-emv (~> 0.3)
@@ -12,11 +12,11 @@ GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
14
  cloudwalk_handshake (0.8.0)
15
- funky-emv (0.5.8)
15
+ funky-emv (0.6.0)
16
16
  funky-tlv (~> 0.2)
17
17
  funky-simplehttp (0.4.4)
18
- funky-tlv (0.2.2)
19
- posxml_parser (0.15.1)
18
+ funky-tlv (0.2.3)
19
+ posxml_parser (0.15.2)
20
20
  funky-emv (~> 0.3)
21
21
  rake (10.5.0)
22
22
  yard (0.9.9)
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # DaFunk
2
2
 
3
+ ### 0.9.2 - 2017-07-25
4
+
5
+ - Refactoring Network.configured? fixing the return which must be a bool.
6
+ - Create Device::Setting.wifi_password and Device::Setting.apn_password.
7
+
3
8
  ### 0.9.1 - 2017-07-12
4
9
 
5
10
  - Fix file deletable check and extra parameters for additional files at ParamsDat.format!.
@@ -18,11 +18,13 @@ module DaFunk
18
18
  Device::Display.clear
19
19
  if Device::Network.configured?
20
20
  I18n.pt(:attach_connecting)
21
- if Device::Network.connected? < 0
22
- if (ret = Device::Network.attach) == 0
21
+ unless Device::Network.connected?
22
+ if Device::Network.attach == Device::Network::SUCCESS
23
+ Device::Setting.network_configured = 1
23
24
  I18n.pt(:attach_connected)
24
25
  else
25
- I18n.pt(:attach_fail, :args => [ret.to_s])
26
+ Device::Setting.network_configured = 0
27
+ I18n.pt(:attach_fail, :args => [Device::Network.code.to_s])
26
28
  getc(4000)
27
29
  return false
28
30
  end
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="0.9.1"
2
+ VERSION="0.9.2"
3
3
  end
4
4
 
@@ -40,9 +40,10 @@ class Device
40
40
  #AUTH_WPA_WPA2_EAP = "wpa_wpa2_eap"
41
41
 
42
42
  class << self
43
- attr_accessor :type, :apn, :user, :password, :socket
43
+ attr_accessor :type, :apn, :user, :password, :socket, :code
44
44
  end
45
45
 
46
+ self.code = NO_CONNECTION
46
47
  self.socket = Proc.new do |avoid_handshake|
47
48
  sock = TCPSocket.new Device::Setting.host, Device::Setting.host_port
48
49
  sock.connect(avoid_handshake)
@@ -69,9 +70,12 @@ class Device
69
70
  if self.adapter.started? ||
70
71
  (self.configured? && Device::Network.init(*self.config) == SUCCESS)
71
72
 
72
- return adapter.connected?
73
+ self.code = adapter.connected?
74
+
75
+ return self.code == Device::Network::SUCCESS
73
76
  end
74
- NO_CONNECTION
77
+ self.code = NO_CONNECTION
78
+ false
75
79
  end
76
80
 
77
81
  def self.configured?
@@ -96,7 +100,7 @@ class Device
96
100
  #
97
101
  # @return [Fixnum] Signal value between 0 and 5.
98
102
  def self.signal
99
- if self.connected? == 0
103
+ if self.connected?
100
104
  adapter.signal
101
105
  end
102
106
  end
@@ -114,8 +118,8 @@ class Device
114
118
  # end
115
119
  # selected = menu("Select SSID:", selection)
116
120
  #
117
- # Device::Setting.password = form("Password",
118
- # :min => 0, :max => 127, :default => Device::Setting.password)
121
+ # Device::Setting.wifi_password = form("Password",
122
+ # :min => 0, :max => 127, :default => Device::Setting.wifi_password)
119
123
  # Device::Setting.authentication = selected[:authentication]
120
124
  # Device::Setting.essid = selected[:essid]
121
125
  # Device::Setting.channel = selected[:channel]
@@ -144,28 +148,27 @@ class Device
144
148
  end
145
149
 
146
150
  def self.attach
147
- ret = Device::Network.connected?
148
- if ret != SUCCESS
149
- ret = Device::Network.init(*self.config)
150
- ret = Device::Network.connect
151
- ret = Device::Network.connected? if ret != SUCCESS
151
+ Device::Network.connected?
152
+ if self.code != SUCCESS
153
+ self.code = Device::Network.init(*self.config)
154
+ self.code = Device::Network.connect
155
+ Device::Network.connected? if self.code != SUCCESS
152
156
 
153
157
  hash = try_user do |process|
154
- process[:ret] = Device::Network.connected?
158
+ Device::Network.connected?
159
+ process[:ret] = self.code
155
160
  process[:ret] == PROCESSING # if true keep trying
156
161
  end
157
- ret = hash[:ret]
162
+ self.code = hash[:ret]
158
163
 
159
- if ret == SUCCESS
160
- ret = Device::Network.dhcp_client(20000) if (wifi? || ethernet?)
161
- Device::Setting.network_configured = 1
164
+ if self.code == SUCCESS
165
+ self.code = Device::Network.dhcp_client(20000) if (wifi? || ethernet?)
162
166
  else
163
- ret = ERR_USER_CANCEL if hash[:key] == Device::IO::CANCEL
164
- Device::Setting.network_configured = 0
167
+ self.code = ERR_USER_CANCEL if hash[:key] == Device::IO::CANCEL
165
168
  Device::Network.disconnect
166
169
  end
167
170
  end
168
- ret
171
+ self.code
169
172
  end
170
173
 
171
174
  def self.config
@@ -179,19 +182,19 @@ class Device
179
182
  {
180
183
  apn: Device::Setting.apn,
181
184
  user: Device::Setting.user,
182
- password: Device::Setting.password
185
+ password: Device::Setting.apn_password
183
186
  }
184
187
  elsif wifi?
185
188
  {
186
189
  authentication: Device::Setting.authentication,
187
- password: Device::Setting.password,
190
+ password: Device::Setting.wifi_password,
188
191
  essid: Device::Setting.essid,
189
192
  channel: Device::Setting.channel,
190
193
  cipher: Device::Setting.cipher,
191
194
  mode: Device::Setting.mode
192
195
  }
193
196
  elsif ethernet?
194
- Hash.new
197
+ Hash.new # TODO
195
198
  end
196
199
  end
197
200
 
@@ -41,7 +41,7 @@ class Device
41
41
  end
42
42
 
43
43
  def self.start
44
- if create_fiber? && Device::Network.connected? == Device::Network::SUCCESS
44
+ if create_fiber? && Device::Network.connected?
45
45
  unless Device::Notification.current && Device::Notification.current.closed?
46
46
  self.new(*self.config)
47
47
  end
@@ -74,7 +74,7 @@ class Device
74
74
  # Check if there is any notification
75
75
  def check
76
76
  # TODO check if should execute this(because of connection exception)
77
- if valid_check_interval? && Device::Network.connected? == Device::Network::SUCCESS
77
+ if valid_check_interval? && Device::Network.connected?
78
78
  if @fiber.alive?
79
79
  if (notification = @fiber.resume)
80
80
  Notification.execute(NotificationEvent.new(notification))
@@ -10,48 +10,50 @@ class Device
10
10
  DEFAULT = {
11
11
  "host" => HOST_PRODUCTION,
12
12
  "host_port" => PORT_TCP_SSL,
13
- "ssl" => "1",
14
- "user" => "",
15
- "password" => "", #WIFI
16
- "apn" => "",
17
- "sim_pin" => "",
18
- "sim_slot" => "0",
19
- "sim_dual" => "0",
13
+ "ssl" => "1", #COMM
14
+ "media_primary" => "", #COMM
15
+ "user" => "", #GPRS
16
+ "apn_password" => "", #GPRS
17
+ "apn" => "", #GPRS
18
+ "sim_pin" => "", #GPRS
19
+ "sim_slot" => "0", #GPRS
20
+ "sim_dual" => "0", #GPRS
21
+ "wifi_password" => "", #WIFI
20
22
  "authentication" => "", #WIFI
21
23
  "essid" => "", #WIFI
22
24
  "bssid" => "", #WIFI
23
25
  "cipher" => "", #WIFI
24
26
  "mode" => "", #WIFI
25
27
  "channel" => "", #WIFI
26
- "media" => "",
27
- "ip" => "",
28
- "gateway" => "",
29
- "dns1" => "",
30
- "dns2" => "",
31
- "subnet" => "",
32
- "phone" => "",
33
- "modem_speed" => "",
34
- "logical_number" => "",
35
- "network_configured" => "",
36
- "touchscreen" => "",
37
- "environment" => "",
38
- "attach_gprs_timeout" => "",
39
- "attach_tries" => "",
40
- "notification_socket_timeout" => "", # Period to create fiber
41
- "notification_timeout" => "", # Time to wait message to read
42
- "notification_interval" => "", # Check interval
43
- "notification_stream_timeout" => "", # Time to wait stream message to read
44
- "cw_switch_version" => "",
45
- "cw_pos_timezone" => "",
46
- "tcp_recv_timeout" => "14",
47
- "iso8583_recv_tries" => "0",
48
- "iso8583_send_tries" => "0",
49
- "crypto_dukpt_slot" => "",
50
- "ctls" => "",
51
- "locale" => "en",
52
- "heartbeat" => "",
53
- "boot" => "1",
54
- "company_name" => ""
28
+ "media" => "", #COMM
29
+ "ip" => "", #COMM
30
+ "gateway" => "", #COMM
31
+ "dns1" => "", #COMM
32
+ "dns2" => "", #COMM
33
+ "subnet" => "", #COMM
34
+ "phone" => "", #PPOE
35
+ "modem_speed" => "", #PPOE
36
+ "logical_number" => "", #SYS
37
+ "network_configured" => "", #SYS
38
+ "touchscreen" => "", #SYS
39
+ "environment" => "", #SYS
40
+ "attach_gprs_timeout" => "", #COMM
41
+ "attach_tries" => "", #COMM
42
+ "notification_socket_timeout" => "", #SYS Period to create fiber
43
+ "notification_timeout" => "", #SYS Time to wait message to read
44
+ "notification_interval" => "", #SYS Check interval
45
+ "notification_stream_timeout" => "", #SYS Time to wait stream message to read
46
+ "cw_switch_version" => "", #SYS
47
+ "cw_pos_timezone" => "", #SYS
48
+ "tcp_recv_timeout" => "14", #COMM
49
+ "iso8583_recv_tries" => "0", #COMM
50
+ "iso8583_send_tries" => "0", #COMM
51
+ "crypto_dukpt_slot" => "", #SYS
52
+ "ctls" => "", #SYS
53
+ "locale" => "en", #SYS
54
+ "heartbeat" => "", #SYS
55
+ "boot" => "1", #SYS
56
+ "company_name" => "" #SYS
55
57
  }
56
58
 
57
59
  def self.setup
data/out/da_funk.mrb CHANGED
Binary file
@@ -69,7 +69,11 @@ class CommandLinePlatform
69
69
  end
70
70
 
71
71
  def self.connected?
72
- 1
72
+ true
73
+ end
74
+
75
+ def self.code
76
+ Device::Network::SUCCESS
73
77
  end
74
78
 
75
79
  def self.signal
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-12 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.7'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cloudwalk_handshake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.6'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: funky-simplehttp
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.8'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.8'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: posxml_parser
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: funky-emv
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0.3'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.3'
111
111
  description: DaFunk is a Embedded System Framework optimized for programmer happiness
@@ -117,8 +117,8 @@ executables: []
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
- - .gitignore
121
- - .yardopts
120
+ - ".gitignore"
121
+ - ".yardopts"
122
122
  - Gemfile
123
123
  - Gemfile.lock
124
124
  - README.md
@@ -231,17 +231,17 @@ require_paths:
231
231
  - lib
232
232
  required_ruby_version: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - '>='
234
+ - - ">="
235
235
  - !ruby/object:Gem::Version
236
236
  version: 1.9.3
237
237
  required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  requirements:
239
- - - '>='
239
+ - - ">="
240
240
  - !ruby/object:Gem::Version
241
241
  version: '0'
242
242
  requirements: []
243
243
  rubyforge_project:
244
- rubygems_version: 2.4.8
244
+ rubygems_version: 2.6.12
245
245
  signing_key:
246
246
  specification_version: 4
247
247
  summary: MRuby Embedded System Framework