From 5ae9ed35088393884a60d56f328b36b26a22823f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 22 Jan 2020 15:42:57 +0100 Subject: [PATCH] auto-pts: implement BTP_GATT_OP_READ_MULTIPLE --- test/auto-pts/btpclient.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/auto-pts/btpclient.c b/test/auto-pts/btpclient.c index 4d34f3b19..b96a31945 100644 --- a/test/auto-pts/btpclient.c +++ b/test/auto-pts/btpclient.c @@ -110,6 +110,8 @@ static bool gap_delete_bonding; static uint32_t current_settings; // GATT +static uint16_t gatt_read_multiple_handles[16]; + // debug static btstack_timer_source_t heartbeat; @@ -537,6 +539,7 @@ static void gatt_client_packet_handler(uint8_t packet_type, uint16_t channel, ui case BTP_GATT_OP_READ: case BTP_GATT_OP_READ_UUID: case BTP_GATT_OP_READ_LONG: + case BTP_GATT_OP_READ_MULTIPLE: if (response_len == 0){ // if we got here, the read failed and we report the att status btp_append_uint8(gatt_event_query_complete_get_att_status(packet)); @@ -1408,7 +1411,19 @@ static void btp_gatt_handler(uint8_t opcode, uint8_t controller_index, uint16_t } break; case BTP_GATT_OP_READ_MULTIPLE: - MESSAGE("BTP_GATT_OP_READ_MULTIPLE - NOP"); + MESSAGE("BTP_GATT_OP_READ_MULTIPLE"); + // initialize response + response_len = 0; + response_service_id = BTP_SERVICE_ID_GATT; + response_op = opcode; + if (controller_index == 0) { + uint16_t handles_count = data[7]; + uint16_t i; + for (i=0;i