Class: LiveF1::Packet::Sys::SessionStart
- Inherits:
-
LiveF1::Packet::Sys
- Object
- LiveF1::Packet
- LiveF1::Packet::Sys
- LiveF1::Packet::Sys::SessionStart
- Includes:
- Type::Short
- Defined in:
- lib/live_f1/packet/sys/session_start.rb
Overview
A SessionStart packet is the first packet emitted for a session.
Instance Attribute Summary
Attributes inherited from LiveF1::Packet
Instance Method Summary collapse
-
#event_type ⇒ Object
The type of event this is (practise, qualifying or race) as defined by the constants in Event::Type.
- #inspect ⇒ Object
-
#session_number ⇒ Object
The formula1.com unique identifier for this session.
Methods included from Type::Short
Methods inherited from LiveF1::Packet
from_source, #initialize, #leader, #spare_bits, #spare_data, #to_s
Constructor Details
This class inherits a constructor from LiveF1::Packet
Instance Method Details
#event_type ⇒ Object
The type of event this is (practise, qualifying or race) as defined by the constants in Event::Type
15 16 17 |
# File 'lib/live_f1/packet/sys/session_start.rb', line 15 def event_type header.data & 0b0111 end |
#inspect ⇒ Object
19 20 21 |
# File 'lib/live_f1/packet/sys/session_start.rb', line 19 def inspect "Event #{session_number} Start (#{Event::Type.name_for event_type})" end |
#session_number ⇒ Object
The formula1.com unique identifier for this session
9 10 11 |
# File 'lib/live_f1/packet/sys/session_start.rb', line 9 def session_number data[1..-1].to_i end |