humble_rpi-plugin-ld3w 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dbd8cb5b87dcbf08be576349bd9b2daedb1e858c
4
- data.tar.gz: 7e6e80e622cd07a2805d51f36897c5ce3d638431
2
+ SHA256:
3
+ metadata.gz: 5ad2476657aa4dece8784739f03ca107b588523eb8aa5f1e08ae3f37c353d359
4
+ data.tar.gz: 190d29e3e013a6eef51c51beba8de0f3f3cf156614a7dded9963b6376aabc36e
5
5
  SHA512:
6
- metadata.gz: 1db62e750ef9d496c881a56d0aafea0f40ca7ca083cdb1dafb62a75d0d61ced97c43f4b927adcf7cf675a22c3cd191db36d0b6c2cdd24debfbd4e5b75c8d8cb8
7
- data.tar.gz: 6ae8fc87e58c20361d186c3cdfcf13ca4478e4ea117017de2d40ecf2a9cdbd29d8f3529b4f01851dbf3ce6ab016577f87a15869b027d2b51b7683b8cec4b1384
6
+ metadata.gz: a23800ebcf691ecc1f783e6c68dbe477c5fe15a6eb5ab0364a1906949db56e8c11e09ca62d97415e11e2c76291f2285c9bd47bd45b215027e21266494c68bd40
7
+ data.tar.gz: 99164d6f72116b0e697c69dd85675eeebb08b18739ed47c4d4e80ff502c770f8743bfcbd0e8308a5f3f03627640b242b3d08bd481bfe2035a34c166f0dbd2b7b
checksums.yaml.gz.sig CHANGED
Binary file
@@ -2,33 +2,52 @@
2
2
 
3
3
  # file: humble_rpi-plugin-ld3w.rb
4
4
 
5
+ # Intended for using a Nokia LD-3W with a Raspberry Pi from the Humble_RPi gem
5
6
 
6
7
  require 'ld3w'
7
- require 'run_every'
8
-
9
8
 
10
- # Intended for using a Nokia LD-3W with a Raspberry Pi from the Humble_RPi gem
11
9
 
12
10
 
13
11
  class HumbleRPiPluginLd3W
12
+ using ColouredText
14
13
 
15
- def initialize(settings: {}, variables: {})
14
+ def initialize(settings: {}, variables: {}, debug: false)
16
15
 
17
16
  h = {rfdevice: 'rfcomm0', bdaddress: '', channel: '1',
18
- refresh_rate: 60}.merge settings
19
- device_id = variables[:device_id] || 'pi'
20
-
21
- ld3w = Ld3w.new device: h[:rfdevice], bdaddress: h[:bdaddress],
22
- channel: h[:channel]
23
-
24
- RunEvery.new(seconds: h[:refresh_rate]) do
17
+ refresh_rate: 120}.merge settings
18
+ @device_id = variables[:device_id] || 'pi'
19
+ @debug, @h, @notifier = debug, h, variables[:notifier]
25
20
 
26
- loc = ld3w.locate
27
- variables[:notifier].notice "%s/gps: lat: %s lon: %s" %
28
- [device_id, loc.latitude, loc.longitude]
21
+ @ld3w = Ld3w.new device: h[:rfdevice], bdaddress: h[:bdaddress],
22
+ channel: h[:channel], verbose: false, affirmations: 5
23
+
24
+ end
25
+
26
+ def start()
27
+
28
+ while true do
29
+
30
+ begin
31
+
32
+ loc = @ld3w.locate
33
+ puts ('loc: ' + loc.inspect).debug if @debug
34
+ located = loc.is_a?(Array) ? loc.last : loc
35
+ @notifier.notice "%s/gps: lat: %s lon: %s" %
36
+ [@device_id, located.latitude, located.longitude]
37
+
38
+ rescue
39
+
40
+ @notifier.notice "%s/gps/warning: %s" % [@device_id,
41
+ 'unable to connect']
42
+ `service bluetooth restart`
43
+ sleep 6
44
+ retry
45
+
46
+ end
47
+
48
+ sleep(@h[:refresh_rate])
29
49
  end
30
50
 
31
-
32
51
  end
