scan_beacon 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/scan_beacon/bluez_advertiser.rb +4 -1
- data/lib/scan_beacon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2b7617a9e68313af6754ea7c7eae1149c2e5e83
|
4
|
+
data.tar.gz: 5dbe6e0b2a002f5d0305b094721f4cc96b186aac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd197c5905d393d47eedc823b934ecff75c30ba633bbc56a39a9f945f113d643b24007c912350d2cc461f2c4f172778507eef207d653625e2c56b7401da6330d
|
7
|
+
data.tar.gz: 68db3ac31891c2feac3caf8ed29fb7f90378a5862d6d2fc98c9dcdcfac746d85ff9c694769924ce6cfea138562d56e80c51dd065c7820da357ba1de657b97562
|
data/README.md
CHANGED
@@ -8,6 +8,7 @@ A ruby gem that allows you to scan for beacon advertisements using CoreBluetooth
|
|
8
8
|
```
|
9
9
|
gem install scan_beacon
|
10
10
|
```
|
11
|
+
[Tips for installing & using on Ubuntu](https://github.com/RadiusNetworks/scanbeacon-gem/wiki/ubuntu)
|
11
12
|
|
12
13
|
## Create your scanner
|
13
14
|
``` ruby
|
@@ -89,4 +90,3 @@ advertiser.stop
|
|
89
90
|
To scan for beacons, you must have a Linux machine with BlueZ installed, or a Mac, or a BLE112 device plugged in to a USB port (on Mac or Linux).
|
90
91
|
|
91
92
|
To advertise as a beacon, you must have a Linux machine with BlueZ installed.
|
92
|
-
|
@@ -57,7 +57,10 @@ module ScanBeacon
|
|
57
57
|
|
58
58
|
def random_addr
|
59
59
|
data = @initial_addr + Time.now.to_s
|
60
|
-
Digest::SHA256.digest(data)[0..5]
|
60
|
+
new_addr = Digest::SHA256.digest(data)[0..5]
|
61
|
+
# the most significant bit must not be set!
|
62
|
+
new_addr[0] = [(new_addr[0].unpack("C")[0] & 0x7F)].pack("C")
|
63
|
+
new_addr.unpack("H2:H2:H2:H2:H2:H2").join(":")
|
61
64
|
end
|
62
65
|
|
63
66
|
end
|
data/lib/scan_beacon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scan_beacon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Radius Networks
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|