gpsd_baud_rate 0.1.19 → 0.1.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gpsd_baud_rate.rb +22 -11
- data/lib/gpsd_baud_rate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1f74e4ed3062cd32fb1740d211ab0f14e8969690abd63d4dcf02ef04085874e
|
4
|
+
data.tar.gz: ab9032d09df266146cf0b5b7eab2b38f6940d5b76a52c3b9d424eba6e8857d56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6837db03f5f5e10f941d5efefc7c0a40b32817de73ec70058648eb448c71bc4a819df8024f289c37ffdb239157edf0960bb0504b3c51631e0c2d1b107ef69ba4
|
7
|
+
data.tar.gz: 1016651e6ea7b2c354102a7b6a83ee1da41a29c84358c5b283dfab2d52197dcbc43dfb7cc2e8d9879453e08bfb6d9a3ae31f132ac2b37995b8cb44410e912e02
|
data/lib/gpsd_baud_rate.rb
CHANGED
@@ -44,15 +44,23 @@ class GpsdBaudRate
|
|
44
44
|
@logger.debug "Service Status: #{GpsdBaudRate::gpsd_active?}"
|
45
45
|
@logger.debug "Baud Rate: #{inactive_rate = GpsdBaudRate::baud_rate}"
|
46
46
|
|
47
|
-
|
48
|
-
if (read_from_device active_rate) && (active_rate != b_rate)
|
49
|
-
@logger.debug "Setting Goal Rate (#{b_rate})"
|
50
|
-
set_PMTK_baud_rate b_rate
|
51
|
-
if read_from_device b_rate
|
52
|
-
@logger.debug "Goal Baud Rate (#{b_rate}) has been set"
|
53
|
-
end
|
54
|
-
else
|
47
|
+
if active_rate == b_rate
|
55
48
|
@logger.debug "Already at Goal Baud Rate"
|
49
|
+
else
|
50
|
+
@logger.debug "~~~~~~~~~~~~ Read at #{active_rate} baud ~~~~~~~~~~~~~~"
|
51
|
+
unless (read_from_device active_rate)
|
52
|
+
@logger.debug "Read at #{active_rate} baud Failed"
|
53
|
+
else
|
54
|
+
@logger.debug "Setting Goal Rate (#{b_rate})"
|
55
|
+
set_PMTK_baud_rate b_rate
|
56
|
+
@logger.debug "Attempting Read at #{b_rate}"
|
57
|
+
if read_from_device b_rate
|
58
|
+
@logger.debug "Baud Rate Modification Successful"
|
59
|
+
@logger.debug "Goal Baud Rate (#{b_rate}) has been set"
|
60
|
+
else
|
61
|
+
@logger.debug "Setting Baud Rate Failed"
|
62
|
+
end
|
63
|
+
end
|
56
64
|
end
|
57
65
|
#
|
58
66
|
# Cleanup
|
@@ -128,7 +136,7 @@ private
|
|
128
136
|
ser.read_timeout = 900
|
129
137
|
@logger.debug "ReadTimeout: #{ser.read_timeout} ms"
|
130
138
|
5.times { results << ser.readline(100)}
|
131
|
-
results.each { |s| @logger.debug s}
|
139
|
+
results.each { |s| @logger.debug s.strip!}
|
132
140
|
results.each do |r|
|
133
141
|
count += 1 if @@NMEA_sentences.any? { |s| s == r[0,6]}
|
134
142
|
end
|
@@ -149,7 +157,10 @@ private
|
|
149
157
|
results=[]
|
150
158
|
|
151
159
|
begin
|
152
|
-
@logger.debug "
|
160
|
+
@logger.debug "In write_to_device"
|
161
|
+
@logger.debug "cmmd: #{cmmd}, class: #{cmmd.class}"
|
162
|
+
@logger.debug "baud: #{baud}, class: #{baud.class}"
|
163
|
+
@logger.debug "Send to device @ #{baud}"
|
153
164
|
ser = SerialPort.open( @@device, baud, 8, 1, SerialPort::NONE) { |ser|
|
154
165
|
count = ser.write cmmd+"\r\n"
|
155
166
|
}
|
@@ -161,7 +172,7 @@ private
|
|
161
172
|
@logger.debug "Bytes Written: #{count}"
|
162
173
|
|
163
174
|
begin
|
164
|
-
@logger.debug "Receive response"
|
175
|
+
@logger.debug "Receive response @ #{@goal_rate}"
|
165
176
|
ser = SerialPort.open( @@device, @goal_rate, 8, 1, SerialPort::NONE) { |ser|
|
166
177
|
ser.read_timeout = 900
|
167
178
|
10.times {results << ser.readline(100)}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpsd_baud_rate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Finnegan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|