createTransports

open fun createTransports(connectionMethods: List<MdocConnectionMethod>, role: MdocRole, options: MdocTransportOptions = MdocTransportOptions()): List<MdocTransport>

Creates the MdocTransport instances needed to serve connectionMethods.

If connectionMethods is empty, this returns emptyList().

Implementations that support dual-mode BLE Peripheral operation coalesce co-hosted BLE Peripheral modes sharing the same non-null service UUID (i.e., MdocConnectionMethod.Ble.DirectL2capPeripheral and MdocConnectionMethod.Ble.GattPeripheral for MdocRole.MDOC, or MdocConnectionMethod.Ble.DirectL2capCentral and MdocConnectionMethod.Ble.GattCentral for MdocRole.MDOC_READER) onto a single MdocTransport, so the returned list may contain fewer elements than connectionMethods. The default implementation invokes createTransport for each element in connectionMethods.

Return

the created MdocTransport instances, or emptyList() if connectionMethods is empty.

Parameters

connectionMethods

the connection methods to create transports for.

role

the role of the MdocTransport instances.

options

options for the MdocTransport instances.

Throws

if any entry in connectionMethods is unsupported or invalid for role.