1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00

Improv - BLE WiFi provisioning (#1807)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Jesse Hills
2021-06-08 11:56:21 +12:00
committed by GitHub
parent 33625e2dd3
commit a70a205ace
40 changed files with 2422 additions and 42 deletions

View File

@@ -0,0 +1,37 @@
#pragma once
#include <vector>
#ifdef ARDUINO_ARCH_ESP32
#include <esp_gap_ble_api.h>
#include <esp_gatts_api.h>
namespace esphome {
namespace esp32_ble {
class ESPBTUUID;
class BLEAdvertising {
public:
BLEAdvertising();
void add_service_uuid(ESPBTUUID uuid);
void set_scan_response(bool scan_response) { this->scan_response_ = scan_response; }
void set_min_preferred_interval(uint16_t interval) { this->advertising_data_.min_interval = interval; }
void start();
void stop();
protected:
bool scan_response_;
esp_ble_adv_data_t advertising_data_;
esp_ble_adv_data_t scan_response_data_;
esp_ble_adv_params_t advertising_params_;
std::vector<ESPBTUUID> advertising_uuids_;
};
} // namespace esp32_ble
} // namespace esphome
#endif