ble:set a esp api to get size of controller send packets buffer.
This commit is contained in:
parent
74a89774fd
commit
ed6805625c
5 changed files with 14 additions and 5 deletions
|
@ -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
|
|
@ -45,7 +45,7 @@ extern "C" {
|
|||
extern esp_err_t esp_ble_gatt_set_local_mtu (uint16_t mtu);
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
extern uint16_t L2CA_GetFreePkgBufferNum(void);
|
||||
extern uint16_t esp_ble_get_sendable_packets_num (void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1873,7 +1873,7 @@ BOOLEAN L2CA_CheckIsCongest(UINT16 fixed_cid, UINT16 handle)
|
|||
}
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
UINT16 L2CA_GetFreePkgBufferNum(void)
|
||||
UINT16 L2CA_GetFreePktBufferNum_LE(void)
|
||||
{
|
||||
return l2cb.controller_le_xmit_window;
|
||||
}
|
||||
|
|
|
@ -504,7 +504,7 @@ static void throughput_client_task(void *param)
|
|||
assert(res == pdTRUE);
|
||||
} else {
|
||||
if (is_connect) {
|
||||
int free_buff_num = L2CA_GetFreePkgBufferNum();
|
||||
int free_buff_num = esp_ble_get_sendable_packets_num();
|
||||
if(free_buff_num > 0) {
|
||||
for( ; free_buff_num > 0; free_buff_num--) {
|
||||
// the app data set to 490 just for divided into two packages to send in the low layer
|
||||
|
|
|
@ -624,7 +624,7 @@ void throughput_server_task(void *param)
|
|||
assert(res == pdTRUE);
|
||||
} else {
|
||||
if (is_connect) {
|
||||
int free_buff_num = L2CA_GetFreePkgBufferNum();
|
||||
int free_buff_num = esp_ble_get_sendable_packets_num();
|
||||
if(free_buff_num > 0) {
|
||||
for( ; free_buff_num > 0; free_buff_num--) {
|
||||
esp_ble_gatts_send_indicate(gl_profile_tab[PROFILE_A_APP_ID].gatts_if, gl_profile_tab[PROFILE_A_APP_ID].conn_id,
|
||||
|
|
Loading…
Reference in a new issue