esp-nimble-cpp 2.0.2
|
A class that contains and operates on the results of a BLE scan. More...
#include <NimBLEScan.h>
Public Member Functions | |
void | dump () const |
Dump the scan results to the log. | |
int | getCount () const |
Get the count of devices found in the last scan. | |
const NimBLEAdvertisedDevice * | getDevice (uint32_t idx) const |
Return the specified device at the given index. The index should be between 0 and getCount()-1. | |
const NimBLEAdvertisedDevice * | getDevice (const NimBLEAddress &address) const |
Get a pointer to the specified device at the given address. If the address is not found a nullptr is returned. | |
std::vector< NimBLEAdvertisedDevice * >::const_iterator | begin () const |
Get iterator to the beginning of the vector of advertised device pointers. | |
std::vector< NimBLEAdvertisedDevice * >::const_iterator | end () const |
Get iterator to the end of the vector of advertised device pointers. | |
A class that contains and operates on the results of a BLE scan.
When a scan completes, we have a set of found devices. Each device is described by a NimBLEAdvertisedDevice object. The number of items in the set is given by getCount(). We can retrieve a device by calling getDevice() passing in the index (starting at 0) of the desired device.
std::vector< NimBLEAdvertisedDevice * >::const_iterator NimBLEScanResults::begin | ( | ) | const |
Get iterator to the beginning of the vector of advertised device pointers.
std::vector< NimBLEAdvertisedDevice * >::const_iterator NimBLEScanResults::end | ( | ) | const |
Get iterator to the end of the vector of advertised device pointers.
int NimBLEScanResults::getCount | ( | ) | const |
Get the count of devices found in the last scan.
const NimBLEAdvertisedDevice * NimBLEScanResults::getDevice | ( | const NimBLEAddress & | address | ) | const |
Get a pointer to the specified device at the given address. If the address is not found a nullptr is returned.
[in] | address | The address of the device. |
const NimBLEAdvertisedDevice * NimBLEScanResults::getDevice | ( | uint32_t | idx | ) | const |
Return the specified device at the given index. The index should be between 0 and getCount()-1.
[in] | idx | The index of the device. |