diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c index 288a93611..f145b5306 100644 --- a/nimble/host/src/ble_hs_hci_evt.c +++ b/nimble/host/src/ble_hs_hci_evt.c @@ -132,7 +132,7 @@ static const struct ble_hs_hci_evt_dispatch_entry ble_hs_hci_evt_dispatch[] = { { BLE_HCI_OCF_LE_RX_TEST_V2, ble_hs_hci_evt_rx_test }, { BLE_HCI_OCF_LE_TX_TEST_V2, ble_hs_hci_evt_tx_test }, #if MYNEWT_VAL(BLE_HCI_VS) - { BLE_HCI_EVCODE_VS, ble_hs_hci_evt_vs }, + { BLE_HCI_EVCODE_VENDOR_DEBUG, ble_hs_hci_evt_vs }, #endif }; @@ -367,7 +367,7 @@ ble_hs_hci_evt_num_completed_pkts(uint8_t event_code, const void *data, static int ble_hs_hci_evt_vs(uint8_t event_code, const void *data, unsigned int len) { - const struct ble_hci_ev_vs *ev = data; + const struct ble_hci_ev_vendor_debug *ev = data; if (len < sizeof(*ev)) { return BLE_HS_ECONTROLLER; diff --git a/nimble/host/util/src/addr.c b/nimble/host/util/src/addr.c index 90280991a..7684aa52b 100644 --- a/nimble/host/util/src/addr.c +++ b/nimble/host/util/src/addr.c @@ -28,9 +28,10 @@ static int ble_hs_util_load_rand_addr(ble_addr_t *addr) { + int rc = BLE_HS_ENOADDR; + #if MYNEWT_VAL(BLE_HCI_VS) struct ble_hci_vs_rd_static_addr_rp rsp; - int rc; rc = ble_hs_hci_cmd_tx(BLE_HCI_OP(BLE_HCI_OGF_VENDOR, BLE_HCI_OCF_VS_RD_STATIC_ADDR), @@ -43,14 +44,12 @@ ble_hs_util_load_rand_addr(ble_addr_t *addr) #endif #if SOC_ESP_NIMBLE_CONTROLLER - int rc; - rc = esp_ble_hw_get_static_addr((esp_ble_addr_t *)addr); if (rc == 0) { return 0; } #endif - return BLE_HS_ENOADDR; + return rc; } static int