From aa235aad54cd50106ae264c32354a56a27f62d21 Mon Sep 17 00:00:00 2001 From: Chienyuan Date: Tue, 6 Aug 2019 16:39:20 +0800 Subject: [PATCH] GD HCI: register events for gd test on device Bug: 138260216 Test: run run_cert.sh Change-Id: I7838fec1a7cfcc9a6e82830e81b7f9308f3654ce --- gd/hci/hci_layer.cc | 11 +++++++++++ gd/hci/hci_packets.pdl | 1 + 2 files changed, 12 insertions(+) diff --git a/gd/hci/hci_layer.cc b/gd/hci/hci_layer.cc index 1cfc5c28e..fc41fe431 100644 --- a/gd/hci/hci_layer.cc +++ b/gd/hci/hci_layer.cc @@ -104,10 +104,21 @@ struct HciLayer::impl : public hal::HciHalCallbacks { handler); RegisterEventHandler(EventCode::COMMAND_STATUS, Bind(&impl::command_status_callback, common::Unretained(this)), handler); + // TODO find the right place + RegisterEventHandler(EventCode::CONNECTION_PACKET_TYPE_CHANGE, Bind(&impl::drop, common::Unretained(this)), + handler); + RegisterEventHandler(EventCode::ROLE_CHANGE, Bind(&impl::drop, common::Unretained(this)), handler); + RegisterEventHandler(EventCode::PAGE_SCAN_REPETITION_MODE_CHANGE, Bind(&impl::drop, common::Unretained(this)), + handler); + RegisterEventHandler(EventCode::MAX_SLOTS_CHANGE, Bind(&impl::drop, common::Unretained(this)), handler); + RegisterEventHandler(EventCode::VENDOR_SPECIFIC, Bind(&impl::drop, common::Unretained(this)), handler); + EnqueueCommand(ResetBuilder::Create(), BindOnce(&fail_if_reset_complete_not_success), handler); hal_->registerIncomingPacketCallback(this); } + void drop(EventPacketView) {} + void dequeue_and_send_acl() { auto packet = acl_queue_.GetDownEnd()->TryDequeue(); send_acl(std::move(packet)); diff --git a/gd/hci/hci_packets.pdl b/gd/hci/hci_packets.pdl index f3155d7c2..461f2a1f4 100644 --- a/gd/hci/hci_packets.pdl +++ b/gd/hci/hci_packets.pdl @@ -382,6 +382,7 @@ enum EventCode : 8 { REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION = 0x3D, LE_META_EVENT = 0x3e, NUMBER_OF_COMPLETED_DATA_BLOCKS = 0x48, + VENDOR_SPECIFIC = 0xFF, } packet EventPacket { -- 2.11.0