Fix compilation issue in enabling BLE_HCI_VS flag

This commit is contained in:
Rahul Tank
2024-04-03 10:45:23 +05:30
parent e617a79507
commit 0d482c4ed0
2 changed files with 13 additions and 9 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ static const struct ble_hs_hci_evt_dispatch_entry ble_hs_hci_evt_dispatch[] = {
{ BLE_HCI_EVCODE_ENC_KEY_REFRESH, ble_hs_hci_evt_enc_key_refresh },
{ BLE_HCI_EVCODE_HW_ERROR, ble_hs_hci_evt_hw_error },
#if MYNEWT_VAL(BLE_HCI_VS)
{ BLE_HCI_EVCODE_VS, ble_hs_hci_evt_vs },
{ BLE_HCI_EVCODE_VS_DEBUG, ble_hs_hci_evt_vs },
#endif
};
@@ -322,7 +322,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_vs_debug *ev = data;
if (len < sizeof(*ev)) {
return BLE_HS_ECONTROLLER;
+11 -7
View File
@@ -27,12 +27,10 @@
static int
ble_hs_util_load_rand_addr(ble_addr_t *addr)
{
/* XXX: It is unfortunate that the function to retrieve the random address
* is in the controller package. A host-only device ought to be able to
* automically restore a random address.
*/
#if MYNEWT_VAL(BLE_CONTROLLER)
int rc;
int rc = BLE_HS_ENOADDR;
#if MYNEWT_VAL(BLE_HCI_VS)
struct ble_hci_vs_rd_static_addr_rp rsp;
rc = ble_hw_get_static_addr(addr);
if (rc == 0) {
@@ -40,7 +38,13 @@ ble_hs_util_load_rand_addr(ble_addr_t *addr)
}
#endif
return BLE_HS_ENOADDR;
#if SOC_ESP_NIMBLE_CONTROLLER
rc = esp_ble_hw_get_static_addr((esp_ble_addr_t *)addr);
if (rc == 0) {
return 0;
}
#endif
return rc;
}
static int