Ble

sealed class Ble : MdocConnectionMethod

Bluetooth Low Energy (BLE) connection methods according to ISO/IEC 18013-5 Second Edition clauses 11.1.1–11.1.3.

Subtype names follow the mdoc-perspective CDDL identifiers from BleOptions:

  • GattPeripheral (0: GattPeripheral): mdoc is BLE Peripheral / GATT server; mdoc reader is BLE Central / GATT client.

  • GattCentral (1: GattCentral): mdoc is BLE Central / GATT client; mdoc reader is BLE Peripheral / GATT server.

  • DirectL2capPeripheral (2: DirectL2capPeripheral): mdoc is BLE Peripheral / L2CAP server; mdoc reader is BLE Central / L2CAP client.

  • DirectL2capCentral (3: DirectL2capCentral): mdoc is BLE Central / L2CAP client; mdoc reader is BLE Peripheral / L2CAP server.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class DirectL2capCentral(val uuid: UUID? = null, val psm: Int? = null, val peripheralAddress: BlePeripheralAddress? = null) : MdocConnectionMethod.Ble

mdoc direct BLE L2CAP central mode (BleOptions key 3: DirectL2capCentral).

Link copied to clipboard
data class DirectL2capPeripheral(val uuid: UUID? = null, val psm: Int? = null, val peripheralAddress: BlePeripheralAddress? = null) : MdocConnectionMethod.Ble

mdoc direct BLE L2CAP peripheral mode (BleOptions key 2: DirectL2capPeripheral).

Link copied to clipboard
data class GattCentral(val uuid: UUID? = null, val peripheralAddress: BlePeripheralAddress? = null) : MdocConnectionMethod.Ble

mdoc GATT central client mode (BleOptions key 1: GattCentral).

Link copied to clipboard
data class GattPeripheral(val uuid: UUID? = null, val peripheralAddress: BlePeripheralAddress? = null) : MdocConnectionMethod.Ble

mdoc GATT peripheral server mode (BleOptions key 0: GattPeripheral).

Properties

Link copied to clipboard

The L2CAP PSM if this is a DirectL2capPeripheral or DirectL2capCentral with a known PSM, or null.

Link copied to clipboard

Whether this mode uses direct BLE L2CAP for data transfer (DirectL2capPeripheral or DirectL2capCentral).

Link copied to clipboard

Whether this mode uses GATT for data transfer (GattPeripheral or GattCentral).

Link copied to clipboard

Whether the mdoc acts as BLE Central (and the mdoc reader acts as BLE Peripheral) in this mode.

Link copied to clipboard

Whether the mdoc acts as BLE Peripheral (and the mdoc reader acts as BLE Central) in this mode.

Link copied to clipboard

The 7-byte BLE peripheral device address of whichever peer acts as BLE Peripheral in this mode, if known.

Link copied to clipboard
abstract val uuid: UUID?

The 128-bit BLE service UUID for this mode, if known.

Functions

Link copied to clipboard
fun toDeviceEngagement(engagementType: MdocEngagementType = MdocEngagementType.DEVICE_QR): ByteArray

Encodes this single connection method as DeviceRetrievalMethod CBOR.

Link copied to clipboard
abstract fun withUuid(uuid: UUID?): MdocConnectionMethod.Ble

Returns a copy of this Ble connection method with its uuid replaced by uuid.