Skip to content

Commit 06a69d2

Browse files
committed
Use include instead of defining btInUse function
1 parent b425a1a commit 06a69d2

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/NimBLEDevice.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454

5555
# if defined(ESP_PLATFORM) && defined(CONFIG_ENABLE_ARDUINO_DEPENDS)
5656
# include "esp32-hal-bt.h"
57+
# if __has_include("esp32-hal-bt-mem.h")
58+
# include "esp32-hal-bt-mem.h"
59+
# endif
5760
# endif
5861

5962
# include "NimBLELog.h"
@@ -909,7 +912,8 @@ bool NimBLEDevice::init(const std::string& deviceName) {
909912
bt_cfg.mode = ESP_BT_MODE_BLE;
910913
bt_cfg.ble_max_conn = MYNEWT_VAL(BLE_MAX_CONNECTIONS);
911914
# elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
912-
bt_cfg.ble_max_act = MYNEWT_VAL(BLE_MAX_CONNECTIONS) + MYNEWT_VAL(BLE_ROLE_BROADCASTER) + MYNEWT_VAL(BLE_ROLE_OBSERVER);
915+
bt_cfg.ble_max_act =
916+
MYNEWT_VAL(BLE_MAX_CONNECTIONS) + MYNEWT_VAL(BLE_ROLE_BROADCASTER) + MYNEWT_VAL(BLE_ROLE_OBSERVER);
913917
# else
914918
bt_cfg.nimble_max_connections = MYNEWT_VAL(BLE_MAX_CONNECTIONS);
915919
# endif
@@ -1290,13 +1294,13 @@ bool NimBLEDevice::injectConfirmPasskey(const NimBLEConnInfo& peerInfo, bool acc
12901294
* @param [in] deviceName The name to set.
12911295
*/
12921296
bool NimBLEDevice::setDeviceName(const std::string& deviceName) {
1293-
#if !defined(MYNEWT_VAL_BLE_GATTS) || MYNEWT_VAL(BLE_GATTS) > 0
1297+
# if !defined(MYNEWT_VAL_BLE_GATTS) || MYNEWT_VAL(BLE_GATTS) > 0
12941298
int rc = ble_svc_gap_device_name_set(deviceName.c_str());
12951299
if (rc != 0) {
12961300
NIMBLE_LOGE(LOG_TAG, "Device name not set - too long");
12971301
return false;
12981302
}
1299-
#endif
1303+
# endif
13001304
return true;
13011305
} // setDeviceName
13021306

@@ -1348,10 +1352,4 @@ int NimBLEDeviceCallbacks::onStoreStatus(struct ble_store_status_event* event, v
13481352
return ble_store_util_status_rr(event, arg);
13491353
}
13501354

1351-
# if defined(CONFIG_ENABLE_ARDUINO_DEPENDS) && SOC_BT_SUPPORTED
1352-
bool btInUse(void) {
1353-
return true;
1354-
}
1355-
# endif
1356-
13571355
#endif // CONFIG_BT_NIMBLE_ENABLED

0 commit comments

Comments
 (0)