14#ifndef COMPONENTS_NIMBLE_SCAN_H_
15#define COMPONENTS_NIMBLE_SCAN_H_
18#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
20#include "NimBLEAdvertisedDevice.h"
21#include "NimBLEUtils.h"
23#if defined(CONFIG_NIMBLE_CPP_IDF)
24#include "host/ble_gap.h"
26#include "nimble/nimble/host/include/host/ble_gap.h"
49 std::vector<NimBLEAdvertisedDevice*>::iterator
begin();
50 std::vector<NimBLEAdvertisedDevice*>::iterator
end();
55 std::vector<NimBLEAdvertisedDevice*> m_advertisedDevicesVector;
88 static int handleGapEvent(ble_gap_event* event,
void* arg);
94 ble_gap_disc_params m_scan_params;
98 ble_task_data_t *m_pTaskData;
A BLE device address.
Definition: NimBLEAddress.h:39
A callback handler for callbacks associated device scanning.
Definition: NimBLEAdvertisedDevice.h:189
A representation of a BLE advertised device found by a scan.
Definition: NimBLEAdvertisedDevice.h:42
A model of a BLE Device from which all the BLE roles are created.
Definition: NimBLEDevice.h:96
Perform and manage BLE scans.
Definition: NimBLEScan.h:63
bool start(uint32_t duration, void(*scanCompleteCB)(NimBLEScanResults), bool is_continue=false)
Start scanning.
Definition: NimBLEScan.cpp:310
NimBLEScanResults getResults()
Get the results of the scan.
Definition: NimBLEScan.cpp:503
void setInterval(uint16_t intervalMSecs)
Set the interval to scan.
Definition: NimBLEScan.cpp:280
void setFilterPolicy(uint8_t filter)
Sets the scan filter policy.
Definition: NimBLEScan.cpp:249
void erase(const NimBLEAddress &address)
Delete peer device from the scan results vector.
Definition: NimBLEScan.cpp:466
bool stop()
Stop an in progress scan.
Definition: NimBLEScan.cpp:425
void clearDuplicateCache()
Clears the duplicate scan filter cache.
Definition: NimBLEScan.cpp:454
void setLimitedOnly(bool enabled)
Set whether or not the BLE controller only report scan results from devices advertising in limited di...
Definition: NimBLEScan.cpp:226
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:204
void setMaxResults(uint8_t maxResults)
Sets the max number of results to store.
Definition: NimBLEScan.cpp:259
void setAdvertisedDeviceCallbacks(NimBLEAdvertisedDeviceCallbacks *pAdvertisedDeviceCallbacks, bool wantDuplicates=false)
Set the call backs to be invoked.
Definition: NimBLEScan.cpp:269
bool isScanning()
Get the status of the scanner.
Definition: NimBLEScan.cpp:298
void setWindow(uint16_t windowMSecs)
Set the window to actively scan.
Definition: NimBLEScan.cpp:289
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:216
void clearResults()
Clear the results of the scan.
Definition: NimBLEScan.cpp:511
A class that contains and operates on the results of a BLE scan.
Definition: NimBLEScan.h:44
void dump()
Dump the scan results to the log.
Definition: NimBLEScan.cpp:523
std::vector< NimBLEAdvertisedDevice * >::iterator end()
Get iterator to the end of the vector of advertised device pointers.
Definition: NimBLEScan.cpp:564
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:546
std::vector< NimBLEAdvertisedDevice * >::iterator begin()
Get iterator to the beginning of the vector of advertised device pointers.
Definition: NimBLEScan.cpp:555
int getCount()
Get the count of devices found in the last scan.
Definition: NimBLEScan.cpp:535