14 #ifndef COMPONENTS_NIMBLE_SCAN_H_
15 #define COMPONENTS_NIMBLE_SCAN_H_
16 #include "sdkconfig.h"
17 #if defined(CONFIG_BT_ENABLED)
20 #if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
22 #include "NimBLEAdvertisedDevice.h"
23 #include "NimBLEUtils.h"
25 #include "host/ble_gap.h"
47 std::vector<NimBLEAdvertisedDevice*>::iterator
begin();
48 std::vector<NimBLEAdvertisedDevice*>::iterator
end();
53 std::vector<NimBLEAdvertisedDevice*> m_advertisedDevicesVector;
86 static int handleGapEvent(ble_gap_event* event,
void* arg);
92 ble_gap_disc_params m_scan_params;
96 ble_task_data_t *m_pTaskData;
A BLE device address.
Definition: NimBLEAddress.h:34
A callback handler for callbacks associated device scanning.
Definition: NimBLEAdvertisedDevice.h:162
A representation of a BLE advertised device found by a scan.
Definition: NimBLEAdvertisedDevice.h:40
A model of a BLE Device from which all the BLE roles are created.
Definition: NimBLEDevice.h:91
Perform and manage BLE scans.
Definition: NimBLEScan.h:61
bool start(uint32_t duration, void(*scanCompleteCB)(NimBLEScanResults), bool is_continue=false)
Start scanning.
Definition: NimBLEScan.cpp:286
NimBLEScanResults getResults()
Get the results of the scan.
Definition: NimBLEScan.cpp:455
void setInterval(uint16_t intervalMSecs)
Set the interval to scan.
Definition: NimBLEScan.cpp:256
void setFilterPolicy(uint8_t filter)
Sets the scan filter policy.
Definition: NimBLEScan.cpp:225
void erase(const NimBLEAddress &address)
Delete peer device from the scan results vector.
Definition: NimBLEScan.cpp:418
bool stop()
Stop an in progress scan.
Definition: NimBLEScan.cpp:377
void clearDuplicateCache()
Clears the duplicate scan filter cache.
Definition: NimBLEScan.cpp:406
void setLimitedOnly(bool enabled)
Set whether or not the BLE controller only report scan results from devices advertising in limited di...
Definition: NimBLEScan.cpp:202
void setActiveScan(bool active)
Should we perform an active or passive scan? The default is a passive scan. An active scan means that...
Definition: NimBLEScan.cpp:180
void setMaxResults(uint8_t maxResults)
Sets the max number of results to store.
Definition: NimBLEScan.cpp:235
void setAdvertisedDeviceCallbacks(NimBLEAdvertisedDeviceCallbacks *pAdvertisedDeviceCallbacks, bool wantDuplicates=false)
Set the call backs to be invoked.
Definition: NimBLEScan.cpp:245
bool isScanning()
Get the status of the scanner.
Definition: NimBLEScan.cpp:274
void setWindow(uint16_t windowMSecs)
Set the window to actively scan.
Definition: NimBLEScan.cpp:265
void setDuplicateFilter(bool enabled)
Set whether or not the BLE controller should only report results from devices it has not already seen...
Definition: NimBLEScan.cpp:192
void clearResults()
Clear the results of the scan.
Definition: NimBLEScan.cpp:463
A class that contains and operates on the results of a BLE scan.
Definition: NimBLEScan.h:42
void dump()
Dump the scan results to the log.
Definition: NimBLEScan.cpp:475
std::vector< NimBLEAdvertisedDevice * >::iterator end()
Get iterator to the end of the vector of advertised device pointers.
Definition: NimBLEScan.cpp:516
NimBLEAdvertisedDevice getDevice(uint32_t i)
Return the specified device at the given index. The index should be between 0 and getCount()-1.
Definition: NimBLEScan.cpp:498
std::vector< NimBLEAdvertisedDevice * >::iterator begin()
Get iterator to the beginning of the vector of advertised device pointers.
Definition: NimBLEScan.cpp:507
int getCount()
Get the count of devices found in the last scan.
Definition: NimBLEScan.cpp:487