AutoApi.RaceState (auto_api v13.2.0) View Source
Keeps Race state
Link to this section Summary
Functions
Callback implementation for AutoApi.State.base/0
.
Build state based on binary value
Convenience function to build the State properties.
Parse state to bin
Link to this section Types
Specs
brand() :: :unknown | :abarth | :alfaromeo | :alpine | :audi | :bmw | :cadillac | :chevrolet | :chrysler | :citroen | :cupra | :dacia | :dodge | :ds | :fiat | :ford | :honda | :hyundai | :iveco | :jaguar | :jeep | :kia | :lancia | :land_rover | :lexus | :man | :mazda | :mercedes_benz | :mini | :mitsubishi | :nissan | :opel | :peugeot | :porsche | :renault | :seat | :skoda | :smart | :subaru | :toyota | :volkswagen | :volvo_cars | :emulator
Specs
drivetrain_state() :: :inactive | :race_start_preparation | :race_start | :start | :comfort_start | :start_idle_run_control | :ready_for_overpressing | :low_speed_mode | :e_launch
Specs
gear_mode() :: :manual | :park | :reverse | :neutral | :drive | :low_gear | :sport
Specs
nonce() :: binary()
Specs
selected_gear() :: integer()
Specs
t() :: %AutoApi.RaceState{ accelerations: AutoApi.State.multiple_property(AutoApi.CustomType.acceleration()), accelerator_durations: AutoApi.State.multiple_property(AutoApi.CustomType.accelerator_duration()), accelerator_pedal_idle_switch: AutoApi.State.property(AutoApi.CustomType.active_state()), accelerator_pedal_kickdown_switch: AutoApi.State.property(AutoApi.CustomType.active_state()), brake_pedal_position: AutoApi.State.property(AutoApi.CustomType.percentage()), brake_pedal_switch: AutoApi.State.property(AutoApi.CustomType.active_state()), brake_pressure: AutoApi.State.property(AutoApi.UnitType.pressure()), brake_torque_vectorings: AutoApi.State.multiple_property(AutoApi.CustomType.brake_torque_vectoring()), brand: AutoApi.State.property( :unknown | :abarth | :alfaromeo | :alpine | :audi | :bmw | :cadillac | :chevrolet | :chrysler | :citroen | :cupra | :dacia | :dodge | :ds | :fiat | :ford | :honda | :hyundai | :iveco | :jaguar | :jeep | :kia | :lancia | :land_rover | :lexus | :man | :mazda | :mercedes_benz | :mini | :mitsubishi | :nissan | :opel | :peugeot | :porsche | :renault | :seat | :skoda | :smart | :subaru | :toyota | :volkswagen | :volvo_cars | :emulator ), clutch_pedal_switch: AutoApi.State.property(AutoApi.CustomType.active_state()), drivetrain_state: AutoApi.State.property( :inactive | :race_start_preparation | :race_start | :start | :comfort_start | :start_idle_run_control | :ready_for_overpressing | :low_speed_mode | :e_launch ), electronic_stability_program: AutoApi.State.property(AutoApi.CustomType.active_state()), gas_pedal_position: AutoApi.State.property(AutoApi.CustomType.percentage()), gear_mode: AutoApi.State.property( :manual | :park | :reverse | :neutral | :drive | :low_gear | :sport ), nonce: AutoApi.State.property(binary()), oversteering: AutoApi.State.property(AutoApi.CustomType.percentage()), rear_suspension_steering: AutoApi.State.property(AutoApi.UnitType.angle()), selected_gear: AutoApi.State.property(integer()), steering_angle: AutoApi.State.property(AutoApi.UnitType.angle()), timestamp: AutoApi.State.property(DateTime.t()), understeering: AutoApi.State.property(AutoApi.CustomType.percentage()), vehicle_moving: AutoApi.State.property(:not_moving | :moving), vehicle_signature: AutoApi.State.property(binary()), vin: AutoApi.State.property(String.t()), yaw_rate: AutoApi.State.property(AutoApi.UnitType.angular_velocity()) }
Specs
timestamp() :: DateTime.t()
Specs
vehicle_moving() :: :not_moving | :moving
Specs
vehicle_signature() :: binary()
Specs
vin() :: String.t()
Link to this section Functions
Specs
base() :: t()
Callback implementation for AutoApi.State.base/0
.
Specs
Build state based on binary value
iex> bin = <<2, 0, 11, 1, 0, 8, 64, 54, 43, 133, 30, 184, 81, 236>> iex> AutoApi.RaceState.from_bin(bin) %AutoApi.RaceState{understeering: %AutoApi.Property{data: 22.17}}
Specs
Convenience function to build the State properties.
See AutoApi.State.put/3
.
Examples
iex> state_base = AutoApi.DiagnosticsState.base()
iex> odometer = %{value: 10_921, unit: :kilometers}
iex> state_1 = AutoApi.DiagnosticsState.put(state_base, :odometer, data: odometer)
iex> state_2 = AutoApi.State.put(state_base, :odometer, data: odometer)
iex> state_1 === state_2
true
Specs
Parse state to bin
iex> state = %AutoApi.RaceState{understeering: %AutoApi.Property{data: 22.17}} iex> AutoApi.RaceState.to_bin(state) <<2, 0, 11, 1, 0, 8, 64, 54, 43, 133, 30, 184, 81, 236>>