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

Commit 7ed45080 authored by Subramanian Srinivasan's avatar Subramanian Srinivasan Committed by Andre Eisenbach
Browse files

Use appropriate Tx time in BLE Set Data length command

Fixes Tx time parameter in HCI LE set data length command
depending on HCI versions supported by controller.

Bug: 110373079
Change-Id: I83cc4c41ca4c2b6470ec30057717946b1d7fe329
parent 10b081fc
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -753,6 +753,7 @@ bool BTM_UseLeLink(const RawAddress& bd_addr) {
tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr,
                                 uint16_t tx_pdu_length) {
  tACL_CONN* p_acl = btm_bda_to_acl(bd_addr, BT_TRANSPORT_LE);
  uint16_t tx_time = BTM_BLE_DATA_TX_TIME_MAX_LEGACY;

  if (p_acl == NULL) {
    BTM_TRACE_ERROR("%s: Wrong mode: no LE link exist or LE not supported",
@@ -777,9 +778,10 @@ tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr,
  else if (tx_pdu_length < BTM_BLE_DATA_SIZE_MIN)
    tx_pdu_length = BTM_BLE_DATA_SIZE_MIN;

  /* always set the TxTime to be max, as controller does not care for now */
  btsnd_hcic_ble_set_data_length(p_acl->hci_handle, tx_pdu_length,
                                 BTM_BLE_DATA_TX_TIME_MAX);
  if (controller_get_interface()->get_bt_version()->hci_version >= HCI_PROTO_VERSION_5_0)
    tx_time = BTM_BLE_DATA_TX_TIME_MAX;

  btsnd_hcic_ble_set_data_length(p_acl->hci_handle, tx_pdu_length, tx_time);

  return BTM_SUCCESS;
}
+2 −1
Original line number Diff line number Diff line
@@ -335,7 +335,8 @@ typedef void(tBTM_RAND_ENC_CB)(tBTM_RAND_ENC* p1);
/*  Preferred maximum number of microseconds that the local Controller
    should use to transmit a single Link Layer Data Channel PDU. */
#define BTM_BLE_DATA_TX_TIME_MIN 0x0148
#define BTM_BLE_DATA_TX_TIME_MAX 0x0848
#define BTM_BLE_DATA_TX_TIME_MAX_LEGACY  0x0848
#define BTM_BLE_DATA_TX_TIME_MAX         0x4290

/* adv tx power in dBm */
typedef struct {