ArduinoBLE icon indicating copy to clipboard operation
ArduinoBLE copied to clipboard

Implement functions to retrieve multiple connected devices

Open polldo opened this issue 5 years ago • 2 comments

These functions can be used to loop the connected devices, centrals or peripherals, through an index that can go from 0 to the maximum number of connected devices allowed. Example:

for (int periphIdx = 0; periphIdx < BLE.peripheralCount(); periphIdx++) {
    BLEDevice peripheral = BLE.peripheral(periphIdx);
    if (peripheral) {
    BLECharacteristic batteryLevelChar = peripheral.characteristic("2A19");
        if (!batteryLevelChar) {
            Serial.println("Peripheral does not have battery level characteristic!");
            peripheral.disconnect();
        }
    }
}

polldo avatar Aug 11 '20 15:08 polldo

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 09 '21 14:04 CLAassistant

I need this functionality for my project. Has this library lost support?

phyxl avatar Jul 28 '22 21:07 phyxl