1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-14 22:05:54 +00:00

Add stop action for ble scanning (#3799)

This commit is contained in:
Jesse Hills
2022-09-14 14:57:45 +12:00
committed by GitHub
parent 49465223a4
commit b3cca5dcb6
4 changed files with 51 additions and 13 deletions

View File

@@ -156,6 +156,13 @@ void ESP32BLETracker::start_scan() {
}
}
void ESP32BLETracker::stop_scan() {
ESP_LOGD(TAG, "Stopping scan.");
this->scan_continuous_ = false;
esp_ble_gap_stop_scanning();
this->cancel_timeout("scan");
}
bool ESP32BLETracker::ble_setup() {
// Initialize non-volatile storage for the bluetooth controller
esp_err_t err = nvs_flash_init();