1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 13:22:19 +01:00

Fixes for BLE/improv (#1878)

This commit is contained in:
Jesse Hills
2021-06-09 08:45:51 +12:00
committed by GitHub
parent 7c678659d4
commit 0426be9280
20 changed files with 95 additions and 65 deletions

View File

@@ -119,24 +119,24 @@ bool ESP32BLE::ble_setup_() {
return true;
}
void ESP32BLE::loop() {
BLEEvent *ble_event = this->ble_events_.pop();
while (ble_event != nullptr) {
switch (ble_event->type_) {
case ble_event->GATTS:
this->real_gatts_event_handler_(ble_event->event_.gatts.gatts_event, ble_event->event_.gatts.gatts_if,
&ble_event->event_.gatts.gatts_param);
break;
case ble_event->GAP:
this->real_gap_event_handler_(ble_event->event_.gap.gap_event, &ble_event->event_.gap.gap_param);
break;
default:
break;
}
delete ble_event;
ble_event = this->ble_events_.pop();
}
}
// void ESP32BLE::loop() {
// BLEEvent *ble_event = this->ble_events_.pop();
// while (ble_event != nullptr) {
// switch (ble_event->type_) {
// case ble_event->GATTS:
// this->real_gatts_event_handler_(ble_event->event_.gatts.gatts_event, ble_event->event_.gatts.gatts_if,
// &ble_event->event_.gatts.gatts_param);
// break;
// case ble_event->GAP:
// this->real_gap_event_handler_(ble_event->event_.gap.gap_event, &ble_event->event_.gap.gap_param);
// break;
// default:
// break;
// }
// delete ble_event;
// ble_event = this->ble_events_.pop();
// }
// }
void ESP32BLE::gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) {
global_ble->real_gap_event_handler_(event, param);