fix(nimble): Address compilation issues in nimble examples

This commit is contained in:
Rahul Tank
2025-10-29 21:17:39 +05:30
parent 23f2b30ccb
commit b89bf2dcc6
31 changed files with 112 additions and 31 deletions
+1 -1
View File
@@ -568,7 +568,7 @@ menu "BLE 5.x Features"
config BT_NIMBLE_EXT_SCAN
bool "Enable extended scanning"
depends on BT_NIMBLE_50_FEATURE_SUPPORT && BT_NIMBLE_ROLE_OBSERVER
depends on BT_NIMBLE_50_FEATURE_SUPPORT
default y
help
Enable this option to do extended scanning.
@@ -1819,9 +1819,11 @@
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME
#endif
#if CONFIG_BT_NIMBLE_GAP_SERVICE
#ifndef MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN // According to the specification, the maximum length should be 248
#endif
#endif
#ifndef MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM
#if CONFIG_BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -545,6 +545,7 @@ static int simple_ble_start(const simple_ble_cfg_t *cfg)
ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
#if MYNEWT_VAL(BLE_GATTS)
rc = gatt_svr_init(cfg);
if (rc != 0) {
ESP_LOGE(TAG, "Error initializing GATT server");
@@ -563,6 +564,7 @@ static int simple_ble_start(const simple_ble_cfg_t *cfg)
resp_data.name_len = strlen(ble_svc_gap_device_name());
resp_data.name_is_complete = 1;
}
#endif
/* Set manufacturer data if protocomm_ble_mfg_data points to valid data */
if (protocomm_ble_mfg_data != NULL) {