AutoApi.TripsState (auto_api v13.2.0) View Source
Trips 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
braking_count() :: integer()
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
description() :: String.t()
Specs
driver_name() :: String.t()
Specs
eco_level() :: :high | :medium
Specs
end_address() :: String.t()
Specs
end_time() :: DateTime.t()
Specs
event() :: :harsh_braking | :harsh_acceleration | :sharp_turn | :over_rpm | :overspeed | :idling_engine_on | :emergency_braking
Specs
nonce() :: binary()
Specs
road_type() :: :private_or_gravel | :local | :county | :rural | :federal_highway | :highway | :country | :national
Specs
start_address() :: String.t()
Specs
start_time() :: DateTime.t()
Specs
t() :: %AutoApi.TripsState{ average_fuel_consumption: AutoApi.State.property(AutoApi.UnitType.fuel_efficiency()), braking_count: AutoApi.State.property(integer()), 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 ), description: AutoApi.State.property(String.t()), distance: AutoApi.State.property(AutoApi.UnitType.length()), driver_name: AutoApi.State.property(String.t()), eco_level: AutoApi.State.property(:high | :medium), end_address: AutoApi.State.property(String.t()), end_address_components: AutoApi.State.multiple_property(AutoApi.CustomType.address_component()), end_coordinates: AutoApi.State.property(AutoApi.CustomType.coordinates()), end_odometer: AutoApi.State.property(AutoApi.UnitType.length()), end_time: AutoApi.State.property(DateTime.t()), event: AutoApi.State.property( :harsh_braking | :harsh_acceleration | :sharp_turn | :over_rpm | :overspeed | :idling_engine_on | :emergency_braking ), maximum_speed: AutoApi.State.property(AutoApi.UnitType.speed()), nonce: AutoApi.State.property(binary()), road_type: AutoApi.State.property( :private_or_gravel | :local | :county | :rural | :federal_highway | :highway | :country | :national ), start_address: AutoApi.State.property(String.t()), start_address_components: AutoApi.State.multiple_property(AutoApi.CustomType.address_component()), start_coordinates: AutoApi.State.property(AutoApi.CustomType.coordinates()), start_odometer: AutoApi.State.property(AutoApi.UnitType.length()), start_time: AutoApi.State.property(DateTime.t()), thresholds: AutoApi.State.multiple_property(AutoApi.CustomType.eco_driving_threshold()), timestamp: AutoApi.State.property(DateTime.t()), total_fuel_consumption: AutoApi.State.property(AutoApi.UnitType.volume()), total_idle_fuel_consumption: AutoApi.State.property(AutoApi.UnitType.volume()), type: AutoApi.State.property(:single | :multi | :eco), vehicle_signature: AutoApi.State.property(binary()), vin: AutoApi.State.property(String.t()) }
Specs
timestamp() :: DateTime.t()
Specs
type() :: :single | :multi | :eco
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 = <<1, 0, 4, 1, 0, 1, 0>> iex> AutoApi.TripsState.from_bin(bin) %AutoApi.TripsState{type: %AutoApi.Property{data: :single}}
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.TripsState{type: %AutoApi.Property{data: :multi}} iex> AutoApi.TripsState.to_bin(state) <<1, 0, 4, 1, 0, 1, 1>>