Class: LiveF1::Packet::Sys::Timestamp

Inherits:
LiveF1::Packet::Sys show all
Includes:
Decryptable, Type::Timestamp
Defined in:
lib/live_f1/packet/sys/timestamp.rb

Overview

Individual packets don’t include any timestamp data to indicate when they happened. However, at selected (but irregular) intervals Timestamp packets are emitted containing the number of seconds since the start of the session.

Instance Attribute Summary

Attributes included from Decryptable

#raw_data

Attributes inherited from LiveF1::Packet

#data, #header, #source

Instance Method Summary collapse

Methods included from Decryptable

#bytes, #data=

Methods included from Type::Timestamp

#length, #spare_bits

Methods inherited from LiveF1::Packet

from_source, #initialize, #inspect, #leader, #spare_bits, #spare_data

Constructor Details

This class inherits a constructor from LiveF1::Packet

Instance Method Details

#numberObject

The number of seconds since the start of the session.



13
14
15
# File 'lib/live_f1/packet/sys/timestamp.rb', line 13

def number
					data.unpack("v").first
end

#to_sObject



17
18
19
# File 'lib/live_f1/packet/sys/timestamp.rb', line 17

def to_s
  number
end