McuMgrBleTransport
An implementation of McuMgrTransport for the BLE scheme, built on the Kotlin BLE Library.
The transport owns the connection: it connects the device on the first request, attaches SmpProfile to it, and disconnects on release.
An application that manages the same Peripheral for other purposes can keep doing so - the profiles of the Kotlin BLE Library are independent of each other, so it may attach its own alongside this one. It cannot, however, hand the SMP service to this transport: switching a device to the Firmware Loader makes it advertise under a different address, which the transport has to find and connect itself, so the connection has to be its own.
Example
val peripheral = centralManager.getPeripheralById(address)!!
val transport = McuMgrBleTransport(centralManager, peripheral, scope)
val manager = DefaultManager(transport)Parameters
The central manager used to connect to the device.
The peripheral to connect to and communicate with.
The coroutine scope the connection and the requests run in.
Constructors
Properties
The maximum length of an SMP packet the device can accept, or null when the transport is Disconnected.
The device this transport is talking to.
The current state of the transport.