Module: ADSB::Messages::Identification
- Defined in:
- lib/adsb/messages/identification.rb
Instance Method Summary collapse
-
#identification ⇒ Object
Get the reported identification.
Instance Method Details
#identification ⇒ Object
Get the reported identification.
Examples
= ADSB::Message.new('8D4840D6202CC371C32CE0576098')
address = .address
10 11 12 13 14 15 16 |
# File 'lib/adsb/messages/identification.rb', line 10 def identification characters = '#ABCDEFGHIJKLMNOPQRSTUVWXYZ#####_###############0123456789######' data = self.data[8..-1] identification = String.new (0..48).step(6) { |x| identification += characters[data[x..x + 5].to_i(2)] } return identification.gsub(/(_|#)/, String.new) end |