getPeripheralsById

abstract fun getPeripheralsById(ids: List<ID>): List<P>

A list of peripherals that the central manager is able to match to the provided identifiers.

Peripherals are returned only when Bluetooth is powered on, that is when state is Manager.State.POWERED_ON. In any other state an empty list is returned, and no error is thrown. This is how retrievePeripherals(withIdentifiers:) of CBCentralManager works on iOS. Wait for the state to change before retrieving peripherals.

Return

List of peripherals. The list may have a smaller size than the input list, and is empty if Bluetooth is not powered on.

Parameters

ids

List of peripheral identifiers.

See also

Throws

If the central manager has been closed.

If any of the identifiers is not valid. This is checked regardless of the state.