example/ble_throughput:

Fixed the throughput wasting memory and packet loss issues.
Fixed the throughput crash bug because of using the Mutex.
This commit is contained in:
gengyuchao
2020-02-20 17:59:40 +08:00
parent da19c94976
commit 4643ca6ef8
5 changed files with 89 additions and 35 deletions

View File

@@ -46,4 +46,13 @@ esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu)
arg.set_mtu.mtu = mtu;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatt_com_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
}
#if (BLE_INCLUDED == TRUE)
extern uint16_t L2CA_GetFreePktBufferNum_LE(void);
uint16_t esp_ble_get_sendable_packets_num ()
{
return L2CA_GetFreePktBufferNum_LE();
}
#endif

View File

@@ -44,6 +44,10 @@ extern "C" {
*/
extern esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu);
#if (BLE_INCLUDED == TRUE)
extern uint16_t esp_ble_get_sendable_packets_num (void);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -1871,6 +1871,14 @@ BOOLEAN L2CA_CheckIsCongest(UINT16 fixed_cid, UINT16 handle)
return TRUE;
}
#if (BLE_INCLUDED == TRUE)
UINT16 L2CA_GetFreePktBufferNum_LE(void)
{
return l2cb.controller_le_xmit_window;
}
#endif
/*******************************************************************************
**
** Function L2CA_RemoveFixedChnl