Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbf8aac8 authored by Martin Brabham's avatar Martin Brabham Committed by Automerger Merge Worker
Browse files

SM: Fix event order logic for Classic Pairing am: b94b1fd3

Change-Id: I08dec30ce1e55d9de9517080b057b2aec2906489
parents 4a67117f b94b1fd3
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -131,8 +131,6 @@ void ClassicPairingHandler::OnReceive(hci::LinkKeyNotificationView packet) {
  LOG_INFO("Received: %s", hci::EventCodeText(packet.GetEventCode()).c_str());
  ASSERT_LOG(GetRecord()->GetPseudoAddress().GetAddress() == packet.GetBdAddr(), "Address mismatch");
  GetRecord()->SetLinkKey(packet.GetLinkKey(), packet.GetKeyType());
  // We are done with the pairing flow
  Cancel();
}

void ClassicPairingHandler::OnReceive(hci::IoCapabilityRequestView packet) {
@@ -164,8 +162,8 @@ void ClassicPairingHandler::OnReceive(hci::SimplePairingCompleteView packet) {
  if (last_status_ != hci::ErrorCode::SUCCESS) {
    LOG_INFO("Failed SimplePairingComplete: %s", hci::ErrorCodeText(last_status_).c_str());
    // Cancel here since we won't get LinkKeyNotification
    Cancel();
  }
  Cancel();
}

void ClassicPairingHandler::OnReceive(hci::ReturnLinkKeysView packet) {
+1 −1
Original line number Diff line number Diff line
@@ -182,8 +182,8 @@ class ClassicPairingHandlerTest : public ::testing::Test {
//  <- IoCapabilityResponse
//  <- UserConfirmationRequest
//  -> UserConfirmationRequestReply (auto)
//  <- SimplePairingComplete
//  <- LinkKeyNotification
//  <- SimplePairingComplete
//  <- AuthenticationComplete
//  -> SetConnectionEncryption
//  <- EncryptionChange