esp_ble_gatts_send_response doesn't work in the gatts_server_sercive_table demo
Posted: Tue Dec 29, 2020 7:11 pm
Hello everyone,
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:
However when I try to send a read command from nRF Connect App i always get the following output:
The problem is, i really don't understand why i get this output. It seems like the send response function trys to send the message to the conn_id: 03. But shouldnt the esp_ble_gatts_send_response() function send the message to conn_id: 0?
Or am i messing this whole thing up due to any other reason?
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?