mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-06 05:14:45 +00:00
nimble/host: Sync sending Host Number of Completed Packets command
Host Number of Completed Packets command is special as it doesn't generate status event and thus is not send with ble_hs_hci_cmd_tx. We should stil sync sending it with ble_hs_hci_cmd_tx() though to avoid requesting more than one command buffer from HCI transport (which may not be able to provide more).
This commit is contained in:
@@ -92,7 +92,7 @@ ble_hs_flow_tx_num_comp_pkts(void)
|
||||
* response from the controller, so don't use the normal blocking
|
||||
* HCI API when sending it.
|
||||
*/
|
||||
rc = ble_hs_hci_cmd_send_buf(
|
||||
rc = ble_hs_hci_cmd_tx_no_rsp(
|
||||
BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
|
||||
BLE_HCI_OCF_CB_HOST_NUM_COMP_PKTS),
|
||||
buf, sizeof(buf));
|
||||
|
||||
@@ -291,6 +291,20 @@ ble_hs_hci_wait_for_ack(void)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
ble_hs_hci_cmd_tx_no_rsp(uint16_t opcode, const void *cmd, uint8_t cmd_len)
|
||||
{
|
||||
int rc;
|
||||
|
||||
ble_hs_hci_lock();
|
||||
|
||||
rc = ble_hs_hci_cmd_send_buf(opcode, cmd, cmd_len);
|
||||
|
||||
ble_hs_hci_unlock();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
ble_hs_hci_cmd_tx(uint16_t opcode, const void *cmd, uint8_t cmd_len,
|
||||
void *rsp, uint8_t rsp_len)
|
||||
|
||||
@@ -81,6 +81,8 @@ struct hci_periodic_adv_params
|
||||
|
||||
extern uint16_t ble_hs_hci_avail_pkts;
|
||||
|
||||
/* This function is not waiting for command status/complete HCI events */
|
||||
int ble_hs_hci_cmd_tx_no_rsp(uint16_t opcode, const void *cmd, uint8_t cmd_len);
|
||||
int ble_hs_hci_cmd_tx(uint16_t opcode, const void *cmd, uint8_t cmd_len,
|
||||
void *rsp, uint8_t rsp_len);
|
||||
void ble_hs_hci_init(void);
|
||||
|
||||
Reference in New Issue
Block a user