tBTM_STATUS BTM_SetBleDataLength(const RawAddress& bd_addr,
uint16_t tx_pdu_length) {
+ if (!controller_get_interface()->supports_ble_packet_extension()) {
+ LOG_INFO("Local controller unable to support le packet extension");
+ return BTM_ILLEGAL_VALUE;
+ }
+
+ if (tx_pdu_length > BTM_BLE_DATA_SIZE_MAX)
+ tx_pdu_length = BTM_BLE_DATA_SIZE_MAX;
+ else if (tx_pdu_length < BTM_BLE_DATA_SIZE_MIN)
+ tx_pdu_length = BTM_BLE_DATA_SIZE_MIN;
+
+ uint16_t tx_time = BTM_BLE_DATA_TX_TIME_MAX_LEGACY;
+
+ if (controller_get_interface()->get_bt_version()->hci_version >=
+ HCI_PROTO_VERSION_5_0)
+ tx_time = BTM_BLE_DATA_TX_TIME_MAX;
+
if (bluetooth::shim::is_gd_shim_enabled()) {
return bluetooth::shim::BTM_SetBleDataLength(bd_addr, tx_pdu_length);
}
- uint16_t tx_time = BTM_BLE_DATA_TX_TIME_MAX_LEGACY;
if (!BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE)) {
LOG_INFO(
return BTM_WRONG_MODE;
}
- if (!controller_get_interface()->supports_ble_packet_extension()) {
- LOG_INFO("Local controller unable to support le packet extension");
- return BTM_ILLEGAL_VALUE;
- }
-
uint16_t hci_handle = acl_get_hci_handle_for_hcif(bd_addr, BT_TRANSPORT_LE);
if (!acl_peer_supports_ble_packet_extension(hci_handle)) {
return BTM_ILLEGAL_VALUE;
}
- if (tx_pdu_length > BTM_BLE_DATA_SIZE_MAX)
- tx_pdu_length = BTM_BLE_DATA_SIZE_MAX;
- else if (tx_pdu_length < BTM_BLE_DATA_SIZE_MIN)
- tx_pdu_length = BTM_BLE_DATA_SIZE_MIN;
-
- 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(hci_handle, tx_pdu_length, tx_time);
return BTM_SUCCESS;