gpsd_baud_rate 0.1.11 → 0.1.16

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
2
  SHA256:
3
- metadata.gz: 9dcd80b6f9212df43d68ed6181b4dbc223e97b7f545ffe76d3eb757f4f46eb1f
4
- data.tar.gz: 07a523b29e4374430ab640cda4185a525d5a3093ed82bf5e315b94b7aa211590
3
+ metadata.gz: c2fb192f036b4f0db6eb2793863c154272f7c76f0cfd45b492324156a18aba1e
4
+ data.tar.gz: b0db4f3bac4e2d769361172d37c77284850030efbad370c70bb741d5fc66e9bd
5
5
  SHA512:
6
- metadata.gz: 2e9b66247d0fe6a8da2c216c0ab8d90cc39497c8e18461adc2736f682d225136bc2e0c7a6b0aa1bd227f30d2f6e458c059320148e12f3d791595666449f7740d
7
- data.tar.gz: f4ae5978fe3f3d7658490a993d556e71a622cafa31899affcca4e380a9ac751cab8c3acde49b26332bff5bc9bd4c20301c2e1eed1fd7ff7ff99fff5f2dcb5f76
6
+ metadata.gz: 3794b039fcc73db51ebaadab8692ee36b5c9f14e2d57beb6d2f191e4be616a6c08a46e47b4a83357dd7d6a432136be0a5c35ceeccb8f28964ab4f4cbc9c59966
7
+ data.tar.gz: 1bc181c62103e70c24197ae251fef229f1105b00e25c01cd1762ea03163e3ed7a5bb24700601b073eb5179bf8b6eeb4d5b2514bd3b2c8afffc2427624d413d0d
@@ -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
- =begin
32
+
33
33
  @goal_rate = goal_rate.to_i
34
34
  @logger.debug "Goal_rate: #{@goal_rate}"
35
+ end #initiallize
35
36
 
36
-
37
- gpsd_start unless gpsd_active? #make sure it's running
38
-
39
- @logger.debug "Service Status: #{gpsd_active?}"
40
- @logger.debug "Baud Rate: #{@active_rate = baud_rate}"
41
- gpsd_stop
42
- @logger.debug "Service Status: #{gpsd_active?}"
43
- @logger.debug "Baud Rate: #{@inactive_rate = baud_rate}"
44
-
45
- @logger.debug "\n~~~~~~~~~~~~ Read at #{@active_rate} baud ~~~~~~~~~~~~~~"
46
- if (read_from_device @active_rate) && (@active_rate != @goal_rate)
47
- @logger.debug "Setting Goal Rate (#{goal_rate})"
48
- set_PMTK_baud_rate @goal_rate
49
- if read_from_device @goal_rate
50
- @logger.debug "Goal Baud Rate (#{@goal_rate}) has been set"
37
+ def set_baud_rate b_rate = @goal_rate
38
+ gpsd_start unless self.gpsd_active? #make sure it's running
39
+
40
+ @logger.debug "Service Status: #{self.gpsd_active?}"
41
+ @logger.debug "Baud Rate: #{active_rate = self.baud_rate}"
42
+ self.gpsd_stop
43
+ @logger.debug "Service Status: #{self.gpsd_active?}"
44
+ @logger.debug "Baud Rate: #{inactive_rate = self.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
- =end
62
- end #initiallize
60
+
61
+ end
63
62
 
64
63
  #~~~~~~~~~~~~~~~~~~~~~ gpsd_status ~~~~~~~~~~~~~~~~~
65
64
 
@@ -67,7 +66,7 @@ class GpsdBaudRate
67
66
  def self.check_device?
68
67
  # Does the @@device exist and is it a character device
69
68
  # [[ ]] returns true (0) if 'file' exists
70
- 0 == %x| [[ -c "#{@@device}" ]] ; echo $?|
69
+ "0\n" == %x| [ -c "#{@@device}" ] ; echo $?|
71
70
 
72
71
  end
73
72
 
@@ -1,3 +1,3 @@
1
1
  class GpsdBaudRate
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.16"
3
3
  end
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.11
4
+ version: 0.1.16
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-08-28 00:00:00.000000000 Z
11
+ date: 2020-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler