Loading system/gd/cert/captures.py +5 −5 Original line number Diff line number Diff line Loading @@ -32,25 +32,25 @@ class HalCaptures(object): return Capture( lambda packet: packet.payload[0:5] == b'\x0e\x0a\x01\x09\x10', lambda packet: hci_packets.ReadBdAddrCompleteView( hci_packets.CommandCompleteView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) @staticmethod def ConnectionRequestCapture(): return Capture( lambda packet: packet.payload[0:2] == b'\x04\x0a', lambda packet: hci_packets.ConnectionRequestView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) @staticmethod def ConnectionCompleteCapture(): return Capture( lambda packet: packet.payload[0:3] == b'\x03\x0b\x00', lambda packet: hci_packets.ConnectionCompleteView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) @staticmethod def DisconnectionCompleteCapture(): return Capture( lambda packet: packet.payload[0:2] == b'\x05\x04', lambda packet: hci_packets.DisconnectionCompleteView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) @staticmethod def LeConnectionCompleteCapture(): Loading @@ -58,7 +58,7 @@ class HalCaptures(object): lambda packet: packet.payload[0] == 0x3e and (packet.payload[2] == 0x01 or packet.payload[2] == 0x0a), lambda packet: hci_packets.LeConnectionCompleteView( hci_packets.LeMetaEventView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) class HciCaptures(object): Loading system/gd/cert/matchers.py +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ class HciMatchers(object): @staticmethod def _extract_matching_event(packet_bytes, event_code): event = hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet_bytes))) event = hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet_bytes))) if event is None: return None if event_code is not None and event.GetEventCode() != event_code: Loading Loading @@ -144,7 +144,7 @@ class HciMatchers(object): @staticmethod def LogEventCode(): return lambda event: logging.info("Received event: %x" % hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(event.payload))).GetEventCode()) return lambda event: logging.info("Received event: %x" % hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(event.event))).GetEventCode()) @staticmethod def LinkKeyRequest(): Loading system/gd/hal/fuzz/fuzz_hci_hal.cc +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ void FuzzHciHal::sendHciCommand(HciPacket packet) { } void FuzzHciHal::injectHciEvent(std::vector<uint8_t> data) { hci::EventPacketView event = hci::EventPacketView::FromBytes(data); hci::EventView event = hci::EventView::FromBytes(data); if (!event.IsValid()) { return; } Loading system/gd/hci/acl_manager/classic_impl.h +16 −16 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_classic_event(EventPacketView event_packet) { void on_classic_event(EventView event_packet) { EventCode event_code = event_packet.GetEventCode(); switch (event_code) { case EventCode::CONNECTION_COMPLETE: Loading Loading @@ -141,7 +141,7 @@ struct classic_impl : public security::ISecurityManagerListener { client_handler_ = handler; } void on_incoming_connection(EventPacketView packet) { void on_incoming_connection(EventView packet) { ConnectionRequestView request = ConnectionRequestView::Create(packet); ASSERT(request.IsValid()); Address address = request.GetBdAddr(); Loading Loading @@ -198,7 +198,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_connection_complete(EventPacketView packet) { void on_connection_complete(EventView packet) { ConnectionCompleteView connection_complete = ConnectionCompleteView::Create(packet); ASSERT(connection_complete.IsValid()); auto status = connection_complete.GetStatus(); Loading Loading @@ -251,7 +251,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_connection_packet_type_changed(EventPacketView packet) { void on_connection_packet_type_changed(EventView packet) { ConnectionPacketTypeChangedView packet_type_changed = ConnectionPacketTypeChangedView::Create(packet); if (!packet_type_changed.IsValid()) { LOG_ERROR("Received on_connection_packet_type_changed with invalid packet"); Loading @@ -272,7 +272,7 @@ struct classic_impl : public security::ISecurityManagerListener { // We don't handle this event; we didn't do this in legacy stack either. } void on_central_link_key_complete(EventPacketView packet) { void on_central_link_key_complete(EventView packet) { CentralLinkKeyCompleteView complete_view = CentralLinkKeyCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_central_link_key_complete with invalid packet"); Loading @@ -294,7 +294,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnCentralLinkKeyComplete(key_flag); } void on_authentication_complete(EventPacketView packet) { void on_authentication_complete(EventView packet) { AuthenticationCompleteView authentication_complete = AuthenticationCompleteView::Create(packet); if (!authentication_complete.IsValid()) { LOG_ERROR("Received on_authentication_complete with invalid packet"); Loading Loading @@ -351,7 +351,7 @@ struct classic_impl : public security::ISecurityManagerListener { handler_->BindOnceOn(this, &classic_impl::on_accept_connection_status, address)); } void on_change_connection_link_key_complete(EventPacketView packet) { void on_change_connection_link_key_complete(EventView packet) { ChangeConnectionLinkKeyCompleteView complete_view = ChangeConnectionLinkKeyCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_change_connection_link_key_complete with invalid packet"); Loading @@ -372,7 +372,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnChangeConnectionLinkKeyComplete(); } void on_read_clock_offset_complete(EventPacketView packet) { void on_read_clock_offset_complete(EventView packet) { ReadClockOffsetCompleteView complete_view = ReadClockOffsetCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_read_clock_offset_complete with invalid packet"); Loading @@ -394,7 +394,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnReadClockOffsetComplete(clock_offset); } void on_mode_change(EventPacketView packet) { void on_mode_change(EventView packet) { ModeChangeView mode_change_view = ModeChangeView::Create(packet); if (!mode_change_view.IsValid()) { LOG_ERROR("Received on_mode_change with invalid packet"); Loading @@ -417,7 +417,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnModeChange(current_mode, interval); } void on_qos_setup_complete(EventPacketView packet) { void on_qos_setup_complete(EventView packet) { QosSetupCompleteView complete_view = QosSetupCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_qos_setup_complete with invalid packet"); Loading @@ -443,7 +443,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnQosSetupComplete(service_type, token_rate, peak_bandwidth, latency, delay_variation); } void on_role_change(EventPacketView packet) { void on_role_change(EventView packet) { RoleChangeView role_change_view = RoleChangeView::Create(packet); if (!role_change_view.IsValid()) { LOG_ERROR("Received on_role_change with invalid packet"); Loading @@ -463,7 +463,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_flow_specification_complete(EventPacketView packet) { void on_flow_specification_complete(EventView packet) { FlowSpecificationCompleteView complete_view = FlowSpecificationCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_flow_specification_complete with invalid packet"); Loading Loading @@ -491,7 +491,7 @@ struct classic_impl : public security::ISecurityManagerListener { flow_direction, service_type, token_rate, token_bucket_size, peak_bandwidth, access_latency); } void on_flush_occurred(EventPacketView packet) { void on_flush_occurred(EventView packet) { FlushOccurredView flush_occurred_view = FlushOccurredView::Create(packet); if (!flush_occurred_view.IsValid()) { LOG_ERROR("Received on_flush_occurred with invalid packet"); Loading @@ -518,7 +518,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnReadRemoteVersionInformationComplete(version, manufacturer_name, sub_version); } void on_read_remote_supported_features_complete(EventPacketView packet) { void on_read_remote_supported_features_complete(EventView packet) { auto view = ReadRemoteSupportedFeaturesCompleteView::Create(packet); ASSERT_LOG(view.IsValid(), "Read remote supported features packet invalid"); uint16_t handle = view.GetConnectionHandle(); Loading @@ -531,7 +531,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnReadRemoteExtendedFeaturesComplete(0, 1, view.GetLmpFeatures()); } void on_read_remote_extended_features_complete(EventPacketView packet) { void on_read_remote_extended_features_complete(EventView packet) { auto view = ReadRemoteExtendedFeaturesCompleteView::Create(packet); ASSERT_LOG(view.IsValid(), "Read remote extended features packet invalid"); uint16_t handle = view.GetConnectionHandle(); Loading @@ -545,7 +545,7 @@ struct classic_impl : public security::ISecurityManagerListener { view.GetPageNumber(), view.GetMaximumPageNumber(), view.GetExtendedLmpFeatures()); } void on_link_supervision_timeout_changed(EventPacketView packet) { void on_link_supervision_timeout_changed(EventView packet) { auto view = LinkSupervisionTimeoutChangedView::Create(packet); ASSERT_LOG(view.IsValid(), "Link supervision timeout changed packet invalid"); LOG_INFO("UNIMPLEMENTED called"); Loading system/gd/hci/acl_manager_test.cc +7 −8 Original line number Diff line number Diff line Loading @@ -191,8 +191,7 @@ class TestHciLayer : public HciLayer { return command; } void RegisterEventHandler(EventCode event_code, common::ContextualCallback<void(EventPacketView)> event_handler) override { void RegisterEventHandler(EventCode event_code, common::ContextualCallback<void(EventView)> event_handler) override { registered_events_[event_code] = event_handler; } Loading @@ -209,9 +208,9 @@ class TestHciLayer : public HciLayer { registered_le_events_.erase(subevent_code); } void IncomingEvent(std::unique_ptr<EventPacketBuilder> event_builder) { void IncomingEvent(std::unique_ptr<EventBuilder> event_builder) { auto packet = GetPacketView(std::move(event_builder)); EventPacketView event = EventPacketView::Create(packet); EventView event = EventView::Create(packet); ASSERT_TRUE(event.IsValid()); EventCode event_code = event.GetEventCode(); ASSERT_NE(registered_events_.find(event_code), registered_events_.end()) << EventCodeText(event_code); Loading @@ -220,7 +219,7 @@ class TestHciLayer : public HciLayer { void IncomingLeMetaEvent(std::unique_ptr<LeMetaEventBuilder> event_builder) { auto packet = GetPacketView(std::move(event_builder)); EventPacketView event = EventPacketView::Create(packet); EventView event = EventView::Create(packet); LeMetaEventView meta_event_view = LeMetaEventView::Create(event); EXPECT_TRUE(meta_event_view.IsValid()); SubeventCode subevent_code = meta_event_view.GetSubeventCode(); Loading Loading @@ -252,14 +251,14 @@ class TestHciLayer : public HciLayer { EXPECT_EQ(queue_end->TryDequeue(), nullptr); } void CommandCompleteCallback(EventPacketView event) { void CommandCompleteCallback(EventView event) { CommandCompleteView complete_view = CommandCompleteView::Create(event); ASSERT_TRUE(complete_view.IsValid()); std::move(command_complete_callbacks.front()).Invoke(complete_view); command_complete_callbacks.pop_front(); } void CommandStatusCallback(EventPacketView event) { void CommandStatusCallback(EventView event) { CommandStatusView status_view = CommandStatusView::Create(event); ASSERT_TRUE(status_view.IsValid()); std::move(command_status_callbacks.front()).Invoke(status_view); Loading Loading @@ -293,7 +292,7 @@ class TestHciLayer : public HciLayer { } private: std::map<EventCode, common::ContextualCallback<void(EventPacketView)>> registered_events_; std::map<EventCode, common::ContextualCallback<void(EventView)>> registered_events_; std::map<SubeventCode, common::ContextualCallback<void(LeMetaEventView)>> registered_le_events_; std::list<common::ContextualOnceCallback<void(CommandCompleteView)>> command_complete_callbacks; std::list<common::ContextualOnceCallback<void(CommandStatusView)>> command_status_callbacks; Loading Loading
system/gd/cert/captures.py +5 −5 Original line number Diff line number Diff line Loading @@ -32,25 +32,25 @@ class HalCaptures(object): return Capture( lambda packet: packet.payload[0:5] == b'\x0e\x0a\x01\x09\x10', lambda packet: hci_packets.ReadBdAddrCompleteView( hci_packets.CommandCompleteView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) @staticmethod def ConnectionRequestCapture(): return Capture( lambda packet: packet.payload[0:2] == b'\x04\x0a', lambda packet: hci_packets.ConnectionRequestView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) @staticmethod def ConnectionCompleteCapture(): return Capture( lambda packet: packet.payload[0:3] == b'\x03\x0b\x00', lambda packet: hci_packets.ConnectionCompleteView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) @staticmethod def DisconnectionCompleteCapture(): return Capture( lambda packet: packet.payload[0:2] == b'\x05\x04', lambda packet: hci_packets.DisconnectionCompleteView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload))))) @staticmethod def LeConnectionCompleteCapture(): Loading @@ -58,7 +58,7 @@ class HalCaptures(object): lambda packet: packet.payload[0] == 0x3e and (packet.payload[2] == 0x01 or packet.payload[2] == 0x0a), lambda packet: hci_packets.LeConnectionCompleteView( hci_packets.LeMetaEventView( hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet.payload)))))) class HciCaptures(object): Loading
system/gd/cert/matchers.py +2 −2 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ class HciMatchers(object): @staticmethod def _extract_matching_event(packet_bytes, event_code): event = hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(packet_bytes))) event = hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(packet_bytes))) if event is None: return None if event_code is not None and event.GetEventCode() != event_code: Loading Loading @@ -144,7 +144,7 @@ class HciMatchers(object): @staticmethod def LogEventCode(): return lambda event: logging.info("Received event: %x" % hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(event.payload))).GetEventCode()) return lambda event: logging.info("Received event: %x" % hci_packets.EventView(bt_packets.PacketViewLittleEndian(list(event.event))).GetEventCode()) @staticmethod def LinkKeyRequest(): Loading
system/gd/hal/fuzz/fuzz_hci_hal.cc +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ void FuzzHciHal::sendHciCommand(HciPacket packet) { } void FuzzHciHal::injectHciEvent(std::vector<uint8_t> data) { hci::EventPacketView event = hci::EventPacketView::FromBytes(data); hci::EventView event = hci::EventView::FromBytes(data); if (!event.IsValid()) { return; } Loading
system/gd/hci/acl_manager/classic_impl.h +16 −16 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_classic_event(EventPacketView event_packet) { void on_classic_event(EventView event_packet) { EventCode event_code = event_packet.GetEventCode(); switch (event_code) { case EventCode::CONNECTION_COMPLETE: Loading Loading @@ -141,7 +141,7 @@ struct classic_impl : public security::ISecurityManagerListener { client_handler_ = handler; } void on_incoming_connection(EventPacketView packet) { void on_incoming_connection(EventView packet) { ConnectionRequestView request = ConnectionRequestView::Create(packet); ASSERT(request.IsValid()); Address address = request.GetBdAddr(); Loading Loading @@ -198,7 +198,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_connection_complete(EventPacketView packet) { void on_connection_complete(EventView packet) { ConnectionCompleteView connection_complete = ConnectionCompleteView::Create(packet); ASSERT(connection_complete.IsValid()); auto status = connection_complete.GetStatus(); Loading Loading @@ -251,7 +251,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_connection_packet_type_changed(EventPacketView packet) { void on_connection_packet_type_changed(EventView packet) { ConnectionPacketTypeChangedView packet_type_changed = ConnectionPacketTypeChangedView::Create(packet); if (!packet_type_changed.IsValid()) { LOG_ERROR("Received on_connection_packet_type_changed with invalid packet"); Loading @@ -272,7 +272,7 @@ struct classic_impl : public security::ISecurityManagerListener { // We don't handle this event; we didn't do this in legacy stack either. } void on_central_link_key_complete(EventPacketView packet) { void on_central_link_key_complete(EventView packet) { CentralLinkKeyCompleteView complete_view = CentralLinkKeyCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_central_link_key_complete with invalid packet"); Loading @@ -294,7 +294,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnCentralLinkKeyComplete(key_flag); } void on_authentication_complete(EventPacketView packet) { void on_authentication_complete(EventView packet) { AuthenticationCompleteView authentication_complete = AuthenticationCompleteView::Create(packet); if (!authentication_complete.IsValid()) { LOG_ERROR("Received on_authentication_complete with invalid packet"); Loading Loading @@ -351,7 +351,7 @@ struct classic_impl : public security::ISecurityManagerListener { handler_->BindOnceOn(this, &classic_impl::on_accept_connection_status, address)); } void on_change_connection_link_key_complete(EventPacketView packet) { void on_change_connection_link_key_complete(EventView packet) { ChangeConnectionLinkKeyCompleteView complete_view = ChangeConnectionLinkKeyCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_change_connection_link_key_complete with invalid packet"); Loading @@ -372,7 +372,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnChangeConnectionLinkKeyComplete(); } void on_read_clock_offset_complete(EventPacketView packet) { void on_read_clock_offset_complete(EventView packet) { ReadClockOffsetCompleteView complete_view = ReadClockOffsetCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_read_clock_offset_complete with invalid packet"); Loading @@ -394,7 +394,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnReadClockOffsetComplete(clock_offset); } void on_mode_change(EventPacketView packet) { void on_mode_change(EventView packet) { ModeChangeView mode_change_view = ModeChangeView::Create(packet); if (!mode_change_view.IsValid()) { LOG_ERROR("Received on_mode_change with invalid packet"); Loading @@ -417,7 +417,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnModeChange(current_mode, interval); } void on_qos_setup_complete(EventPacketView packet) { void on_qos_setup_complete(EventView packet) { QosSetupCompleteView complete_view = QosSetupCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_qos_setup_complete with invalid packet"); Loading @@ -443,7 +443,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnQosSetupComplete(service_type, token_rate, peak_bandwidth, latency, delay_variation); } void on_role_change(EventPacketView packet) { void on_role_change(EventView packet) { RoleChangeView role_change_view = RoleChangeView::Create(packet); if (!role_change_view.IsValid()) { LOG_ERROR("Received on_role_change with invalid packet"); Loading @@ -463,7 +463,7 @@ struct classic_impl : public security::ISecurityManagerListener { } } void on_flow_specification_complete(EventPacketView packet) { void on_flow_specification_complete(EventView packet) { FlowSpecificationCompleteView complete_view = FlowSpecificationCompleteView::Create(packet); if (!complete_view.IsValid()) { LOG_ERROR("Received on_flow_specification_complete with invalid packet"); Loading Loading @@ -491,7 +491,7 @@ struct classic_impl : public security::ISecurityManagerListener { flow_direction, service_type, token_rate, token_bucket_size, peak_bandwidth, access_latency); } void on_flush_occurred(EventPacketView packet) { void on_flush_occurred(EventView packet) { FlushOccurredView flush_occurred_view = FlushOccurredView::Create(packet); if (!flush_occurred_view.IsValid()) { LOG_ERROR("Received on_flush_occurred with invalid packet"); Loading @@ -518,7 +518,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnReadRemoteVersionInformationComplete(version, manufacturer_name, sub_version); } void on_read_remote_supported_features_complete(EventPacketView packet) { void on_read_remote_supported_features_complete(EventView packet) { auto view = ReadRemoteSupportedFeaturesCompleteView::Create(packet); ASSERT_LOG(view.IsValid(), "Read remote supported features packet invalid"); uint16_t handle = view.GetConnectionHandle(); Loading @@ -531,7 +531,7 @@ struct classic_impl : public security::ISecurityManagerListener { callbacks->OnReadRemoteExtendedFeaturesComplete(0, 1, view.GetLmpFeatures()); } void on_read_remote_extended_features_complete(EventPacketView packet) { void on_read_remote_extended_features_complete(EventView packet) { auto view = ReadRemoteExtendedFeaturesCompleteView::Create(packet); ASSERT_LOG(view.IsValid(), "Read remote extended features packet invalid"); uint16_t handle = view.GetConnectionHandle(); Loading @@ -545,7 +545,7 @@ struct classic_impl : public security::ISecurityManagerListener { view.GetPageNumber(), view.GetMaximumPageNumber(), view.GetExtendedLmpFeatures()); } void on_link_supervision_timeout_changed(EventPacketView packet) { void on_link_supervision_timeout_changed(EventView packet) { auto view = LinkSupervisionTimeoutChangedView::Create(packet); ASSERT_LOG(view.IsValid(), "Link supervision timeout changed packet invalid"); LOG_INFO("UNIMPLEMENTED called"); Loading
system/gd/hci/acl_manager_test.cc +7 −8 Original line number Diff line number Diff line Loading @@ -191,8 +191,7 @@ class TestHciLayer : public HciLayer { return command; } void RegisterEventHandler(EventCode event_code, common::ContextualCallback<void(EventPacketView)> event_handler) override { void RegisterEventHandler(EventCode event_code, common::ContextualCallback<void(EventView)> event_handler) override { registered_events_[event_code] = event_handler; } Loading @@ -209,9 +208,9 @@ class TestHciLayer : public HciLayer { registered_le_events_.erase(subevent_code); } void IncomingEvent(std::unique_ptr<EventPacketBuilder> event_builder) { void IncomingEvent(std::unique_ptr<EventBuilder> event_builder) { auto packet = GetPacketView(std::move(event_builder)); EventPacketView event = EventPacketView::Create(packet); EventView event = EventView::Create(packet); ASSERT_TRUE(event.IsValid()); EventCode event_code = event.GetEventCode(); ASSERT_NE(registered_events_.find(event_code), registered_events_.end()) << EventCodeText(event_code); Loading @@ -220,7 +219,7 @@ class TestHciLayer : public HciLayer { void IncomingLeMetaEvent(std::unique_ptr<LeMetaEventBuilder> event_builder) { auto packet = GetPacketView(std::move(event_builder)); EventPacketView event = EventPacketView::Create(packet); EventView event = EventView::Create(packet); LeMetaEventView meta_event_view = LeMetaEventView::Create(event); EXPECT_TRUE(meta_event_view.IsValid()); SubeventCode subevent_code = meta_event_view.GetSubeventCode(); Loading Loading @@ -252,14 +251,14 @@ class TestHciLayer : public HciLayer { EXPECT_EQ(queue_end->TryDequeue(), nullptr); } void CommandCompleteCallback(EventPacketView event) { void CommandCompleteCallback(EventView event) { CommandCompleteView complete_view = CommandCompleteView::Create(event); ASSERT_TRUE(complete_view.IsValid()); std::move(command_complete_callbacks.front()).Invoke(complete_view); command_complete_callbacks.pop_front(); } void CommandStatusCallback(EventPacketView event) { void CommandStatusCallback(EventView event) { CommandStatusView status_view = CommandStatusView::Create(event); ASSERT_TRUE(status_view.IsValid()); std::move(command_status_callbacks.front()).Invoke(status_view); Loading Loading @@ -293,7 +292,7 @@ class TestHciLayer : public HciLayer { } private: std::map<EventCode, common::ContextualCallback<void(EventPacketView)>> registered_events_; std::map<EventCode, common::ContextualCallback<void(EventView)>> registered_events_; std::map<SubeventCode, common::ContextualCallback<void(LeMetaEventView)>> registered_le_events_; std::list<common::ContextualOnceCallback<void(CommandCompleteView)>> command_complete_callbacks; std::list<common::ContextualOnceCallback<void(CommandStatusView)>> command_status_callbacks; Loading