i have some strange problems, using the gatts_server_service_table example and i haven't found any similar posts yet.
In the example i added code to the ESP_GATTS_READ_EVT - Event, to respond to read events, like in the gatts_demo.c file
The read-event in my gatts_profile_event_handler() looks as follows:
Code: Select all
case ESP_GATTS_READ_EVT:{
ESP_LOGI(GATTS_TABLE_TAG, "GATT_READ_EVT, conn_id %d, trans_id %d, handle %d\n", param->read.conn_id, param->read.trans_id, param->read.handle);
esp_gatt_rsp_t rsp;
memset(&rsp, 0, sizeof(esp_gatt_rsp_t));
rsp.attr_value.handle = param->read.handle;
rsp.attr_value.len = 4;
//Hier muss je nach verwendetem Handle ausgelesen werden
rsp.attr_value.value[0] = 0x16;
rsp.attr_value.value[1] = 0x54;
rsp.attr_value.value[2] = 0x32;
rsp.attr_value.value[3] = 0x61;
esp_ble_gatts_send_response(gatts_if, param->read.conn_id, param->read.trans_id,
ESP_GATT_OK, &rsp);
break;
}
Code: Select all
I (23582) BMP280-BLE: GATT_READ_EVT, conn_id 0, trans_id 2, handle 45
E (23582) BT_GATT: GATTS_SendRsp conn_id: 3 waiting for op_code = 00
E (23582) BT_APPL: Sending response failed
Or am i messing this whole thing up due to any other reason?