From 8d5c871596753da452b1cf56d28442660af0c599 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Sat, 6 Apr 2024 21:17:43 +0530 Subject: [PATCH] nimble: Fix compilation issues when CCCD is set to 0 --- nimble/host/store/config/src/ble_store_nvs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nimble/host/store/config/src/ble_store_nvs.c b/nimble/host/store/config/src/ble_store_nvs.c index 33a9349e4..8ae391e4c 100644 --- a/nimble/host/store/config/src/ble_store_nvs.c +++ b/nimble/host/store/config/src/ble_store_nvs.c @@ -530,6 +530,7 @@ ble_nvs_restore_sec_keys(void) extern uint16_t ble_store_config_peer_bond_count; extern int ble_store_config_compare_bond_count(const void *a, const void *b); +#if MYNEWT_VAL(BLE_STORE_MAX_BONDS) err = populate_db_from_nvs(BLE_STORE_OBJ_TYPE_OUR_SEC, ble_store_config_our_secs, &ble_store_config_num_our_secs); if (err != ESP_OK) { @@ -567,7 +568,9 @@ ble_nvs_restore_sec_keys(void) ESP_LOGD(TAG, "ble_store_config_peer_secs restored %d bonds", ble_store_config_num_peer_secs); +#endif +#if MYNEWT_VAL(BLE_STORE_MAX_CCCDS) err = populate_db_from_nvs(BLE_STORE_OBJ_TYPE_CCCD, ble_store_config_cccds, &ble_store_config_num_cccds); if (err != ESP_OK) { @@ -576,6 +579,7 @@ ble_nvs_restore_sec_keys(void) } ESP_LOGD(TAG, "ble_store_config_cccds restored %d bonds", ble_store_config_num_cccds); +#endif #if MYNEWT_VAL(ENC_ADV_DATA) err = populate_db_from_nvs(BLE_STORE_OBJ_TYPE_EAD, ble_store_config_eads, @@ -630,6 +634,7 @@ ble_nvs_restore_peer_records(void) } #endif +#if MYNEWT_VAL(BLE_STORE_MAX_CCCDS) int ble_store_config_persist_cccds(void) { int nvs_count, nvs_idx; @@ -660,6 +665,7 @@ int ble_store_config_persist_cccds(void) } return 0; } +#endif #if MYNEWT_VAL(ENC_ADV_DATA) int ble_store_config_persist_eads(void)