View Source BlueHeron.HCI.Transport (blue_heron v0.5.1)

Handles sending and receiving HCI Packets

Summary

Functions

Buffer an ACL frame to be sent

Returns a specification to start this module under a supervisor.

Returns the value of a setup param or an error if the transport is not ready yet.

Send an HCI frame

Checks if setup is complete on the transport

Types

command_complete()

@type command_complete() :: %BlueHeron.HCI.Event.CommandComplete{
  code: term(),
  num_hci_command_packets: term(),
  opcode: term(),
  return_parameters: term()
}

command_status()

@type command_status() :: %BlueHeron.HCI.Event.CommandStatus{
  code: term(),
  num_hci_command_packets: term(),
  opcode: term(),
  status: term()
}

setup_param()

@type setup_param() ::
  :local_name
  | :acl_packet_length
  | :acl_packet_number
  | :syn_packet_length
  | :syn_packet_number
  | :supported_commands
  | :bd_addr
  | :hci_revision
  | :hci_version
  | :lmp_pal_subversion
  | :lmp_pal_version
  | :manufacturer_name
  | :white_list_size
  | :acl_data_packet_length
  | :total_num_acl_data_packets

Functions

buffer_acl(frame)

@spec buffer_acl(map()) :: :ok

Buffer an ACL frame to be sent

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_setup_param(key)

@spec get_setup_param(setup_param()) :: {:ok, term()} | {:error, :setup_incomplete}

Returns the value of a setup param or an error if the transport is not ready yet.

send_hci(frame)

@spec send_hci(map()) ::
  {:ok, command_complete() | command_status()}
  | {:error, :setup_incomplete | :timeout}

Send an HCI frame

setup_complete?()

@spec setup_complete?() :: boolean()

Checks if setup is complete on the transport