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

Commit 0117404b authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge changes I64ce6648,Ia8a3e680

* changes:
  Use logic operator to caculate the logical result
  Delete unused hci event buffer in hci_layer.cc
parents 18444503 9dcb5617
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -318,7 +318,8 @@ class PairingHandlerLe {

  std::optional<PairingEvent> WaitUiPairingAccept() {
    PairingEvent e = WaitForEvent();
    if (e.type == PairingEvent::UI & e.ui_action == PairingEvent::PAIRING_ACCEPTED) {
    if (e.type == PairingEvent::UI &&
        e.ui_action == PairingEvent::PAIRING_ACCEPTED) {
      return e;
    } else {
      return std::nullopt;
@@ -327,7 +328,8 @@ class PairingHandlerLe {

  std::optional<PairingEvent> WaitUiConfirmYesNo() {
    PairingEvent e = WaitForEvent();
    if (e.type == PairingEvent::UI & e.ui_action == PairingEvent::CONFIRM_YESNO) {
    if (e.type == PairingEvent::UI &&
        e.ui_action == PairingEvent::CONFIRM_YESNO) {
      return e;
    } else {
      return std::nullopt;
@@ -362,7 +364,8 @@ class PairingHandlerLe {
      e = WaitForEvent();
    }

    if (e.type == PairingEvent::UI & e.ui_action == PairingEvent::PASSKEY) {
    if (e.type == PairingEvent::UI &&
        e.ui_action == PairingEvent::PASSKEY) {
      return e;
    } else {
      return std::nullopt;
+0 −1
Original line number Diff line number Diff line
@@ -335,7 +335,6 @@ void OnTransmitPacketCommandComplete(command_complete_cb complete_callback,
                                     bluetooth::hci::CommandCompleteView view) {
  LOG_DEBUG("Received cmd complete for %s",
            bluetooth::hci::OpCodeText(view.GetCommandOpCode()).c_str());
  std::vector<uint8_t> data(view.begin(), view.end());
  BT_HDR* response = WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &view);
  complete_callback(response, context);
}