diff --git a/src/ble/att_db.c b/src/ble/att_db.c index fac32de5d..5b86952f7 100644 --- a/src/ble/att_db.c +++ b/src/ble/att_db.c @@ -1510,7 +1510,7 @@ uint16_t btp_att_get_attributes_by_uuid16(uint16_t start_handle, uint16_t end_ha if (it.handle == 0) break; if (it.handle < start_handle) continue; if (it.handle > end_handle) break; - if (att_iterator_match_uuid16(&it, uuid16)){ + if ((uuid16 == 0) || att_iterator_match_uuid16(&it, uuid16)){ little_endian_store_16(response_buffer, pos, it.handle); pos += 2; response_buffer[pos++] = btp_permissions_for_flags(it.flags); diff --git a/test/auto-pts/btpclient.c b/test/auto-pts/btpclient.c index 1d24a5894..add99ecc0 100644 --- a/test/auto-pts/btpclient.c +++ b/test/auto-pts/btpclient.c @@ -1065,6 +1065,10 @@ static void btp_gatt_handler(uint8_t opcode, uint8_t controller_index, uint16_t uint16_t end_handle = little_endian_read_16(data, 2); uuid_len = data[4]; switch (uuid_len){ + case 0: + response_len = btp_att_get_attributes_by_uuid16(start_handle, end_handle, 0, response_buffer, sizeof(response_buffer)); + btp_send(BTP_SERVICE_ID_GATT, opcode, controller_index, response_len, response_buffer); + break; case 2: uuid16 = little_endian_read_16(data, 5); response_len = btp_att_get_attributes_by_uuid16(start_handle, end_handle, uuid16, response_buffer, sizeof(response_buffer));