ld3w 0.2.0 → 0.2.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/ld3w.rb +12 -7
- metadata +21 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8158a4e3cca60735548af8b9a476e2527cceb0f3d85f03779066250de1db0d80
|
4
|
+
data.tar.gz: 664a72c74346be4635f04c6c872d4da940d36ee80174029df864a581f6106785
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef23374520ecefd8ea1abfa07a263f050ba7eee3915e3bb38343cb6a6ac89de4671fd8ebc5acba16130566ce5e5ab5d0619f80023bd1c68616c51bc9e8ce4a35
|
7
|
+
data.tar.gz: fc289c07621189c11283d10ff7642f0ed07dbdd1017115c579ec2dbc6629d715b11cba904074d0e6cf13022d118ebff7d4b5c4cf44909b9e0f0904a45bf65c71
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/ld3w.rb
CHANGED
@@ -4,15 +4,16 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
require 'nmea_parser'
|
7
|
+
require 'c32'
|
7
8
|
|
8
9
|
|
9
10
|
class Ld3wError < Exception
|
10
11
|
end
|
11
12
|
|
12
13
|
class Ld3w
|
14
|
+
using ColouredText
|
13
15
|
|
14
|
-
|
15
|
-
def initialize(device: '', bdaddress: 'rfcomm0', channel: '1',
|
16
|
+
def initialize(device: 'rfcomm0', bdaddress: '', channel: '1',
|
16
17
|
affirmations: 5, verbose: true)
|
17
18
|
|
18
19
|
@command = "rfcomm connect %s %s %s" % [device, bdaddress, channel]
|
@@ -36,15 +37,18 @@ class Ld3w
|
|
36
37
|
|
37
38
|
unless File.exists? @file then
|
38
39
|
|
39
|
-
`rfcomm release #{file}`
|
40
|
-
|
40
|
+
`rfcomm release #{@file}`
|
41
|
+
msg = 'Cannot open file ' + @file
|
42
|
+
puts msg.error
|
43
|
+
raise(Ld3wError, msg)
|
41
44
|
end
|
42
45
|
|
43
46
|
lines = read_file()
|
44
47
|
|
45
48
|
puts 'bye'
|
46
|
-
Process.kill('INT', io.pid)
|
49
|
+
Process.kill('INT', io.pid)
|
47
50
|
sleep 2
|
51
|
+
|
48
52
|
end
|
49
53
|
|
50
54
|
#`rfcomm release #{@device}`
|
@@ -66,10 +70,11 @@ class Ld3w
|
|
66
70
|
c = x.split(',').count('')
|
67
71
|
|
68
72
|
if x =~ pattern and c <= 2 then
|
69
|
-
lines << x
|
73
|
+
lines << x
|
74
|
+
|
70
75
|
line_count > @affirmations ? break : line_count += 1
|
71
76
|
end
|
72
|
-
sleep 0.
|
77
|
+
sleep 0.03
|
73
78
|
end
|
74
79
|
sleep 2
|
75
80
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ld3w
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -57,6 +57,26 @@ dependencies:
|
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: 0.3.4
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: c32
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0.1'
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.1.2
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0.1'
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 0.1.2
|
60
80
|
description:
|
61
81
|
email: james@jamesrobertson.eu
|
62
82
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|