da_funk 0.4.20 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62c2f815b4a2aac3e8a15cf969b0f9d7ce842140
4
- data.tar.gz: 0d585d8bf8eec09129472b764119775a91ad290a
3
+ metadata.gz: 1b480b5631767e85d7cb2ccbbd975c1be1855810
4
+ data.tar.gz: 7dc71b04d56979458cd23e44a27698028df6b890
5
5
  SHA512:
6
- metadata.gz: 1ed08db806c6b47c2845c9dbca87c021b3a3256b00b0dd81261e2ad06437d594840a44299d8860b600a63ebfb51d2f428bb4a21ac33b6ba51d9e7723e562b978
7
- data.tar.gz: 1ec0cd499e3221a80d0537949c77939294ac2bdbb68dde23364e1adfa42d55337ca2539a8364316f0349cb9758b74c26478155d516ce104849cbdf3ce9bec5cc
6
+ metadata.gz: 76c5eba2efcb502d26c7661dd90f8318005bce47d060a4dca15c8a84c46e83e476f1d259866cb512379a7e8a049798bd6d2a194398d88024235fe51300d45a58
7
+ data.tar.gz: 37dc24ed9e61482dabd643ec97261d9f258682bdd53ab79f4e179dc8dabbb392d3870afe078cdda3814c71981d0c5a69b62d6b4a90de50508970d3e5d6aa9a62
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- da_funk (0.4.20)
10
+ da_funk (0.5.1)
11
11
  bundler (~> 1.7)
12
12
  cloudwalk_handshake (~> 0.4)
13
13
  rake (~> 10.4)
@@ -16,7 +16,7 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- cloudwalk_handshake (0.4.11)
19
+ cloudwalk_handshake (0.4.12)
20
20
  rake (10.4.2)
21
21
  yard (0.8.7.6)
22
22
 
@@ -1,5 +1,13 @@
1
1
  # DaFunk
2
2
 
3
+ ### 0.5.1 - 2015-12-16 - Update cloudwalk_handshake
4
+ - Update cloudwlak_handshake to version 0.4.12.
5
+
6
+ ### 0.5.0 - 2015-12-14 - Wifi scan
7
+ - Add support to Wifi scan.
8
+ - Add support to check GPRS and Wifi signal.
9
+ - Fix notification socket reading.
10
+
3
11
  ### 0.4.20 - 2015-12-10 - Refactoring Notification
4
12
  - Implement try method on helper to be use on by communication tries.
5
13
  - Serfx#auth now receives the authentication key as a parameter too, so that could be called externally in a determined moment, example TOTP authentication on the right moment (after socket open, avoiding authentication problems).
@@ -77,6 +77,39 @@ class Device
77
77
  adapter.disconnect
78
78
  end
79
79
 
80
+ # Check signal value
81
+ #
82
+ # @return [Fixnum] Signal value between 0 and 5.
83
+ def self.signal
84
+ adapter.signal
85
+ end
86
+
87
+ # Scan for wifi aps available
88
+ #
89
+ # @return [Array] Return an array of hash values
90
+ # containing the values necessary to configure connection
91
+ #
92
+ # @example
93
+ # aps = Device::Network.scan
94
+ # # create a selection to menu method
95
+ # selection = aps.inject({}) do |selection, hash|
96
+ # selection[hash[:essid]] = hash; selection
97
+ # end
98
+ # selected = menu("Select SSID:", selection)
99
+ #
100
+ # Device::Setting.password = form("Password",
101
+ # :min => 0, :max => 127, :default => Device::Setting.password)
102
+ # Device::Setting.authentication = selected[:authentication]
103
+ # Device::Setting.essid = selected[:essid]
104
+ # Device::Setting.channel = selected[:channel]
105
+ # Device::Setting.cipher = selected[:cipher]
106
+ # Device::Setting.mode = selected[:mode]
107
+ def self.scan
108
+ if wifi?
109
+ adapter.scan if Device::Network.init(*self.config)
110
+ end
111
+ end
112
+
80
113
  def self.dhcp_client(timeout)
81
114
  time = Time.now + (timeout.to_f / 1000.0)
82
115
  ret = adapter.dhcp_client_start
@@ -1,6 +1,6 @@
1
1
 
2
2
  class Device
3
- API_VERSION="0.4.20"
3
+ API_VERSION="0.5.1"
4
4
 
5
5
  def self.api_version
6
6
  Device::API_VERSION
@@ -83,7 +83,6 @@ module Serfx
83
83
  time_timeout = Time.now + read_timeout
84
84
  loop do
85
85
  bytes = socket.bytes_available
86
- return socket.read(bytes) if bytes > 0
87
86
  return socket.recv_nonblock(bytes) if bytes > 0
88
87
  break unless time_timeout > Time.now
89
88
  sleep 1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.20
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-10 00:00:00.000000000 Z
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake