Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
midi-write.c
Go to the documentation of this file.
1#ifdef ESP32
2#include <sdkconfig.h>
3#if CONFIG_BT_BLE_ENABLED
4
12#include "app.h"
13#include "logging.h"
14#include "midi-private.h"
15
16#include <esp_gatt_common_api.h>
17
18void midi_handle_write_event(esp_gatt_if_t gatts_if,
19 esp_ble_gatts_cb_param_t *param) {
20 if (param->write.need_rsp) {
21 // MIDI never needs a response, send an error response
22 esp_ble_gatts_send_response(gatts_if, param->write.conn_id,
23 param->write.trans_id,
24 ESP_GATT_REQ_NOT_SUPPORTED, NULL);
25 return;
26 }
27 // Not a prepare event, handle the data immediately
28 midi_ble_instance_handle_data(param->write.conn_id, param->write.value,
29 param->write.len);
30}
31
32void midi_handle_write_exec_event(esp_gatt_if_t gatts_if,
33 esp_ble_gatts_cb_param_t *param) {
34 esp_ble_gatts_send_response(gatts_if, param->exec_write.conn_id,
35 param->exec_write.trans_id,
36 ESP_GATT_REQ_NOT_SUPPORTED, NULL);
37}
38
39#endif
40#endif
void midi_ble_instance_handle_data(uint16_t conn_handle, const uint8_t *data, uint16_t length)
Declarations of internal functions for the MIDI over BLE system, used in the midi-*....
void midi_handle_write_event(esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
void midi_handle_write_exec_event(esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)