Reference   Language | Libraries | Comparison | Changes

ArduinoBLE : BLEDevice class

connected()

Description

Query if a BLE device is connected

Syntax

bleDevice.connected()

Parameters

None

Returns

true if the BLE device is connected, otherwise false.

Example


  // listen for BLE centrals to connect:
  BLEDevice central = BLE.central();

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

       // ...
    }

See Also



Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.