fix(ble/bluedroid): preserve HCI status on BLE 4.2 GAP failures

Return BTM_HCI_ERROR | hci_status from legacy BLE 4.2 GAP HCI command
paths instead of mapping failures to BTM_ILLEGAL_VALUE or
BTM_NO_RESOURCES. Add btm_ble_status_from_hci() helper and propagate
real status through scan start/stop completion callbacks.
This commit is contained in:
zhanghaipeng
2026-06-17 11:37:39 +08:00
parent 902a849e7f
commit 47dd785a18
5 changed files with 69 additions and 41 deletions
@@ -1327,12 +1327,8 @@ void btm_ble_set_channels_complete (UINT8 *p)
case HCI_SUCCESS:
cb_params.set_channels.status = BTM_SUCCESS;
break;
case HCI_ERR_UNSUPPORTED_VALUE:
case HCI_ERR_ILLEGAL_PARAMETER_FMT:
cb_params.set_channels.status = BTM_ILLEGAL_VALUE;
break;
default:
cb_params.set_channels.status = BTM_ERR_PROCESSING;
cb_params.set_channels.status = BTM_HCI_ERROR | cb_params.set_channels.hci_status;
break;
}
BTM_LegacyBleCallbackTrigger(BTM_BLE_LEGACY_GAP_SET_CHANNELS_COMPLETE_EVT, &cb_params);