BlueHeron.HCI.Transport behaviour (blue_heron v0.4.1) View Source

Handles sending and receiving HCI binaries via a physical link that implements the callbacks in this module

Link to this section Summary

Functions

Subscribe to HCI event messages

Send a command via the configured transport

Start a transport

Link to this section Types

Specs

config() :: map()

Specs

recv_fun() :: (binary() -> any())

Link to this section Callbacks

Specs

init_commands(config()) :: [binary()]
Link to this callback

send_acl(server, binary)

View Source

Specs

send_acl(GenServer.server(), binary()) :: boolean()
Link to this callback

send_command(server, binary)

View Source

Specs

send_command(GenServer.server(), binary()) :: boolean()
Link to this callback

start_link(config, recv_fun)

View Source

Specs

start_link(config(), recv_fun()) :: GenServer.on_start()

Link to this section Functions

Link to this function

add_event_handler(transport)

View Source

Specs

add_event_handler(GenServer.server()) :: :ok

Subscribe to HCI event messages

Specs

command(GenServer.server(), map() | binary()) ::
  {:ok, map()} | {:error, binary()}

Send a command via the configured transport

Specs

start_link(config()) :: :gen_statem.start_ret()

Start a transport