class MAVLink::Log::Entry

Attributes

crc[R]
header[R]
payload[R]
time[R]

Public Class Methods

new(raw_time, header, payload, raw_crc) click to toggle source
# File lib/mavlink/log/entry.rb, line 8
def initialize(raw_time, header, payload, raw_crc)
  @time = to_time(raw_time)
  @header = header
  @payload = payload
  @crc = to_crc(raw_crc)

  if false && header.id==40
    puts raw_time.unpack('H*')
    puts payload.unpack("H*")
    puts raw_crc.unpack('H*')
  end
end

Private Instance Methods

to_crc(raw) click to toggle source
# File lib/mavlink/log/entry.rb, line 27
def to_crc(raw)
  raw.unpack('S>')[0]
end
to_time(raw) click to toggle source
# File lib/mavlink/log/entry.rb, line 23
def to_time(raw)
  (raw[0..3].unpack('L>')[0] << 32) | raw[4..7].unpack('L>')[0]
end