gatt_client: fix read long characteristic descriptor

This commit is contained in:
Matthias Ringwald 2021-04-12 11:47:30 +02:00
parent f41de160e4
commit dc13fd8d8b
2 changed files with 13 additions and 5 deletions

View File

@ -69,7 +69,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Examples: use `btstack_event.h` getters instead of direct array access, use enum to compare status codes
- HFP: provide acl_handle in events to identify connection
- HCI Transport: extract convenience function declaration for h4, h5, em9304_spi, and usb into separate hci_transport_{type}.h
- GATT Client: Use ATT_READ_REQUEST for first blob of Read Long Characteristic
- GATT Client: Use ATT_READ_REQUEST for first blob of Read Long Characteristic and Read Long Characteristic Descriptor
- HID: Move `src/classic/hid.h` into `src` and prefix with `btstack_` to use it with BLE and avoid name clashes
## Release v1.3.2

View File

@ -1442,7 +1442,7 @@ static void gatt_client_att_packet_handler(uint8_t packet_type, uint16_t handle,
break;
case ATT_READ_RESPONSE:
switch (gatt_client->gatt_client_state){
case P_W4_INCLUDED_SERVICE_UUID_WITH_QUERY_RESULT: {
case P_W4_INCLUDED_SERVICE_UUID_WITH_QUERY_RESULT:
if (size >= 17){
uint8_t uuid128[16];
reverse_128(&packet[1], uuid128);
@ -1451,25 +1451,33 @@ static void gatt_client_att_packet_handler(uint8_t packet_type, uint16_t handle,
trigger_next_included_service_query(gatt_client, gatt_client->start_group_handle);
// GATT_EVENT_QUERY_COMPLETE is emitted by trigger_next_xxx when done
break;
}
case P_W4_READ_CHARACTERISTIC_VALUE_RESULT:
gatt_client_handle_transaction_complete(gatt_client);
report_gatt_characteristic_value(gatt_client, gatt_client->attribute_handle, &packet[1], size - 1u);
emit_gatt_complete_event(gatt_client, ATT_ERROR_SUCCESS);
break;
case P_W4_READ_CHARACTERISTIC_DESCRIPTOR_RESULT:{
case P_W4_READ_CHARACTERISTIC_DESCRIPTOR_RESULT:
gatt_client_handle_transaction_complete(gatt_client);
report_gatt_characteristic_descriptor(gatt_client, gatt_client->attribute_handle, &packet[1], size - 1u, 0u);
emit_gatt_complete_event(gatt_client, ATT_ERROR_SUCCESS);
break;
}
// Use ATT_READ_REQUEST for first blob of Read Long Characteristic
case P_W4_READ_BLOB_RESULT:
report_gatt_long_characteristic_value_blob(gatt_client, gatt_client->attribute_handle, &packet[1], size - 1u, gatt_client->attribute_offset);
trigger_next_blob_query(gatt_client, P_W2_SEND_READ_BLOB_QUERY, size - 1u);
// GATT_EVENT_QUERY_COMPLETE is emitted by trigger_next_xxx when done
break;
// Use ATT_READ_REQUEST for first blob of Read Long Characteristic Descriptor
case P_W4_READ_BLOB_CHARACTERISTIC_DESCRIPTOR_RESULT:
report_gatt_long_characteristic_descriptor(gatt_client, gatt_client->attribute_handle, &packet[1], size-1u, gatt_client->attribute_offset);
trigger_next_blob_query(gatt_client, P_W2_SEND_READ_BLOB_CHARACTERISTIC_DESCRIPTOR_QUERY, size-1u);
// GATT_EVENT_QUERY_COMPLETE is emitted by trigger_next_xxx when done
break;
default:
break;
}