If you have tried sending more than 22 bytes using the esp_ble_gatts_send_response API, you may have encountered the warning.
BT_GATT: attribute value too long, to be truncated to 22
The generic attribute protocol only supports packet sizes of 23 by default.
Excluding ATT protocol headers this leaves 22 bytes of payload.
In order to send bigger payloads, your application needs to support the long read command which sends your payload in multiple packets.
Within the ESP32 bluedroid framework, both read and read long commands trigger the ESP_GATTS_READ_EVT event.
Read long commands can be differentiated using the is_long and offset fields in read command params.
For a long read, the ESP_GATTS_READ_EVT is fired multiple times with increasing offsets.
So to tie everything together, use the offset parameter to locate the correct segment within the send buffer. When buffer has been read to entirety send an empty segment.