CHIPoBLE transport GenServer.
Manages the BLE connection lifecycle for Matter commissioning. Delegates
fragmentation/reassembly to MatterEx.Transport.BTP. Communicates with
upper layers via messages:
{:ble_connected, transport_pid}
{:ble_data, transport_pid, complete_message}
{:ble_disconnected, transport_pid}Hardware access is delegated to a configured adapter module implementing
MatterEx.Transport.BLE.Adapter.
Example
{:ok, ble} = MatterEx.Transport.BLE.start_link(
discriminator: 3840,
vendor_id: 0xFFF1,
product_id: 0x8001,
adapter: SomeAdapter
)
# Adapter sends events, GenServer relays to owner
# Send data back (BTP-fragmented automatically):
MatterEx.Transport.BLE.send(ble, response_data)
Summary
Functions
Returns a specification to start this module under a supervisor.
Send data over the BLE connection. Data is BTP-fragmented automatically.
Start the BLE transport.
Stop BLE advertising.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec send(GenServer.server(), binary()) :: :ok | {:error, atom()}
Send data over the BLE connection. Data is BTP-fragmented automatically.
@spec start_link(keyword()) :: GenServer.on_start()
Start the BLE transport.
Required options:
:discriminator— 12-bit commissioning discriminator (0..4095):vendor_id— 16-bit vendor ID:product_id— 16-bit product ID:adapter— module implementingMatterEx.Transport.BLE.Adapter
Optional:
:owner— pid to receive events (default: calling process):name— GenServer name
@spec stop_advertising(GenServer.server()) :: :ok
Stop BLE advertising.