ArduinoBLE - bleDevice.connected()

Query if a Bluetooth® Low Energy device is connected

Syntax

bleDevice.connected()

Parameters

None

Returns

  • true if the Bluetooth® Low Energy device is connected,
  • otherwise false.

Example


  // listen for Bluetooth® Low Energy centrals to connect:
  BLEDevice central = BLE.central();

    // while the central is still connected
    while (central.connected()) {

       // ...
    }