diff --git a/nimble/host/src/ble_hs_hci.c b/nimble/host/src/ble_hs_hci.c index a10991ada..59dda4f6e 100644 --- a/nimble/host/src/ble_hs_hci.c +++ b/nimble/host/src/ble_hs_hci.c @@ -105,7 +105,7 @@ #define BLE_ERR_MAX 0xff struct err_code { - int code; + int error_code; char *msg; }; @@ -179,20 +179,26 @@ static struct err_code err_code_list[] = { { BLE_HS_HCI_ERR(BLE_ERR_MAX), ": BLE_ERR_MAX"} }; -static void esp_hci_err_to_name(int code) +static void esp_hci_err_to_name(int error_code, uint16_t *opcode) { - if (code == 0) { + if (error_code == 0) { return; } - else if (code - 0x200 < 0) { + else if (error_code - 0x200 < 0) { /* Converts error code to HCI base */ - code = BLE_HS_HCI_ERR(code); + error_code = BLE_HS_HCI_ERR(error_code); } for (int i = 0; i