From 4ae582b3cc161c8c36f3a72a5cec5b31ab882982 Mon Sep 17 00:00:00 2001 From: h2zero Date: Sun, 15 Dec 2024 10:38:11 -0700 Subject: [PATCH] Add missing NimBLEUtils and NimBLEConnInfo includes to NimBLEDevice.h In some cases compilation of examples would fail due to missing these headers so they should be included in NimBLEDevice.h --- CHANGELOG.md | 5 ++++- src/NimBLEDescriptor.h | 11 +++-------- src/NimBLEDevice.h | 6 ++++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87ffcbaf..a0661865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file. ## Fixed - `NimBLEHIDDevice::getOutputReport` will now return the correct characteristic. -- Compile error when central is disabled. +- Compile error when central is disabled, class `NimBLEServer` has no member named `m_pClient`. + +## Changed +- Added missing includes for `NimBLEConnInfo` and `NimBLEUtils` to `NimBLEDevice.h`. ## [2.0.0] 2024-12-14 diff --git a/src/NimBLEDescriptor.h b/src/NimBLEDescriptor.h index bb9b37a6..b4bcd38f 100644 --- a/src/NimBLEDescriptor.h +++ b/src/NimBLEDescriptor.h @@ -21,17 +21,12 @@ #include "nimconfig.h" #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL) -class NimBLEDescriptor; -class NimBLEDescriptorCallbacks; - # include "NimBLELocalValueAttribute.h" -# include "NimBLECharacteristic.h" -# include "NimBLEUUID.h" -# include "NimBLEAttValue.h" -# include "NimBLEConnInfo.h" - # include +class NimBLECharacteristic; +class NimBLEDescriptorCallbacks; + /** * @brief A model of a BLE descriptor. */ diff --git a/src/NimBLEDevice.h b/src/NimBLEDevice.h index 8399b22a..8ad17eec 100644 --- a/src/NimBLEDevice.h +++ b/src/NimBLEDevice.h @@ -282,5 +282,11 @@ class NimBLEDevice { # endif # endif +# if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL) || defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL) +# include "NimBLEConnInfo.h" +# endif + +# include "NimBLEUtils.h" + #endif // CONFIG_BT_ENABLED #endif // NIMBLE_CPP_DEVICE_H_