Class: OGNClient::ReceiverStatus

Inherits:
Message
  • Object
show all
Defined in:
lib/ogn_client/messages/receiver_status.rb

Constant Summary collapse

RECEIVER_STATUS_PATTERN =
%r(
  (?:
    v(?<version>\d+\.\d+\.\d+)
    (?:\.(?<platform>.+?))?
  \s)?
  CPU:(?<cpu_load>[\d.]+)\s
  RAM:(?<ram_free>[\d.]+)/(?<ram_total>[\d.]+)MB\s
  NTP:(?<ntp_offset>[\d.]+)ms/(?<ntp_correction>[+-][\d.]+)ppm\s
  (?:(?<voltage>[\d.]+)V\s)?
  (?:(?<amperage>[\d.]+)A\s)?
  (?:(?<cpu_temperature>[+-][\d.]+)C\s*)?
  (?:(?<visible_senders>\d+)/(?<senders>\d+)Acfts\[1h\]\s*)?
  (?:RF:
    (?:
      (?<rf_correction_manual>[+-][\d]+)
      (?<rf_correction_automatic>[+-][\d.]+)ppm/
    )?
    (?<signal_quality>[+-][\d.]+)dB
    (?:/(?<senders_signal_quality>[+-][\d.]+)dB@10km\[(?<senders_messages>\d+)\])?
    (?:/(?<good_senders_signal_quality>[+-][\d.]+)dB@10km\[(?<good_senders>\d+)/(?<good_and_bad_senders>\d+)\])?
  )?
$)x
NO_WARN_RECEIVER_VERSIONS =
Gem::Dependency.new('', '>= 0.2.6', '< 0.2.8')
NO_FAIL_RECEIVER_VERSIONS =
Gem::Dependency.new('', '< 0.3')

Constants inherited from Message

Message::POSITION_PATTERN

Instance Attribute Summary collapse

Attributes inherited from Message

#altitude, #callsign, #ground_speed, #heading, #latitude, #longitude, #raw, #receiver, #time

Instance Method Summary collapse

Methods inherited from Message

parse, #to_s

Instance Attribute Details

#amperageObject

board amperage in A



40
41
42
# File 'lib/ogn_client/messages/receiver_status.rb', line 40

def amperage
  @amperage
end

#cpu_loadObject

as reported by “uptime”



33
34
35
# File 'lib/ogn_client/messages/receiver_status.rb', line 33

def cpu_load
  @cpu_load
end

#cpu_temperatureObject

degrees celsius



34
35
36
# File 'lib/ogn_client/messages/receiver_status.rb', line 34

def cpu_temperature
  @cpu_temperature
end

#good_and_bad_sendersObject

number of good and bad senders within the last 24 hours



49
50
51
# File 'lib/ogn_client/messages/receiver_status.rb', line 49

def good_and_bad_senders
  @good_and_bad_senders
end

#good_sendersObject

number of good senders (transmitting properly) within the last 24 hours



50
51
52
# File 'lib/ogn_client/messages/receiver_status.rb', line 50

def good_senders
  @good_senders
end

#good_senders_signal_qualityObject

average signal-to-noise ratio in decibel of good senders (transmitting properly) within the last 24 hours



48
49
50
# File 'lib/ogn_client/messages/receiver_status.rb', line 48

def good_senders_signal_quality
  @good_senders_signal_quality
end

#ntp_correctionObject

parts-per-million



38
39
40
# File 'lib/ogn_client/messages/receiver_status.rb', line 38

def ntp_correction
  @ntp_correction
end

#ntp_offsetObject

milliseconds



37
38
39
# File 'lib/ogn_client/messages/receiver_status.rb', line 37

def ntp_offset
  @ntp_offset
end

#platformObject

e.g. “ARM”



32
33
34
# File 'lib/ogn_client/messages/receiver_status.rb', line 32

def platform
  @platform
end

#ram_freeObject

megabytes



35
36
37
# File 'lib/ogn_client/messages/receiver_status.rb', line 35

def ram_free
  @ram_free
end

#ram_totalObject

megabytes



36
37
38
# File 'lib/ogn_client/messages/receiver_status.rb', line 36

def ram_total
  @ram_total
end

#rf_correction_automaticObject

based on GSM



42
43
44
# File 'lib/ogn_client/messages/receiver_status.rb', line 42

def rf_correction_automatic
  @rf_correction_automatic
end

#rf_correction_manualObject

as per configuration



41
42
43
# File 'lib/ogn_client/messages/receiver_status.rb', line 41

def rf_correction_manual
  @rf_correction_manual
end

#sendersObject

number of senders within the last hour



43
44
45
# File 'lib/ogn_client/messages/receiver_status.rb', line 43

def senders
  @senders
end

#senders_messagesObject

number of messages analyzed to calculate the above



47
48
49
# File 'lib/ogn_client/messages/receiver_status.rb', line 47

def senders_messages
  @senders_messages
end

#senders_signal_qualityObject

average signal-to-noise ratio in decibel across all senders



46
47
48
# File 'lib/ogn_client/messages/receiver_status.rb', line 46

def senders_signal_quality
  @senders_signal_quality
end

#signal_qualityObject

signal-to-noise ratio in decibel



45
46
47
# File 'lib/ogn_client/messages/receiver_status.rb', line 45

def signal_quality
  @signal_quality
end

#versionObject

software version as “major.minor.patch”



31
32
33
# File 'lib/ogn_client/messages/receiver_status.rb', line 31

def version
  @version
end

#visible_sendersObject

number of visible senders within the last hour



44
45
46
# File 'lib/ogn_client/messages/receiver_status.rb', line 44

def visible_senders
  @visible_senders
end

#voltageObject

board voltage in V



39
40
41
# File 'lib/ogn_client/messages/receiver_status.rb', line 39

def voltage
  @voltage
end

Instance Method Details

#bad_sendersObject



58
59
60
61
62
# File 'lib/ogn_client/messages/receiver_status.rb', line 58

def bad_senders
  good_and_bad_senders - good_senders
rescue
  nil
end

#invisible_sendersObject



52
53
54
55
56
# File 'lib/ogn_client/messages/receiver_status.rb', line 52

def invisible_senders
  senders - visible_senders
rescue
  nil
end