hcitools_wrapper 0.2.1 → 0.2.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/hcitools_wrapper.rb +11 -7
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74b4e050613a25b34de5a308a0905df6b3de5bec
|
|
4
|
+
data.tar.gz: 8b9302c4ab5cf01fca8a5b2c5ae84f75bc8f25e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1e264bb3a7c174d7589f8d3406b97c3bfb2cb76deb6facbffa014e8bd3542f444b5108e8c0294d3800517465c58fdf99a14ef5cc026281026fbf7c34f92f155e
|
|
7
|
+
data.tar.gz: 3ae7cbc26149afc51f4812893e2c7b1d1440e938a1300703cf68c18c5e7c4e2027cc67c5c0f6be5dddd99257ff8bd40cdac2c9d82d227a2dde1760fec2456fd4
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/hcitools_wrapper.rb
CHANGED
|
@@ -9,22 +9,26 @@ module HcitoolsWrapper
|
|
|
9
9
|
|
|
10
10
|
# options interval and duration are in seconds
|
|
11
11
|
#
|
|
12
|
-
def self.start(runinterval:
|
|
12
|
+
def self.start(runinterval: 8, scanduration: 0.3)
|
|
13
13
|
|
|
14
14
|
while true do
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
sleep scanduration
|
|
18
|
-
`sudo pkill --signal SIGINT hcitool`
|
|
16
|
+
sleep 1
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
`sudo hcitool lescan>result.txt &
|
|
19
|
+
sleep #{scanduration}
|
|
20
|
+
sudo pkill --signal SIGINT hcitool`
|
|
21
|
+
|
|
22
|
+
sleep runinterval - 1
|
|
21
23
|
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
end
|
|
25
27
|
|
|
26
|
-
at_exit do
|
|
28
|
+
at_exit do
|
|
29
|
+
|
|
27
30
|
`sudo hciconfig hci0 reset `
|
|
31
|
+
puts 'bye'
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
end
|
|
@@ -71,7 +75,7 @@ module HcitoolsWrapper
|
|
|
71
75
|
puts 'movement!' if @verbose
|
|
72
76
|
|
|
73
77
|
if block_given? then
|
|
74
|
-
yield( a, rssi == a.min ? rssi : avg)
|
|
78
|
+
yield( a, (rssi == a.min and rssi < -85) ? rssi : avg)
|
|
75
79
|
end
|
|
76
80
|
|
|
77
81
|
a = []
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hcitools_wrapper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
zUSFf/yp8K6i0NNL6umy/xpv+2v4DFJo/OxVeDHpyyaJnVVKM/70sw8VQZYjiiYU
|
|
32
32
|
31I/k3v2LBoYwA==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2015-
|
|
34
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
|
35
35
|
dependencies: []
|
|
36
36
|
description:
|
|
37
37
|
email: james@r0bertson.co.uk
|
metadata.gz.sig
CHANGED
|
Binary file
|