Nol.A SDK Library  24.11.0
For IoT System Software Development
Public Member Functions | List of all members
BLEScan Class Reference

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

Detailed Description

Perform and manage BLE scans.

Scanning is associated with a BLE client that is attempting to locate BLE servers.

Member Function Documentation

◆ setActiveScan()

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.

Parameters
[in]activeIf true, we perform an active scan otherwise a passive scan.
Returns
N/A.

◆ setInterval()

void BLEScan::setInterval ( uint16_t  intervalMSecs)

Set the interval to scan.

Parameters
[in]Theinterval in msecs.

◆ setWindow()

void BLEScan::setWindow ( uint16_t  windowMSecs)

Set the window to actively scan.

Parameters
[in]windowMSecsHow long to actively scan.

◆ start() [1/2]

BLEScanResults BLEScan::start ( uint32_t  duration,
bool  is_continue = false,
uint8_t  maxNumDevices = 0 
)

Start scanning and block until scanning has been completed.

Parameters
[in]durationThe duration in seconds for which to scan.
[in]is_continueare we continue scan (true) or we want to clear stored devices (false)
[in]maxNumDevicesThe 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.
Returns
The BLEScanResults.

◆ start() [2/2]

bool BLEScan::start ( uint32_t  duration,
void(*)(BLEScanResults scanCompleteCB,
bool  is_continue = false,
uint8_t  maxNumDevices = 0 
)

Start scanning.

Parameters
[in]durationThe duration in seconds for which to scan.
[in]scanCompleteCBA function to be called when scanning has completed.
[in]is_continueare we continue scan (true) or we want to clear stored devices (false)
[in]maxNumDevicesThe 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.
Returns
True if scan started or false if there was an error.

◆ stop()

void BLEScan::stop ( )

Stop an in progress scan.

Returns
N/A.

The documentation for this class was generated from the following file: