class OGNClient::ReceiverStatus
Constants
- NO_FAIL_RECEIVER_VERSIONS
- NO_WARN_RECEIVER_VERSIONS
- RECEIVER_STATUS_PATTERN
Attributes
amperage[R]
cpu_load[R]
cpu_temperature[R]
good_and_bad_senders[R]
good_senders[R]
good_senders_signal_quality[R]
ntp_correction[R]
ntp_offset[R]
platform[R]
ram_free[R]
ram_total[R]
rf_correction_automatic[R]
rf_correction_manual[R]
senders[R]
senders_messages[R]
senders_signal_quality[R]
signal_quality[R]
version[R]
visible_senders[R]
voltage[R]
Public Instance Methods
bad_senders()
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 58 def bad_senders 59 good_and_bad_senders - good_senders 60 rescue 61 nil 62 end
invisible_senders()
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 52 def invisible_senders 53 senders - visible_senders 54 rescue 55 nil 56 end
Private Instance Methods
amperage=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 115 def amperage=(raw) 116 @amperage = raw.to_f.round(3) 117 end
cpu_load=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 87 def cpu_load=(raw) 88 @cpu_load = raw.to_f.round(2) 89 end
cpu_temperature=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 91 def cpu_temperature=(raw) 92 @cpu_temperature = raw.to_f.round(2) 93 end
good_and_bad_senders=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 151 def good_and_bad_senders=(raw) 152 @good_and_bad_senders = raw.to_i 153 end
good_senders=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 155 def good_senders=(raw) 156 @good_senders = raw.to_i 157 end
good_senders_signal_quality=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 147 def good_senders_signal_quality=(raw) 148 @good_senders_signal_quality = raw.to_f.round(3) 149 end
ntp_correction=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 107 def ntp_correction=(raw) 108 @ntp_correction = raw.to_f.round(2) 109 end
ntp_offset=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 103 def ntp_offset=(raw) 104 @ntp_offset = raw.to_f.round(2) 105 end
parse(raw, date: nil)
click to toggle source
Calls superclass method
OGNClient::Message::parse
# File lib/ogn_client/messages/receiver_status.rb 66 def parse(raw, date: nil) 67 raw.match RECEIVER_STATUS_PATTERN do |match| 68 super unless @raw 69 %i(version platform cpu_load cpu_temperature ram_free ram_total ntp_offset ntp_correction voltage amperage rf_correction_manual rf_correction_automatic senders visible_senders signal_quality senders_signal_quality senders_messages good_senders_signal_quality good_and_bad_senders good_senders).each do |attr| 70 send("#{attr}=", match[attr]) if match[attr] 71 end 72 self 73 end 74 end
platform=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 83 def platform=(raw) 84 @platform = raw.to_sym.downcase 85 end
ram_free=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 95 def ram_free=(raw) 96 @ram_free = raw.to_f.round(2) 97 end
ram_total=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 99 def ram_total=(raw) 100 @ram_total = raw.to_f.round(2) 101 end
rf_correction_automatic=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 123 def rf_correction_automatic=(raw) 124 @rf_correction_automatic = raw.to_f.round(1) 125 end
rf_correction_manual=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 119 def rf_correction_manual=(raw) 120 @rf_correction_manual = raw.to_i 121 end
senders=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 127 def senders=(raw) 128 @senders = raw.to_i 129 end
senders_messages=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 143 def senders_messages=(raw) 144 @senders_messages = raw.to_i 145 end
senders_signal_quality=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 139 def senders_signal_quality=(raw) 140 @senders_signal_quality = raw.to_f.round(3) 141 end
signal_quality=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 135 def signal_quality=(raw) 136 @signal_quality = raw.to_f.round(3) 137 end
version=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 76 def version=(raw) 77 @version = raw 78 fail(OGNClient::ReceiverError, "receiver version `#{@version}'") unless NO_FAIL_RECEIVER_VERSIONS.match?('', @version) 79 warn("WARNING: receiver version `#{@version}'") unless NO_WARN_RECEIVER_VERSIONS.match?('', @version) 80 @version 81 end
visible_senders=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 131 def visible_senders=(raw) 132 @visible_senders = raw.to_i 133 end
voltage=(raw)
click to toggle source
# File lib/ogn_client/messages/receiver_status.rb 111 def voltage=(raw) 112 @voltage = raw.to_f.round(3) 113 end