Class: OGNClient::SenderBeacon

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

Constant Summary collapse

SENDER_BEACON_PATTERN =
%r(
  id(?<details>\w{2})(?<id>\w{6})\s?
  (?:(?<climb_rate>[+-]\d+?)fpm\s)?
  (?:(?<turn_rate>[+-][\d.]+?)rot\s)?
  (?:FL(?<flight_level>[\d.]+)\s)?
  (?:(?<signal_quality>[\d.]+?)dB\s)?
  (?:(?<errors>\d+)e\s)?
  (?:(?<frequency_offset>[+-][\d.]+?)kHz\s?)?
  (?:gps(?<gps_accuracy>\d+x\d+)\s?)?
  (?:s(?<flarm_software_version>[\d.]+)\s?)?
  (?:h(?<flarm_hardware_version>[\dA-F]{2})\s?)?
  (?:r(?<flarm_id>[\dA-F]+)\s?)?
  (?:(?<signal_power>[+-][\d.]+)dBm\s?)?
  (?:hear(?<proximity>.+))?
$)x
SENDER_TYPES =
{
   1 => :glider,
   2 => :tow_plane,
   3 => :helicopter_rotorcraft,
   4 => :parachute,
   5 => :drop_plane,
   6 => :hang_glider,
   7 => :para_glider,
   8 => :powered_aircraft,
   9 => :jet_aircraft,
  10 => :ufo,
  11 => :balloon,
  12 => :airship,
  13 => :uav,
  15 => :static_object
}
ADDRESS_TYPES =
{
  0 => :random,
  1 => :icao,
  2 => :flarm,
  3 => :ogn
}

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

Method Summary

Methods inherited from Message

parse, #to_s

Instance Attribute Details

#address_typeObject (readonly)

see ADDRESS_TYPES



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

def address_type
  @address_type
end

#climb_rateObject

meters per second



51
52
53
# File 'lib/ogn_client/messages/sender_beacon.rb', line 51

def climb_rate
  @climb_rate
end

#errorsObject

number of CRC errors



55
56
57
# File 'lib/ogn_client/messages/sender_beacon.rb', line 55

def errors
  @errors
end

#flarm_hardware_versionObject

version as “major”



59
60
61
# File 'lib/ogn_client/messages/sender_beacon.rb', line 59

def flarm_hardware_version
  @flarm_hardware_version
end

#flarm_idObject

FLARM device ID



60
61
62
# File 'lib/ogn_client/messages/sender_beacon.rb', line 60

def flarm_id
  @flarm_id
end

#flarm_software_versionObject

version as “major.minor”



58
59
60
# File 'lib/ogn_client/messages/sender_beacon.rb', line 58

def flarm_software_version
  @flarm_software_version
end

#flight_levelObject

100 feet QNE



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

def flight_level
  @flight_level
end

#frequency_offsetObject

kilohertz



56
57
58
# File 'lib/ogn_client/messages/sender_beacon.rb', line 56

def frequency_offset
  @frequency_offset
end

#gps_accuracyObject

array [vertical meters, horizontal meters]



57
58
59
# File 'lib/ogn_client/messages/sender_beacon.rb', line 57

def gps_accuracy
  @gps_accuracy
end

#idObject

device ID



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

def id
  @id
end

#no_trackingObject (readonly)

boolean



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

def no_tracking
  @no_tracking
end

#proximityObject

array of FLARM device ID tails



61
62
63
# File 'lib/ogn_client/messages/sender_beacon.rb', line 61

def proximity
  @proximity
end

#sender_typeObject (readonly)

see SENDER_TYPES



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

def sender_type
  @sender_type
end

#signal_powerObject

power ratio in dBm



53
54
55
# File 'lib/ogn_client/messages/sender_beacon.rb', line 53

def signal_power
  @signal_power
end

#signal_qualityObject

signal-to-noise ratio in decibel



54
55
56
# File 'lib/ogn_client/messages/sender_beacon.rb', line 54

def signal_quality
  @signal_quality
end

#stealth_modeObject (readonly)

boolean



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

def stealth_mode
  @stealth_mode
end

#turn_rateObject

revolutions per minute



52
53
54
# File 'lib/ogn_client/messages/sender_beacon.rb', line 52

def turn_rate
  @turn_rate
end