IamUtil.getAvailablePairingModesAsync() Overload 1

DESCRIPTION

Retrieve a list of the available pairing modes on the device asynchronously.

The specified AsyncIamResultReceiver closure is invoked with IamError.OK and resulting data upon successful completion or with an error if an error occurs. See the getAvailablePairingModes() function for details about possible error codes.

DECLARATION

static public func getAvailablePairingModesAsync(connection: Connection,
                                                     closure: @escaping AsyncIamResultReceiverWithData<[PairingMode]>)

PARAMETERS

connection:
An established connection to the device
closure:
Invoked when the list of available pairing modes is successfully retrieved or retrieval fails.

Overload 2

DESCRIPTION

Retrieve a list of the available pairing modes on the device asynchronously.

Uses Swift concurrency and is therefore only available on iOS 13 and above.

DECLARATION

static public func getAvailablePairingModesAsync(connection: Connection) async throws -> [PairingMode]

PARAMETERS

connection:
An established connection to the device

THROWS ERRORS

BLOCKED_BY_DEVICE_CONFIGURATION:
if the device configuration does not allow retrieving this list (the IAM:GetPairing action is not set for the Unpaired role)
IAM_NOT_SUPPORTED:
if Nabto Edge IAM is not supported by the device

RETURNS

list of available pairing modes