BT: Ignore vendor debug packets in TearDown
Test: make, VtsHalBluetoothV1_0TargetTest
Change-Id: Id965b3783f4e599f5389166c5a98e6ee35cee15c
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 90fbb3f..beb9a3e 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -105,6 +105,9 @@
(ACL_PACKET_BOUNDARY_FLAG_FIRST_AUTO_FLUSHABLE \
<< ACL_PACKET_BOUNDARY_FLAG_OFFSET)
+// To be removed in VTS release builds
+#define ACL_HANDLE_QCA_DEBUG_MESSAGE 0xedc
+
constexpr char kCallbackNameAclEventReceived[] = "aclDataReceived";
constexpr char kCallbackNameHciEventReceived[] = "hciEventReceived";
constexpr char kCallbackNameInitializationComplete[] = "initializationComplete";
@@ -318,6 +321,19 @@
break;
}
}
+ // To be removed in VTS release builds
+ while (acl_queue.size() > 0) {
+ hidl_vec<uint8_t> acl_packet = acl_queue.front();
+ uint16_t connection_handle = acl_packet[1] & 0xF;
+ connection_handle <<= 8;
+ connection_handle |= acl_packet[0];
+ bool packet_is_no_op = connection_handle == ACL_HANDLE_QCA_DEBUG_MESSAGE;
+ if (packet_is_no_op) {
+ acl_queue.pop();
+ } else {
+ break;
+ }
+ }
}
// Receive an event, discarding NO-OPs.