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

Commit 3d3fe73c authored by Hsin-chen Chuang's avatar Hsin-chen Chuang Committed by Automerger Merge Worker
Browse files

BTM: RNR: Validate page scan repetition mode before send out a request am: 77a3afc9

parents aea4aa39 77a3afc9
Loading
Loading
Loading
Loading
+13 −3
Original line number Original line Diff line number Diff line
@@ -1891,9 +1891,19 @@ tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda,
          clock_offset = clock_offset_in_cfg;
          clock_offset = clock_offset_in_cfg;
        }
        }
      }
      }
      bluetooth::shim::ACL_RemoteNameRequest(
      uint8_t page_scan_rep_mode = p_cur->results.page_scan_rep_mode;
          remote_bda, p_cur->results.page_scan_rep_mode,
      if (com::android::bluetooth::flags::
          p_cur->results.page_scan_mode, clock_offset);
              rnr_validate_page_scan_repetition_mode() &&
          page_scan_rep_mode >= HCI_PAGE_SCAN_REP_MODE_RESERVED_START) {
        log::info(
            "Invalid page scan repetition mode {} from remote_bda:{}, "
            "fallback to R1",
            page_scan_rep_mode, remote_bda);
        page_scan_rep_mode = HCI_PAGE_SCAN_REP_MODE_R1;
      }
      bluetooth::shim::ACL_RemoteNameRequest(remote_bda, page_scan_rep_mode,
                                             p_cur->results.page_scan_mode,
                                             clock_offset);
    } else {
    } else {
      uint16_t clock_offset = 0;
      uint16_t clock_offset = 0;
      int clock_offset_in_cfg = 0;
      int clock_offset_in_cfg = 0;
+1 −0
Original line number Original line Diff line number Diff line
@@ -708,6 +708,7 @@ typedef enum : uint16_t {


/* Page scan period modes */
/* Page scan period modes */
#define HCI_PAGE_SCAN_REP_MODE_R1 0x01
#define HCI_PAGE_SCAN_REP_MODE_R1 0x01
#define HCI_PAGE_SCAN_REP_MODE_RESERVED_START 0x03


/* Page scan modes */
/* Page scan modes */
#define HCI_MANDATARY_PAGE_SCAN_MODE 0x00
#define HCI_MANDATARY_PAGE_SCAN_MODE 0x00