test/auto-pts: ignore Service Changed indications in btpclient

This commit is contained in:
Matthias Ringwald 2021-06-09 10:07:25 +02:00
parent 905c28a62c
commit 296e7eac7f

View File

@ -623,6 +623,15 @@ static void gatt_client_packet_handler(uint8_t packet_type, uint16_t channel, ui
btp_socket_send_packet(BTP_SERVICE_ID_GATT, BTP_GATT_EV_NOTIFICATION, 0, response_len, response_buffer);
break;
case GATT_EVENT_INDICATION:
// In GATT/CL/GAD/BV-01-C, PTS sends an GATT Indication for the "Service Changed" Characteristic on connection complete.
// This unexpected event breaks the autoptsclient logic that expects a Command response.
// Workaround: ignore this particular indication
if (gatt_event_indication_get_value_length(packet) == 4){
const uint8_t * value = gatt_event_indication_get_value(packet);
uint16_t start_handle = little_endian_read_16(value, 0);
uint16_t end_handle = little_endian_read_16(value, 2);
if ((start_handle == 0x0001) && (end_handle == 0xffff)) break;
}
response_len = 0;
btp_append_remote_address();
btp_append_uint8(2); // Indication