summaryrefslogtreecommitdiff
path: root/src/BLEScan.h
diff options
context:
space:
mode:
authorkolban <kolban1@kolban.com>2017-10-13 10:52:17 -0500
committerkolban <kolban1@kolban.com>2017-10-13 10:52:17 -0500
commit34902f4e7fc6926a005a5ccfd4e530d6a6321613 (patch)
tree512593068ed656012ee31fced9526bff80ecad55 /src/BLEScan.h
parentMerge pull request #5 from sebastiankliem/master (diff)
downloadthermostat-34902f4e7fc6926a005a5ccfd4e530d6a6321613.tar.gz
thermostat-34902f4e7fc6926a005a5ccfd4e530d6a6321613.tar.bz2
thermostat-34902f4e7fc6926a005a5ccfd4e530d6a6321613.zip
Sync update for 0.4.3 take 2
Diffstat (limited to 'src/BLEScan.h')
-rw-r--r--src/BLEScan.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/BLEScan.h b/src/BLEScan.h
index f9575ea..bc7f431 100644
--- a/src/BLEScan.h
+++ b/src/BLEScan.h
@@ -21,10 +21,19 @@ class BLEAdvertisedDeviceCallbacks;
class BLEClient;
class BLEScan;
+
+/**
+ * @brief The result of having performed a scan.
+ * When a scan completes, we have a set of found devices. Each device is described
+ * by a BLEAdvertisedDevice object. The number of items in the set is given by
+ * getCount(). We can retrieve a device by calling getDevice() passing in the
+ * index (starting at 0) of the desired device.
+ */
class BLEScanResults {
public:
- int getCount();
+ int getCount();
BLEAdvertisedDevice getDevice(uint32_t i);
+
private:
friend BLEScan;
std::vector<BLEAdvertisedDevice> m_vectorAdvertisedDevices;
@@ -39,7 +48,6 @@ class BLEScan {
public:
BLEScan();
- //virtual void onResults();
void setActiveScan(bool active);
void setAdvertisedDeviceCallbacks(BLEAdvertisedDeviceCallbacks* pAdvertisedDeviceCallbacks);
void setInterval(uint16_t intervalMSecs);
@@ -58,9 +66,8 @@ private:
esp_ble_scan_params_t m_scan_params;
BLEAdvertisedDeviceCallbacks* m_pAdvertisedDeviceCallbacks;
bool m_stopped;
- FreeRTOS::Semaphore m_semaphoreScanEnd = FreeRTOS::Semaphore("ScanEnd");
- //std::vector<BLEAdvertisedDevice*> m_vectorAvdertisedDevices;
- BLEScanResults m_scanResults;
+ FreeRTOS::Semaphore m_semaphoreScanEnd = FreeRTOS::Semaphore("ScanEnd");
+ BLEScanResults m_scanResults;
}; // BLEScan
#endif /* CONFIG_BT_ENABLED */