getAvailableDevices abstract method

Future<List<FluetoothDevice>> getAvailableDevices()

Since both Android and iOS have different flow of getting BT devices, these separated sections will describe briefly of what happens when using getAvailableDevices on each platforms.

Android

The simplest flow out of the two platforms. This simply performs:

  • calls BluetoothAdapter.getBondedDevices,
  • converts the result into a Map,
  • then converted into a list of FluetoothDevices.

iOS

A bit more flow on this one. This performs:

  • calls CBCentralManager.scanForPeripherals,
  • stores every discovered peripherals into an array,
  • calls CBCentralManager.stopScan after 1 second of scanning,
  • converts the result into a Map,
  • then converted into a list of FluetoothDevices

Implementation

Future<List<FluetoothDevice>> getAvailableDevices();