AutoApi.DiagnosticsState (auto_api v13.2.0) View Source
Keeps Diagnostics state
engine_oil_temperature: Engine oil temperature in Celsius, whereas can be negative
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
engine_oil_pressure_level() :: :low | :normal | :high | :low_soft | :low_hard | :no_sensor | :system_fault
Specs
fuel_level_accuracy() :: :measured | :calculated
Specs
low_voltage_battery_charge_level() :: :ok | :deactivation_level_1 | :deactivation_level_2 | :deactivation_level_3
Specs
nonce() :: binary()
Specs
t() :: %AutoApi.DiagnosticsState{
adblue_level: AutoApi.State.property(AutoApi.CustomType.percentage()),
anti_lock_braking: AutoApi.State.property(AutoApi.CustomType.active_state()),
backup_battery_remaining_time:
AutoApi.State.property(AutoApi.UnitType.duration()),
battery_level: AutoApi.State.property(AutoApi.CustomType.percentage()),
battery_voltage:
AutoApi.State.property(AutoApi.UnitType.electric_potential_difference()),
brake_fluid_level: AutoApi.State.property(AutoApi.CustomType.fluid_level()),
brake_lining_wear_pre_warning:
AutoApi.State.property(AutoApi.CustomType.active_state()),
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
),
check_control_messages:
AutoApi.State.multiple_property(AutoApi.CustomType.check_control_message()),
confirmed_trouble_codes:
AutoApi.State.multiple_property(AutoApi.CustomType.confirmed_trouble_code()),
diesel_exhaust_filter_status:
AutoApi.State.multiple_property(
AutoApi.CustomType.diesel_exhaust_filter_status()
),
diesel_exhaust_fluid_range: AutoApi.State.property(AutoApi.UnitType.length()),
diesel_particulate_filter_soot_level:
AutoApi.State.property(AutoApi.CustomType.percentage()),
distance_since_reset: AutoApi.State.property(AutoApi.UnitType.length()),
distance_since_start: AutoApi.State.property(AutoApi.UnitType.length()),
engine_coolant_fluid_level:
AutoApi.State.property(AutoApi.CustomType.fluid_level()),
engine_coolant_temperature:
AutoApi.State.property(AutoApi.UnitType.temperature()),
engine_load: AutoApi.State.property(AutoApi.CustomType.percentage()),
engine_oil_amount: AutoApi.State.property(AutoApi.UnitType.volume()),
engine_oil_fluid_level:
AutoApi.State.property(AutoApi.CustomType.fluid_level()),
engine_oil_level: AutoApi.State.property(AutoApi.CustomType.percentage()),
engine_oil_life_remaining:
AutoApi.State.property(AutoApi.CustomType.percentage()),
engine_oil_pressure_level:
AutoApi.State.property(
:low
| :normal
| :high
| :low_soft
| :low_hard
| :no_sensor
| :system_fault
),
engine_oil_service_status:
AutoApi.State.property(AutoApi.CustomType.service_status()),
engine_oil_temperature:
AutoApi.State.property(AutoApi.UnitType.temperature()),
engine_rpm: AutoApi.State.property(AutoApi.UnitType.angular_velocity()),
engine_time_to_next_service:
AutoApi.State.property(AutoApi.UnitType.duration()),
engine_torque: AutoApi.State.property(AutoApi.CustomType.percentage()),
engine_total_fuel_consumption:
AutoApi.State.property(AutoApi.UnitType.volume()),
engine_total_idle_operating_time:
AutoApi.State.property(AutoApi.UnitType.duration()),
engine_total_operating_hours:
AutoApi.State.property(AutoApi.UnitType.duration()),
engine_total_operating_time:
AutoApi.State.property(AutoApi.UnitType.duration()),
estimated_range: AutoApi.State.property(AutoApi.UnitType.length()),
estimated_secondary_powertrain_range:
AutoApi.State.property(AutoApi.UnitType.length()),
fuel_level: AutoApi.State.property(AutoApi.CustomType.percentage()),
fuel_level_accuracy: AutoApi.State.property(:measured | :calculated),
fuel_volume: AutoApi.State.property(AutoApi.UnitType.volume()),
low_voltage_battery_charge_level:
AutoApi.State.property(
:ok
| :deactivation_level_1
| :deactivation_level_2
| :deactivation_level_3
),
mileage: AutoApi.State.property(AutoApi.UnitType.length()),
mileage_meters: AutoApi.State.property(AutoApi.UnitType.length()),
nonce: AutoApi.State.property(binary()),
odometer: AutoApi.State.property(AutoApi.UnitType.length()),
oem_trouble_code_values:
AutoApi.State.multiple_property(AutoApi.CustomType.oem_trouble_code_value()),
passenger_airbag_status:
AutoApi.State.property(AutoApi.CustomType.active_state()),
speed: AutoApi.State.property(AutoApi.UnitType.speed()),
timestamp: AutoApi.State.property(DateTime.t()),
tire_pressure_statuses:
AutoApi.State.multiple_property(AutoApi.CustomType.tire_pressure_status()),
tire_pressures:
AutoApi.State.multiple_property(AutoApi.CustomType.tire_pressure()),
tire_pressures_differences:
AutoApi.State.multiple_property(AutoApi.CustomType.tire_pressure()),
tire_pressures_targets:
AutoApi.State.multiple_property(AutoApi.CustomType.tire_pressure()),
tire_temperatures:
AutoApi.State.multiple_property(AutoApi.CustomType.tire_temperature()),
trouble_codes:
AutoApi.State.multiple_property(AutoApi.CustomType.trouble_code()),
vehicle_signature: AutoApi.State.property(binary()),
vin: AutoApi.State.property(String.t()),
washer_fluid_level: AutoApi.State.property(AutoApi.CustomType.fluid_level()),
wheel_based_speed: AutoApi.State.property(AutoApi.UnitType.speed()),
wheel_rpms: AutoApi.State.multiple_property(AutoApi.CustomType.wheel_rpm())
}
Specs
timestamp() :: DateTime.t()
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 = <<22, 0, 11, 1, 0, 8, 64, 40, 0, 0, 0, 0, 0, 0>> iex> AutoApi.DiagnosticsState.from_bin(bin) %AutoApi.DiagnosticsState{engine_load: %AutoApi.Property{data: 12.0}}
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.DiagnosticsState{engine_load: %AutoApi.Property{data: 12}} iex> AutoApi.DiagnosticsState.to_bin(state) <<22, 0, 11, 1, 0, 8, 64, 40, 0, 0, 0, 0, 0, 0>>