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

Commit 496abab9 authored by Yun-Hao Chung's avatar Yun-Hao Chung Committed by Yun-hao Chung
Browse files

Floss: Make inquiry length configurable in sysprop

For some chipset, we observed that it has lower performance in the
default inquiry parameters. This change allows Floss to configure
different parameters in different boards.

Bug: 320223219
Test: manually update /var/lib/bluetooth/sysprop.conf and verify the
inquiry length is changed accordingly
Tag: #floss
Test: mma -j
Flag: EXEMPT floss only changes

Change-Id: I5b98970812512a82439e8998ff25169c24c6096c
parent cae7c96d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ void SyspropsModule::parse_config(std::string file_path) {
      "bluetooth.core.classic.inq_scan_type",
      "bluetooth.core.classic.inq_scan_interval",
      "bluetooth.core.classic.inq_scan_window",
      "bluetooth.core.classic.inq_length",
      "bluetooth.core.acl.link_supervision_timeout",
      "bluetooth.core.classic.page_timeout",
      "bluetooth.core.classic.sniff_max_intervals",
+8 −1
Original line number Diff line number Diff line
@@ -163,6 +163,10 @@ using bluetooth::Uuid;

#define BTIF_DM_DEFAULT_INQ_MAX_DURATION 10

#ifndef PROPERTY_INQ_LENGTH
#define PROPERTY_INQ_LENGTH "bluetooth.core.classic.inq_length"
#endif

/******************************************************************************/
/*               L O C A L    D A T A    D E F I N I T I O N S                */
/******************************************************************************/
@@ -632,12 +636,15 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
                               ? ""
                               : "ERROR Already in progress"));

  const uint8_t inq_length = osi_property_get_int32(
      PROPERTY_INQ_LENGTH, BTIF_DM_DEFAULT_INQ_MAX_DURATION);

  /* Save the inquiry parameters to be used upon the completion of
   * setting/clearing the inquiry filter */
  btm_cb.btm_inq_vars.inqparms = {
      // tBTM_INQ_PARMS
      .mode = BTM_GENERAL_INQUIRY | BTM_BLE_GENERAL_INQUIRY,
      .duration = BTIF_DM_DEFAULT_INQ_MAX_DURATION,
      .duration = inq_length,
  };

  /* Initialize the inquiry variables */