You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am planing to implement functions to register custom events handlers, one for each type(GAP, GATTS and GATTC). Usage will be similar to register notify callback. Add/register custom handler:
static void my_gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param) {
ESP_LOGW(LOG_TAG, "custom gap event handler, GAP event: %d", (uint8_t)event);
}
Function in action (logs):
W (608) SampleServer: custom gap event handler, GAP event: 0 // <-- ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
W (608) SampleServer: custom gap event handler, GAP event: 1 // <-- ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT
W (608) SampleServer: custom gap event handler, GAP event: 6 // <-- ESP_GAP_BLE_ADV_START_COMPLETE_EVT
W (9198) SampleServer: custom gap event handler, GAP event: 20 // <-- ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT
W (9318) SampleServer: custom gap event handler, GAP event: 20
W (9488) SampleServer: custom gap event handler, GAP event: 20
W (15848) SampleServer: custom gap event handler, GAP event: 10 // <-- ESP_GAP_BLE_SEC_REQ_EVT
W (16008) SampleServer: custom gap event handler, GAP event: 20
W (16038) BT_SMP: FOR LE SC LTK IS USED INSTEAD OF STK
W (16068) SampleServer: custom gap event handler, GAP event: 9 // <-- ESP_GAP_BLE_KEY_EVT
W (16068) SampleServer: custom gap event handler, GAP event: 9
W (16068) SampleServer: custom gap event handler, GAP event: 9
W (16078) SampleServer: custom gap event handler, GAP event: 9
W (16098) SampleServer: custom gap event handler, GAP event: 9
W (16248) SampleServer: custom gap event handler, GAP event: 9
W (16258) SampleServer: custom gap event handler, GAP event: 8 // <-- ESP_GAP_BLE_AUTH_CMPL_EVT
W (16928) SampleServer: custom gap event handler, GAP event: 20
This will allow to make library more flexible without increasing complexity and size. We can for example catch congestion events and take proper actions when we know that notify/indication cant be send.
The text was updated successfully, but these errors were encountered:
Few more logs. Maybe its not much, but we would be allowed to override build in mechanism to achieve better performance or add something that is missing in this library. I will for sure use it to debug code.
W (573) SampleServer: custom gatts event handler, GAP event: 0
W (583) SampleServer: custom gatts event handler, GAP event: 7
W (603) SampleServer: custom gatts event handler, GAP event: 9
W (603) SampleServer: custom gatts event handler, GAP event: 10
W (613) SampleServer: custom gatts event handler, GAP event: 12
W (623) SampleServer: custom gap event handler, GAP event: 0
W (623) SampleServer: custom gap event handler, GAP event: 1
W (633) SampleServer: custom gap event handler, GAP event: 6
W (111763) SampleServer: custom gatts event handler, GAP event: 14
W (112403) SampleServer: custom gap event handler, GAP event: 20
W (112513) SampleServer: custom gap event handler, GAP event: 20
W (112713) SampleServer: custom gap event handler, GAP event: 20
W (119553) SampleServer: custom gatts event handler, GAP event: 1
W (119553) SampleServer: custom gatts event handler, GAP event: 21
W (145813) SampleServer: custom gatts event handler, GAP event: 2
W (145813) SampleServer: custom gatts event handler, GAP event: 21
W (145813) SampleServer: custom gatts event handler, GAP event: 5
Uh oh!
There was an error while loading. Please reload this page.
I am planing to implement functions to register custom events handlers, one for each type(GAP, GATTS and GATTC). Usage will be similar to register notify callback. Add/register custom handler:
BLEDevice::setCustomGapHandler(my_gap_event_handler);
and function to handle events:
Function in action (logs):
This will allow to make library more flexible without increasing complexity and size. We can for example catch congestion events and take proper actions when we know that notify/indication cant be send.
The text was updated successfully, but these errors were encountered: