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

Commit ec49a61e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Use appropriate Tx time in BLE Set Data length command"

parents 5d00aa3a 7ed45080
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 {