gpsd_baud_rate 0.1.14 → 0.1.15
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 +14 -15
- 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: 7edbb900b945ba5b1c98f95180fbee52539825772ac20e7721a4a2144fe89b2c
|
4
|
+
data.tar.gz: 3c8244a6189cfbfe055a3c1e6fb8c1429f542a594410e5e7efbe19c7399f223c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dfffb5e3d285fbbcda0eb2681345bfb0e62628167fe1cfb7ce62cf100d31da72cb3dd2637c38b5d000a55562bc90755eff34082e4692fc02530328b6592a9d6
|
7
|
+
data.tar.gz: 96ad8b521beb30ec7090beae1b254ce79d3db75280fa192c9e9a1a70bf60ee873137912163da65e11d72ae2581cbf1eb1b6ef3970618008eb5f8d1e7964740ae
|
data/lib/gpsd_baud_rate.rb
CHANGED
@@ -29,37 +29,36 @@ class GpsdBaudRate
|
|
29
29
|
end
|
30
30
|
# pid= %x|pgrep -f "ruby /home/deploy/bin/set_baud.rb"|
|
31
31
|
# @logger.debug "Pid: #{pid}, $$: #{$$}, $BASHPID: #{$BASHPID}"
|
32
|
-
|
32
|
+
|
33
33
|
@goal_rate = goal_rate.to_i
|
34
34
|
@logger.debug "Goal_rate: #{@goal_rate}"
|
35
|
+
end #initiallize
|
35
36
|
|
36
|
-
|
37
|
+
def set_baud_rate b_rate = @goal_rate
|
37
38
|
gpsd_start unless gpsd_active? #make sure it's running
|
38
39
|
|
39
40
|
@logger.debug "Service Status: #{gpsd_active?}"
|
40
|
-
@logger.debug "Baud Rate: #{
|
41
|
+
@logger.debug "Baud Rate: #{active_rate = baud_rate}"
|
41
42
|
gpsd_stop
|
42
43
|
@logger.debug "Service Status: #{gpsd_active?}"
|
43
|
-
@logger.debug "Baud Rate: #{
|
44
|
-
|
45
|
-
@logger.debug "\n~~~~~~~~~~~~ Read at #{
|
46
|
-
if (read_from_device
|
47
|
-
@logger.debug "Setting Goal Rate (#{
|
48
|
-
set_PMTK_baud_rate
|
49
|
-
if read_from_device
|
50
|
-
@logger.debug "Goal Baud Rate (#{
|
44
|
+
@logger.debug "Baud Rate: #{inactive_rate = baud_rate}"
|
45
|
+
|
46
|
+
@logger.debug "\n~~~~~~~~~~~~ Read at #{active_rate} baud ~~~~~~~~~~~~~~"
|
47
|
+
if (read_from_device active_rate) && (active_rate != b_rate)
|
48
|
+
@logger.debug "Setting Goal Rate (#{b_rate})"
|
49
|
+
set_PMTK_baud_rate b_rate
|
50
|
+
if read_from_device b_rate
|
51
|
+
@logger.debug "Goal Baud Rate (#{b_rate}) has been set"
|
51
52
|
end
|
52
53
|
else
|
53
54
|
@logger.debug "Already at Goal Baud Rate"
|
54
55
|
end
|
55
|
-
|
56
|
-
|
57
56
|
#
|
58
57
|
# Cleanup
|
59
58
|
gpsd_start
|
60
59
|
@logger.debug "Service Status: #{gpsd_active?}"
|
61
|
-
|
62
|
-
end
|
60
|
+
|
61
|
+
end
|
63
62
|
|
64
63
|
#~~~~~~~~~~~~~~~~~~~~~ gpsd_status ~~~~~~~~~~~~~~~~~
|
65
64
|
|
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.15
|
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-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|