summaryrefslogtreecommitdiff
path: root/sensor/patchedBLE/src/BLEScan.h
diff options
context:
space:
mode:
Diffstat (limited to 'sensor/patchedBLE/src/BLEScan.h')
-rw-r--r--sensor/patchedBLE/src/BLEScan.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/sensor/patchedBLE/src/BLEScan.h b/sensor/patchedBLE/src/BLEScan.h
index 76c7c7c..2f71a72 100644
--- a/sensor/patchedBLE/src/BLEScan.h
+++ b/sensor/patchedBLE/src/BLEScan.h
@@ -11,7 +11,8 @@
#if defined(CONFIG_BT_ENABLED)
#include <esp_gap_ble_api.h>
-#include <vector>
+// #include <vector>
+#include <string>
#include "BLEAdvertisedDevice.h"
#include "BLEClient.h"
#include "FreeRTOS.h"
@@ -37,7 +38,7 @@ public:
private:
friend BLEScan;
- std::vector<BLEAdvertisedDevice> m_vectorAdvertisedDevices;
+ std::map<std::string, BLEAdvertisedDevice*> m_vectorAdvertisedDevices;
};
/**
@@ -53,9 +54,12 @@ public:
bool wantDuplicates = false);
void setInterval(uint16_t intervalMSecs);
void setWindow(uint16_t windowMSecs);
- bool start(uint32_t duration, void (*scanCompleteCB)(BLEScanResults));
- BLEScanResults start(uint32_t duration);
+ bool start(uint32_t duration, void (*scanCompleteCB)(BLEScanResults), bool is_continue = false);
+ BLEScanResults start(uint32_t duration, bool is_continue = false);
void stop();
+ void erase(BLEAddress address);
+ BLEScanResults getResults();
+ void clearResults();
private:
BLEScan(); // One doesn't create a new instance instead one asks the BLEDevice for the singleton.
@@ -67,8 +71,8 @@ private:
esp_ble_scan_params_t m_scan_params;
- BLEAdvertisedDeviceCallbacks* m_pAdvertisedDeviceCallbacks;
- bool m_stopped;
+ BLEAdvertisedDeviceCallbacks* m_pAdvertisedDeviceCallbacks = nullptr;
+ bool m_stopped = true;
FreeRTOS::Semaphore m_semaphoreScanEnd = FreeRTOS::Semaphore("ScanEnd");
BLEScanResults m_scanResults;
bool m_wantDuplicates;