diff --git a/pw_bluetooth_sapphire/host/gap/bredr_connection_manager.cc b/pw_bluetooth_sapphire/host/gap/bredr_connection_manager.cc index 370369b4e7..92b5d584ca 100644 --- a/pw_bluetooth_sapphire/host/gap/bredr_connection_manager.cc +++ b/pw_bluetooth_sapphire/host/gap/bredr_connection_manager.cc @@ -1552,23 +1552,25 @@ BrEdrConnectionManager::OnUserConfirmationRequest( } hci::CommandChannel::EventCallbackResult -BrEdrConnectionManager::OnUserPasskeyRequest(const hci::EventPacket& event) { - BT_DEBUG_ASSERT(event.event_code() == hci_spec::kUserPasskeyRequestEventCode); - const auto& params = event.params(); +BrEdrConnectionManager::OnUserPasskeyRequest( + const hci::EmbossEventPacket& event_packet) { + auto params = + event_packet.view(); + DeviceAddressBytes bd_addr = DeviceAddressBytes(params.bd_addr()); - auto conn_pair = FindConnectionByAddress(params.bd_addr); + auto conn_pair = FindConnectionByAddress(bd_addr); if (!conn_pair) { bt_log(WARN, "gap-bredr", "got %s for unconnected addr %s", __func__, - bt_str(params.bd_addr)); - SendUserPasskeyRequestNegativeReply(params.bd_addr); + bt_str(bd_addr)); + SendUserPasskeyRequestNegativeReply(bd_addr); return hci::CommandChannel::EventCallbackResult::kContinue; } - auto passkey_cb = [self = weak_self_.GetWeakPtr(), bd_addr = params.bd_addr]( - std::optional passkey) { + auto passkey_cb = [self = weak_self_.GetWeakPtr(), + bd_addr](std::optional passkey) { if (!self.is_alive()) { return; } diff --git a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/gap/bredr_connection_manager.h b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/gap/bredr_connection_manager.h index 5b45419001..29024d81b0 100644 --- a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/gap/bredr_connection_manager.h +++ b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/gap/bredr_connection_manager.h @@ -286,7 +286,7 @@ class BrEdrConnectionManager final { hci::CommandChannel::EventCallbackResult OnUserConfirmationRequest( const hci::EmbossEventPacket& event_packet); hci::CommandChannel::EventCallbackResult OnUserPasskeyRequest( - const hci::EventPacket& event); + const hci::EmbossEventPacket& event_packet); hci::CommandChannel::EventCallbackResult OnUserPasskeyNotification( const hci::EventPacket& event); hci::CommandChannel::EventCallbackResult OnRoleChange( diff --git a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/hci-spec/protocol.h b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/hci-spec/protocol.h index 379f1cb391..56db1d8cbb 100644 --- a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/hci-spec/protocol.h +++ b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/hci-spec/protocol.h @@ -925,11 +925,6 @@ constexpr EventCode kUserConfirmationRequestEventCode = 0x33; // User Passkey Request Event (v2.1 + EDR) (BR/EDR) constexpr EventCode kUserPasskeyRequestEventCode = 0x34; -struct UserPasskeyRequestEventParams { - // Address of the device involved in simple pairing process - DeviceAddressBytes bd_addr; -} __attribute__((packed)); - // =================================================== // Simple Pairing Complete Event (v2.1 + EDR) (BR/EDR) constexpr EventCode kSimplePairingCompleteEventCode = 0x36;