12 #include <esp_gap_ble_api.h> 13 #include <esp_gattc_api.h> 14 #include <freertos/FreeRTOS.h> 15 #include <freertos/semphr.h> 26 namespace esp32_ble_tracker {
33 if (element ==
nullptr)
35 if (xSemaphoreTake(
m_, 5L / portTICK_PERIOD_MS)) {
44 if (xSemaphoreTake(
m_, 5L / portTICK_PERIOD_MS)) {
63 BLEEvent(esp_gap_ble_cb_event_t e, esp_ble_gap_cb_param_t *p) {
64 this->event_.gap.gap_event = e;
65 memcpy(&this->event_.gap.gap_param, p,
sizeof(esp_ble_gap_cb_param_t));
69 BLEEvent(esp_gattc_cb_event_t e, esp_gatt_if_t i, esp_ble_gattc_cb_param_t *p) {
70 this->event_.gattc.gattc_event = e;
71 this->event_.gattc.gattc_if = i;
72 memcpy(&this->event_.gattc.gattc_param, p,
sizeof(esp_ble_gattc_cb_param_t));
75 case ESP_GATTC_NOTIFY_EVT:
76 this->data.assign(p->notify.value, p->notify.value + p->notify.value_len);
77 this->event_.gattc.gattc_param.notify.value = this->data.data();
79 case ESP_GATTC_READ_CHAR_EVT:
80 case ESP_GATTC_READ_DESCR_EVT:
81 this->data.assign(p->read.value, p->read.value + p->read.value_len);
82 this->event_.gattc.gattc_param.read.value = this->data.data();
102 std::vector<uint8_t> data{};
esp_gap_ble_cb_event_t gap_event
esp_ble_gap_cb_param_t gap_param
esp_gattc_cb_event_t gattc_event
esp_ble_gattc_cb_param_t gattc_param
BLEEvent(esp_gap_ble_cb_event_t e, esp_ble_gap_cb_param_t *p)
BLEEvent(esp_gattc_cb_event_t e, esp_gatt_if_t i, esp_ble_gattc_cb_param_t *p)