BlueHeron.ATT.Client (blue_heron v0.4.0) View Source
Linked connection to a BLE device
Events
Recieved when a connection is established with the device.
This value should be treated as opaque. It should be used as a "handle" to the
BLE device. See write/3
for more info.
{BlueHeron.ATT.Client, pid, %BlueHeron.HCI.Event.LEMeta.ConnectionComplete{}}
Recieved when a connection is established with the device. Should invalidate a previous connection established.
{BlueHeron.ATT.Client, pid, %BlueHeron.HCI.Event.DisconnectComplete{}}
Link to this section Summary
Functions
Attempt to create a connection with a device Args should be a keyword list of fields that get passed to BlueHeron.HCI.Command.LEController.CreateConnection
See the Events portion of the moduledoc to see events that will be delivered to the calling processes mailbox
Write a value to a handle on a BLE device
Link to this section Types
Specs
client() :: GenServer.server()
Specs
handle() :: %BlueHeron.ATT.ReadByGroupTypeResponse.AttributeData{ end_group_handle: term(), handle: term(), uuid: term() } | %BlueHeron.ATT.ReadByTypeResponse.AttributeData{ characteristic_properties: term(), characteristic_value_handle: term(), handle: term(), uuid: term(), value: term() } | 0..4095
Link to this section Functions
Specs
Attempt to create a connection with a device Args should be a keyword list of fields that get passed to BlueHeron.HCI.Command.LEController.CreateConnection
iex> ATT.Client.create_connection(pid, peer_address: 0xabcdefg) :ok
Specs
start_link(BlueHeron.Context.t(), GenServer.options()) :: GenServer.on_start()
See the Events portion of the moduledoc to see events that will be delivered to the calling processes mailbox
Specs
Write a value to a handle on a BLE device
iex> ATT.Client.write(pid, %ATT.ReadByTypeResponse.AttributeData{handle: 0x15}, <<1, 2, 3, 4>>) :ok
iex> ATT.Client.write(pid, %ATT.ReadByGroupTypeRequest.AttributeData{handle: <<uuid::binary-128>>}, <<1, 2, 3, 4>>) :ok
iex> ATT.Client.write(pid, 0x15, <<1, 2, 3, 4>>) :ok