encodeNdefHandoverCarriers

fun encodeNdefHandoverCarriers(methods: List<MdocConnectionMethod>, handoverType: MdocNfcHandoverType, sharedAuxiliaryReferences: List<String> = emptyList(), hrHadChBleOptions: Boolean = false): List<HandoverCarrierRecords>

Encodes a list of single-mode MdocConnectionMethod entries into NFC Forum Connection Handover HandoverCarrierRecords bundles, coalescing all Ble entries into a single BLE OOB ("0") + optional ChBleOptions ("chble") carrier at the position of the first Ble entry.

Unsupported NFC handover methods (WifiAware, Http) are skipped with a warning.

Return

the encoded HandoverCarrierRecords bundles in carrier order.

Parameters

methods

the single-mode connection methods to encode.

handoverType
sharedAuxiliaryReferences

shared auxiliary data references (e.g. "mdoc" or "mdocreader") to attach to every carrier's "ac" record.

hrHadChBleOptions

when handoverType is MdocNfcHandoverType.NEGOTIATED_HS, whether the incoming HandoverRequest included a "chble" record (causing ChBleOptions to be echoed when a BLE mode is selected, per ISO/IEC 18013-5 Second Edition clause 11.1.3).

Throws

if methods violates handoverType rules or has conflicting parameters.