fix(ble/bluedroid): unblock sync HCI cmd on Command Status error

Release the BLE sync semaphore and record HCI status when a
synchronous command is rejected via Command Status, since no
Command Complete event follows.


(cherry picked from commit 29ae92f4ef)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
Zhang Hai Peng
2026-06-26 20:16:43 +08:00
parent 989a673a6f
commit 4e8432580a
2 changed files with 17 additions and 0 deletions
@@ -1834,6 +1834,11 @@ static void btu_hcif_command_status_evt(uint8_t status, BT_HDR *command, void *c
{
BT_HDR *event = osi_calloc(sizeof(BT_HDR) + sizeof(command_status_hack_t));
command_status_hack_t *hack = (command_status_hack_t *)&event->data[0];
#if ((BLE_50_FEATURE_SUPPORT == TRUE) || (BLE_42_FEATURE_SUPPORT == TRUE))
if (status != HCI_SUCCESS) {
btsnd_hci_ble_set_status(status);
}
#endif // #if ((BLE_50_FEATURE_SUPPORT == TRUE) || (BLE_42_FEATURE_SUPPORT == TRUE))
hack->callback = btu_hcif_command_status_evt_on_task;
hack->status = status;