diff --git a/test/auto-pts/btp.h b/test/auto-pts/btp.h index 805e2a770..e8eb032ef 100644 --- a/test/auto-pts/btp.h +++ b/test/auto-pts/btp.h @@ -194,6 +194,7 @@ extern "C" { #define BTP_GATT_OP_DISC_CHRC_UUID 0x0f #define BTP_GATT_OP_DISC_ALL_DESC 0x10 #define BTP_GATT_OP_READ 0x11 +#define BTP_GATT_OP_READ_UUID 0x12 #define BTP_GATT_OP_READ_LONG 0x13 #define BTP_GATT_OP_READ_MULTIPLE 0x14 #define BTP_GATT_OP_WRITE_WITHOUT_RSP 0x15 diff --git a/test/auto-pts/btpclient.c b/test/auto-pts/btpclient.c index b22bb84df..a5c7f7c71 100644 --- a/test/auto-pts/btpclient.c +++ b/test/auto-pts/btpclient.c @@ -504,6 +504,7 @@ static void gatt_client_packet_handler(uint8_t packet_type, uint16_t channel, ui response_op = 0; switch (op){ case BTP_GATT_OP_READ: + case BTP_GATT_OP_READ_LONG: // if we got here, the read failed btp_append_uint8(gatt_event_query_complete_get_att_status(packet)); btp_append_uint16(0); @@ -1265,7 +1266,7 @@ static void btp_gatt_handler(uint8_t opcode, uint8_t controller_index, uint16_t } break; case BTP_GATT_OP_DISC_CHRC_UUID: - MESSAGE("BTP_GATT_OP_DISC_CHRC_UUID - NOP"); + MESSAGE("BTP_GATT_OP_DISC_CHRC_UUID"); // initialize response response_len = 0; response_buffer[response_len++] = 0; @@ -1313,12 +1314,21 @@ static void btp_gatt_handler(uint8_t opcode, uint8_t controller_index, uint16_t response_service_id = BTP_SERVICE_ID_GATT; response_op = opcode; if (controller_index == 0){ - uint16_t handle = little_endian_read_16(response_buffer, 7); - gatt_client_read_value_of_characteristic_using_value_handle(&gatt_client_packet_handler, remote_handle, handle); + uint16_t value_handle = little_endian_read_16(response_buffer, 7); + gatt_client_read_value_of_characteristic_using_value_handle(&gatt_client_packet_handler, remote_handle, value_handle); } break; case BTP_GATT_OP_READ_LONG: - MESSAGE("BTP_GATT_OP_READ_LONG - NOP"); + MESSAGE("BTP_GATT_OP_READ_LONG"); + // initialize response + response_len = 0; + response_service_id = BTP_SERVICE_ID_GATT; + response_op = opcode; + if (controller_index == 0){ + uint16_t value_handle = little_endian_read_16(response_buffer, 7); + uint16_t offset = little_endian_read_16(response_buffer, 9); + gatt_client_read_long_value_of_characteristic_using_value_handle_with_offset(&gatt_client_packet_handler, remote_handle, value_handle, offset); + } break; case BTP_GATT_OP_READ_MULTIPLE: MESSAGE("BTP_GATT_OP_READ_MULTIPLE - NOP");