Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement functions to retrieve multiple connected devices #105

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

polldo
Copy link
Contributor

@polldo polldo commented Aug 11, 2020

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();
        }
    }
}

@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

CLA assistant check
All committers have signed the CLA.

alranel added a commit to rduino-libraries/rduinoBLE that referenced this pull request May 7, 2022
@phyxl
Copy link

phyxl commented Jul 28, 2022

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

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants