scan_beacon 0.7.5 → 0.7.6

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: 039d7885782b7d34eee4ee7e151a600c57931ec2
4
- data.tar.gz: 696725c4564bba3c7ac9fd65c7ddcbd1a6cbf530
3
+ metadata.gz: 279c17d8ac41187e2fca0485fa7e509b95b39a5a
4
+ data.tar.gz: 5f66d567c6c6e1c24fdcfaae49be7ab5ae5107d6
5
5
  SHA512:
6
- metadata.gz: 1eeae293dd4911257b8cd4130472e68e96ee3a7151eaa3e64937767a517efed011adf7bbd162c404be417620d5d3e4d072dd15a9b2a5dc59ffc283882420f5d4
7
- data.tar.gz: 21149279596ac7d934cd867f5edf718fed58cdd69f20644bce72dc706f71d94da29be093b356e61d4783255be432f978e12b87002a871a8187cf9eee4b0b3337
6
+ metadata.gz: f59688043cf8f7399f63ef2c5fc6a1b990b04f527e7bd8aaee0fea2bf714b52641c78e69d824d56472be72a45577d6e876c94a52cf7aadb489ea4272f8d5e84f
7
+ data.tar.gz: 0afcf93cb60a0d40863f43b841110c2dafd9fa78709e949895cf8ac857e190484cf6a198a2018f808718beba1d7ef243de35b92c62a055802c910baab7d04c6e
@@ -41,7 +41,7 @@ module ScanBeacon
41
41
 
42
42
  def open
43
43
  response = nil
44
- configure_port
44
+ self.class.configure_port(@port)
45
45
  File.open(@port, 'r+b') do |file|
46
46
  @file = file
47
47
  response = yield(self)
@@ -50,16 +50,16 @@ module ScanBeacon
50
50
  return response
51
51
  end
52
52
 
53
- def configure_port
53
+ def self.configure_port(port)
54
54
  if RUBY_PLATFORM =~ /linux/
55
- system("stty -F #{@port} 115200 raw -brkint -icrnl -imaxbel -opost -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke")
55
+ system("stty -F #{port} 115200 raw -brkint -icrnl -imaxbel -opost -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke")
56
56
  end
57
57
  end
58
58
 
59
59
  def get_addr
60
60
  # use a timeout here because we're using this to detect BLE112s and if it
61
61
  # isn't one, it may not respond right away
62
- response = bg_command(@file, BG_MSG_CLASS_SYSTEM, BG_GET_ADDRESS,nil,nil,0.2)
62
+ response = bg_command(@file, BG_MSG_CLASS_SYSTEM, BG_GET_ADDRESS,nil,nil,0.5)
63
63
  response[4..-1].reverse.unpack("H2:H2:H2:H2:H2:H2").join(":") if response && response.length == 10
64
64
  end
65
65
 
@@ -136,6 +136,7 @@ module ScanBeacon
136
136
  # try to reset all the devices
137
137
  device_count = possible_devices.count
138
138
  possible_devices.each do |device_path|
139
+ configure_port(device_path)
139
140
  File.open(device_path, 'r+b') do |file|
140
141
  bg_command(file, BG_MSG_CLASS_GAP, BG_DISCOVER_STOP, nil, nil, 0.5)
141
142
  end
@@ -1,3 +1,3 @@
1
1
  module ScanBeacon
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scan_beacon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Radius Networks