auto_api v0.1.0 AutoApi.HonkHornFlashLightsState View Source

Keeps HonkHornFlashLights state

Link to this section Summary

Link to this section Types

Link to this type flashers() View Source
flashers() ::
  :inactive |
  :emergency_flasher_active |
  :left_flasher_active |
  :right_flasher_active
Link to this type t() View Source
t() :: %AutoApi.HonkHornFlashLightsState{flashers: flashers()}

Link to this section Functions

Link to this function %AutoApi.HonkHornFlashLightsState{} View Source (struct)

HonkHornFlashLights state

Callback implementation for AutoApi.State.base/0.

Link to this function do_parse_bin_properties(id, data, state) View Source

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}

Link to this function parse_bin_properties(d, state) View Source
Link to this function parse_bin_property(int, arg) View Source
Link to this function parse_state_properties(state) View Source
Link to this function parse_state_property(atom, value) View Source

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>>