SDK
23.9.2
For IoT System Software Development
|
Perform and manage BLE scans. More...
#include <BLEScan.hpp>
Public Member Functions | |
void | setActiveScan (bool active) |
Should we perform an active or passive scan? The default is a passive scan. An active scan means that we will wish a scan response. More... | |
void | setAdvertisedDeviceCallbacks (BLEAdvertisedDeviceCallbacks *pAdvertisedDeviceCallbacks, bool wantDuplicates=false) |
Set the call backs to be invoked. More... | |
void | setInterval (uint16_t intervalMSecs) |
Set the interval to scan. More... | |
void | setWindow (uint16_t windowMSecs) |
Set the window to actively scan. More... | |
bool | start (uint32_t duration, void(*scanCompleteCB)(BLEScanResults), bool is_continue=false, uint8_t maxNumDevices=0) |
Start scanning. More... | |
BLEScanResults | start (uint32_t duration, bool is_continue=false, uint8_t maxNumDevices=0) |
Start scanning and block until scanning has been completed. More... | |
void | stop () |
Stop an in progress scan. More... | |
void | erase (BLEAddress address) |
BLEScanResults | getResults () |
Get scan results. | |
void | clearResults () |
Perform and manage BLE scans.
Scanning is associated with a BLE client that is attempting to locate BLE servers.
void BLEScan::setActiveScan | ( | bool | active | ) |
Should we perform an active or passive scan? The default is a passive scan. An active scan means that we will wish a scan response.
[in] | active | If true, we perform an active scan otherwise a passive scan. |
void BLEScan::setAdvertisedDeviceCallbacks | ( | BLEAdvertisedDeviceCallbacks * | pAdvertisedDeviceCallbacks, |
bool | wantDuplicates = false |
||
) |
Set the call backs to be invoked.
[in] | pAdvertisedDeviceCallbacks | Call backs to be invoked. |
[in] | wantDuplicates | True if we wish to be called back with duplicates. Default is false. |
void BLEScan::setInterval | ( | uint16_t | intervalMSecs | ) |
Set the interval to scan.
[in] | The | interval in msecs. |
void BLEScan::setWindow | ( | uint16_t | windowMSecs | ) |
Set the window to actively scan.
[in] | windowMSecs | How long to actively scan. |
BLEScanResults BLEScan::start | ( | uint32_t | duration, |
bool | is_continue = false , |
||
uint8_t | maxNumDevices = 0 |
||
) |
Start scanning and block until scanning has been completed.
[in] | duration | The duration in seconds for which to scan. |
[in] | is_continue | are we continue scan (true) or we want to clear stored devices (false) |
[in] | maxNumDevices | The maximum device number of scan result. If the number of scanned devices reaches maxNumDevices , the scan is stopped and scanCompleteCB is called directly. If 0 (default), there is no limit. |
bool BLEScan::start | ( | uint32_t | duration, |
void(*)(BLEScanResults) | scanCompleteCB, | ||
bool | is_continue = false , |
||
uint8_t | maxNumDevices = 0 |
||
) |
Start scanning.
[in] | duration | The duration in seconds for which to scan. |
[in] | scanCompleteCB | A function to be called when scanning has completed. |
[in] | is_continue | are we continue scan (true) or we want to clear stored devices (false) |
[in] | maxNumDevices | The maximum device number of scan result. If the number of scanned devices reaches maxNumDevices , the scan is stopped and scanCompleteCB is called directly. If 0 (default), there is no limit. |
void BLEScan::stop | ( | ) |
Stop an in progress scan.