auto_api v0.1.0 AutoApi.HonkHornFlashLightsState View Source
Keeps HonkHornFlashLights state
Link to this section Summary
Functions
HonkHornFlashLights state
Callback implementation for AutoApi.State.base/0
Build state based on binary value
Parse state to bin
Link to this section Types
flashers() :: :inactive | :emergency_flasher_active | :left_flasher_active | :right_flasher_active
Link to this section Functions
HonkHornFlashLights state
Callback implementation for AutoApi.State.base/0
.
from_bin(binary()) :: AutoApi.HonkHornFlashLightsState.t()
Build state based on binary value
iex> AutoApi.HonkHornFlashLightsState.from_bin(<<0x01, 1::integer-16, 0x00>>) %AutoApi.HonkHornFlashLightsState{flashers: :inactive}
iex> AutoApi.HonkHornFlashLightsState.from_bin(<<0x01, 1::integer-16, 0x01>>) %AutoApi.HonkHornFlashLightsState{flashers: :emergency_flasher_active}
iex> AutoApi.HonkHornFlashLightsState.from_bin(<<0x01, 1::integer-16, 0x03>>) %AutoApi.HonkHornFlashLightsState{flashers: :right_flasher_active}
to_bin(AutoApi.HonkHornFlashLightsState.t()) :: binary()
Parse state to bin
iex> AutoApi.HonkHornFlashLightsState.to_bin(%AutoApi.HonkHornFlashLightsState{flashers: :right_flasher_active}) <<1, 0, 1, 3>>
iex> AutoApi.HonkHornFlashLightsState.to_bin(%AutoApi.HonkHornFlashLightsState{flashers: :left_flasher_active}) <<1, 0, 1, 2>>