3#if CONFIG_BT_BLE_ENABLED
14 esp_ble_gatts_cb_param_t *param) {
18 if (event == ESP_GATTS_REG_EVT && param->reg.app_id ==
midi_get_app_id()) {
19 ESP_LOGI(
"MIDIBLE",
"Registering MIDI app");
20 if (param->reg.status != ESP_GATT_OK) {
21 ESP_LOGE(
"MIDIBLE",
"Register app failed, app_id %04x, status: %d",
22 param->reg.app_id, param->reg.status);
32 esp_ble_gap_cb_param_t *param) {
36 case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT:
39 case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT:
42 case ESP_GAP_BLE_ADV_START_COMPLETE_EVT:
43 if (param->adv_start_cmpl.status != ESP_BT_STATUS_SUCCESS) {
44 ESP_LOGE(
"MIDIBLE",
"Advertising start failed");
47 case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT:
48 if (param->adv_stop_cmpl.status != ESP_BT_STATUS_SUCCESS) {
49 ESP_LOGE(
"MIDIBLE",
"Advertising stop failed");
53 case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT:
break;
55 case ESP_GAP_BLE_PASSKEY_REQ_EVT:
break;
56 case ESP_GAP_BLE_OOB_REQ_EVT:
break;
57 case ESP_GAP_BLE_LOCAL_IR_EVT:
break;
58 case ESP_GAP_BLE_LOCAL_ER_EVT:
break;
59 case ESP_GAP_BLE_NC_REQ_EVT:
break;
60 case ESP_GAP_BLE_SEC_REQ_EVT:
65 esp_ble_gap_security_rsp(param->ble_security.ble_req.bd_addr,
true);
67 case ESP_GAP_BLE_PASSKEY_NOTIF_EVT:
break;
68 case ESP_GAP_BLE_KEY_EVT:
break;
69 case ESP_GAP_BLE_AUTH_CMPL_EVT:
break;
70 case ESP_GAP_BLE_REMOVE_BOND_DEV_COMPLETE_EVT:
break;
72 case ESP_GAP_BLE_SET_LOCAL_PRIVACY_COMPLETE_EVT:
73 if (param->local_privacy_cmpl.status != ESP_BT_STATUS_SUCCESS) {
75 "config local privacy failed, error status = %d",
76 param->local_privacy_cmpl.status);
Advertising the MIDI service for Bluetooth Low Energy.
bool advertising_handle_config_complete_event(esp_ble_gap_cb_param_t *param)
Callback that indicates that the configuration of the advertising data was complete.
bool advertising_config(void)
Configure the advertising data, register with the Bluetooth driver.
bool advertising_handle_config_response_complete_event(esp_ble_gap_cb_param_t *param)
Callback that indicates that the configuration of the advertising response data was complete.
Helpers for printing the names of enum values of the ESP32 Bluetooth API.
Helpers for printing Bluetooth events and status.
void print_gatts_event(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
void print_gap_event(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
Declarations of internal functions for the MIDI over BLE system, used in the midi-*....
void midi_register_interface(esp_gatt_if_t gatts_if)
uint16_t midi_get_app_id(void)
void midi_handle_gatts_event(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)