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

Commit 8ba1b856 authored by Prabhu MC's avatar Prabhu MC
Browse files

Add system property for BT page scan interval

Bug: 278173488
Test: Manually run BT tests
Change-Id: Icde9fcc22db98f9bfe38a92314a83c7286f5fa1a
parent cb1d20f4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@
#ifndef BTM_DEFAULT_CONN_INTERVAL
#define BTM_DEFAULT_CONN_INTERVAL 0x0400
#endif
#define BTM_PAGE_SCAN_INTERVAL_PROPERTY "bluetooth.btm.pagescan_interval"

/* When automatic inquiry scan is enabled, this sets the inquiry scan window. */
#ifndef BTM_DEFAULT_DISC_WINDOW
+7 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include "main/shim/stack.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"  // UNUSED_ATTR
#include "osi/include/properties.h"
#include "stack/btm/btm_ble_int.h"
#include "stack/btm/btm_int_types.h"
#include "stack/btm/btm_sec.h"
@@ -765,7 +766,12 @@ tBTM_STATUS bluetooth::shim::BTM_SetConnectability(uint16_t page_mode,
  uint16_t le_connectible_mode = page_mode >> 8;

  if (!window) window = BTM_DEFAULT_CONN_WINDOW;
  if (!interval) interval = BTM_DEFAULT_CONN_INTERVAL;
  if (!interval) {
    interval = (uint16_t)osi_property_get_int32(BTM_PAGE_SCAN_INTERVAL_PROPERTY,
                                                BTM_DEFAULT_CONN_INTERVAL);
  }
  LOG_INFO("shim::BTM_SetConnectability page scan interval = (%d * 0.625)ms",
           interval);

  switch (le_connectible_mode) {
    case kConnectibleModeOff:
+5 −2
Original line number Diff line number Diff line
@@ -409,10 +409,13 @@ tBTM_STATUS BTM_SetConnectability(uint16_t page_mode) {

  uint8_t scan_mode = 0;
  uint16_t window = BTM_DEFAULT_CONN_WINDOW;
  uint16_t interval = BTM_DEFAULT_CONN_INTERVAL;
  uint16_t interval = (uint16_t)osi_property_get_int32(
      BTM_PAGE_SCAN_INTERVAL_PROPERTY, BTM_DEFAULT_CONN_INTERVAL);

  tBTM_INQUIRY_VAR_ST* p_inq = &btm_cb.btm_inq_vars;

  BTM_TRACE_API("BTM_SetConnectability");
  BTM_TRACE_API("BTM_SetConnectability page scan interval  = (%d * 0.625)ms",
                interval);

  if (controller_get_interface()->supports_ble()) {
    if (btm_ble_set_connectability(page_mode) != BTM_SUCCESS) {