McuMgrBleTransport

open class McuMgrBleTransport : BleManager, McuMgrTransport

The McuMgrBleTransport is an implementation for the BLE transport scheme. This class extends BleManager, which handles the BLE state machine and owns the BluetoothGatt object that executes BLE actions.

Starting from version 1.1 it is possible to extend the functionality to support additional services. For that extend the following methods:

Constructors

Link copied to clipboard
constructor(@NonNull context: Context, @NonNull device: BluetoothDevice)
Construct a McuMgrBleTransport object.
constructor(@NonNull context: Context, @NonNull device: BluetoothDevice, @NonNull handler: Handler)
Construct a McuMgrBleTransport object with a handler to run the BleManager and asynchronous callbacks.
constructor(@NonNull context: Context, @NonNull device: BluetoothDevice, @NonNull handler: Handler, @NonNull uuidConfig: UuidConfig)
Construct a McuMgrBleTransport object with a handler to run the BleManager and asynchronous callbacks.

Properties

Link copied to clipboard
open var bondingObserver: BondingObserver
Link copied to clipboard
open var connectionObserver: ConnectionObserver
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The SMP service UUID.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun close()
Link copied to clipboard
fun connect(device: BluetoothDevice): ConnectRequest
Link copied to clipboard
fun disconnect(): DisconnectRequest
Link copied to clipboard
Link copied to clipboard
Returns the device set in the constructor.
Link copied to clipboard
Link copied to clipboard
Returns the maximum length of a SMP packet that can be transmitted over by the transport.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun log(priority: Int, @NonNull message: String)
Link copied to clipboard
open fun release()
Link copied to clipboard
Link copied to clipboard
open fun requestConnPriority(priority: Int)
Requests the given connection priority.
Link copied to clipboard
open fun <T : McuMgrResponse?> send(@NonNull payload: Array<Byte>, timeout: Long, @NonNull responseType: Class<T>): T
open fun <T : McuMgrResponse?> send(@NonNull payload: Array<Byte>, timeout: Long, @NonNull responseType: Class<T>, @NonNull callback: McuMgrCallback<T>)
Link copied to clipboard
Sets the maximum packet length for the transport.
Link copied to clipboard
open fun setGattCallbacks(callbacks: BleManagerCallbacks)
Link copied to clipboard
open fun setInitialMtu(@IntRange(from = 23, to = 517) mtu: Int)
Sets the initial MTU size to be requested upon connection.
Link copied to clipboard
open fun setLoggingEnabled(enabled: Boolean)
Allows to enable low-level logging.
Link copied to clipboard
fun setMaxPacketLength(maxLength: Int)
In order to send packets longer than MTU size, this library supports automatic segmentation of packets into at-most-MTU size chunks.
Link copied to clipboard
fun useServer(server: BleServerManager)