protocomm: Fix Kconfig dependency on wifi_provisioning component config

- `protocomm` depends on a config option `CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION`
  from `wifi_provisioning`; however, a lower layer component (`protocomm`) should
  not have any `#ifdef` guard dependent on an upper layer component (`wifi_provisioning`).
- Added a new `ble_link_encryption` flag in `protocomm_ble_config_t` to manage the same

Closes https://github.com/espressif/esp-idf/issues/9443
This commit is contained in:
Laukik Hase
2022-10-26 10:30:16 +05:30
parent 91c25b519c
commit 7759079362
4 changed files with 26 additions and 12 deletions

View File

@@ -38,14 +38,17 @@ static esp_err_t prov_start(protocomm_t *pc, void *config)
protocomm_ble_config_t *ble_config = (protocomm_ble_config_t *) config;
#if defined(CONFIG_WIFI_PROV_BLE_BONDING)
#if defined(CONFIG_WIFI_PROV_BLE_BONDING)
ble_config->ble_bonding = 1;
#endif
#endif
#if defined(CONFIG_WIFI_PROV_BLE_SEC_CONN) || defined(CONFIG_BT_BLUEDROID_ENABLED)
ble_config->ble_sm_sc = 1;
#endif
#if defined(CONFIG_WIFI_PROV_BLE_SEC_CONN) || defined(CONFIG_BT_BLUEDROID_ENABLED)
ble_config->ble_sm_sc = 1;
#endif
#if defined(CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION)
ble_config->ble_link_encryption = 1;
#endif
/* Start protocomm as BLE service */
if (protocomm_ble_start(pc, ble_config) != ESP_OK) {
ESP_LOGE(TAG, "Failed to start protocomm BLE service");