ArduinoBLE - available()

Query for a discovered BLE device that was found during scanning.

Syntax

BLE.available()

Parameters

Nothing

Returns

BLEDevice representing the discovered device.

Example


  // begin initialization
  if (!BLE.begin()) {
    Serial.println("starting BLE failed!");

    while (1);
  }

  Serial.println("BLE Central scan");

  // start scanning for peripheral
  BLE.scan();

  

  BLEDevice peripheral = BLE.available();

  if (peripheral) {
     // ...
  }