esp32_ble_tracker continuous and one shot scanning modes (#3649)

Co-authored-by: Jonathan Valdez <@jonofmac>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Jonathan V
2022-09-13 18:10:12 -05:00
committed by GitHub
parent 15f0e54cbf
commit 49465223a4
4 changed files with 112 additions and 3 deletions
@@ -76,6 +76,14 @@ class BLEManufacturerDataAdvertiseTrigger : public Trigger<const adv_data_t &>,
ESPBTUUID uuid_;
};
class BLEEndOfScanTrigger : public Trigger<>, public ESPBTDeviceListener {
public:
explicit BLEEndOfScanTrigger(ESP32BLETracker *parent) { parent->register_listener(this); }
bool parse_device(const ESPBTDevice &device) override { return false; }
void on_scan_end() override { this->trigger(); }
};
} // namespace esp32_ble_tracker
} // namespace esphome