Callback

interface Callback

Asynchronous callbacks invoked by a BlePeripheralHal implementation.

Functions

Link copied to clipboard
abstract fun onAdvertisingStarted(error: Throwable?)

Invoked when BLE advertising has started.

Link copied to clipboard
abstract fun onCentralDisconnected()

Invoked when the connected central disconnects.

Link copied to clipboard
abstract fun onCharacteristicReadRequest(requestId: Int, uuid: UUID)

Invoked when a connected central requests to read characteristic uuid.

Link copied to clipboard
abstract fun onCharacteristicWriteRequest(uuid: UUID, value: ByteArray, maxWriteSizeForCentral: Int?)

Invoked when a connected central writes value to characteristic uuid.

Link copied to clipboard
abstract fun onError(error: Throwable)

Invoked when an unrecoverable asynchronous transport error occurs.

Link copied to clipboard

Invoked when a central connects to the published L2CAP channel.

Link copied to clipboard
abstract fun onL2capPublished(psm: Int?, error: Throwable?)

Invoked when an L2CAP server channel has been published with psm (or failed if error is non-null).

Link copied to clipboard
abstract fun onMtuChanged(mtu: Int)

Invoked when the connected central negotiates a GATT ATT mtu.

Link copied to clipboard
abstract fun onNotificationSent(uuid: UUID, error: Throwable?)

Invoked when a GATT notification for uuid has been sent (or failed if error is non-null).

Link copied to clipboard
abstract fun onPowerOn(error: Throwable?)

Invoked when Bluetooth peripheral power-on check completes (or fails if error is non-null).

Link copied to clipboard
abstract fun onServiceAdded(error: Throwable?)

Invoked when the GATT server service has been registered.