disambiguate

Disambiguate a list of connection methods.

Given a list of connection methods, produce a list where each method represents exactly one connectable endpoint. For example, for BLE if both central client mode and peripheral server mode is set, replaces this with two connection methods so it's clear which one is which.

The MdocConnectionMethodBle.peripheralServerModePsm and MdocConnectionMethodBle.peripheralServerModeMacAddress properties are duplicated in each of the resulting MdocConnectionMethodBle instances. The PSM and MAC address is only conveyed on one of the instances, see role argument for which one.

This is the reverse of .combine.

Return

the given list of connection methods where each instance is unambiguously refers to one and only one connectable endpoint.

Parameters

connectionMethods

a list of connection methods.

role

If MdocRole.MDOC the PSM and MAC address will appear only in the resulting MdocConnectionMethodBle objects for central client mode, otherwise they only appear in the object for peripheral server mode.