33
52
 
34
53
  alias on_start start
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humble_rpi-plugin-ld3w
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,28 +10,32 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZ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HQ4EFgQUEpUdnSZa
26
+ 06kH2SJEH/zxX0B0vS0wJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
27
+ c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
28
+ BgkqhkiG9w0BAQsFAAOCAYEATSgAZp9Q9LlMTcF7DkRHsXUWC+DulKnFfFriAkYV
29
+ CRuKUMoQwvDuqCzy53GzleLhzhq0wjWzNclAZtuh9iMDBRyP7Hb9p51jSfZ9EWo/
30
+ 5WxRAMtNIQcb0dXXYqBZuj2jnRvW39ffZO+8bgnxViF8MbtaqhUrFNqnVqX2sx6L
31
+ Xt1roFmm74RUsAyw9JMOPKxghBye/v55MNO/FqdLbe4VKhgnN1/R+7Atx9fPaXV3
32
+ tE7hxo4m1RQfjDQG1eu6lvpY/COoyIoqaClwSAYJoZiGl0Yn0nkjOyJwFSrTFkD2
33
+ ZruqFNAFuFSbOQAyS4ciuMrFo6WyoXGCzDNxRZwgJWPM+SSvdHdpcc5hlqXaGmlf
34
+ 1ccdREA3/LjSOBvKEcKJuyOyhisv4cdS71NZdz6KvkQgtNFc3h7TfpBf6EkpeN3u
35
+ YkwMDDFSGDOBZp24titDJWkWd6moaxXL+ucZidQoQ68wvNU7boHYtcetRYwIc2FC
36
+ SzEeOPFECbntXfYY5qoDQso9
33
37
  -----END CERTIFICATE-----
34
- date: 2017-06-21 00:00:00.000000000 Z
38
+ date: 2019-03-18 00:00:00.000000000 Z
35
39
  dependencies:
36
40
  - !ruby/object:Gem::Dependency
37
41
  name: ld3w
@@ -42,7 +46,7 @@ dependencies:
42
46
  version: '0.1'
43
47
  - - ">="
44
48
  - !ruby/object:Gem::Version
45
- version: 0.1.1
49
+ version: 0.2.1
46
50
  type: :runtime
47
51
  prerelease: false
48
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,27 +56,7 @@ dependencies:
52
56
  version: '0.1'
53
57
  - - ">="
54
58
  - !ruby/object:Gem::Version
55
- version: 0.1.1
56
- - !ruby/object:Gem::Dependency
57
- name: run_every
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '0.1'
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- version: 0.1.9
66
- type: :runtime
67
- prerelease: false
68
- version_requirements: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - "~>"
71
- - !ruby/object:Gem::Version
72
- version: '0.1'
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 0.1.9
59
+ version: 0.2.1
76
60
  description:
77
61
  email: james@jamesrobertson.eu
78
62
  executables: []
@@ -99,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
83
  - !ruby/object:Gem::Version
100
84
  version: '0'
101
85
  requirements: []
102
- rubyforge_project:
103
- rubygems_version: 2.6.8
86
+ rubygems_version: 3.0.1
104
87
  signing_key:
105
88
  specification_version: 4
106
89
  summary: Intended for using a Nokia LD-3W with a Raspberry Pi from the Humble_RPi
metadata.gz.sig CHANGED
@@ -1 +1,6 @@
1
- ��"Y�����~w��?SǂLp}YJIa � f�P������;�:J#�W^�*��%���:ӻ�\��)\
1
+ u���פ�e|�06��JV��G�Q�� ݂w
2
+ Y N�K���}_����
3
+ ә>��6�2�8�ڊ�S�{�Zֵ��q0��v��[V��ol�s*t���,z 4#Ȱ�@���d
4
+ V� ��O���i�`8>��1��Ѝ!�LX��
5
+ 1�/��N�xI+�#'j_V�Fp�TO������z�T1�Qq@z:r��5�)m����z��Ud�M i'_�Y������Q�� ����^�g��>���_
6
+ ���9ʶ ���B��Ð?�w�9O���Ƴ-����S�0�9O��:8բ��h�US�_$\d �K`n��f