esp-nimble-cpp 2.3.1
Loading...
Searching...
No Matches
Changelog

All notable changes to this project will be documented in this file.

[2.3.1] 2025-06-11

Fixed

  • Build errors when disabling BLE roles.
  • NimBLEClient::readValue call not returning when the instance was created with aNimBLEServer and reading a secured characteristic.
  • NimBLEScan destructor potentially causing a crash.

Added

[2.3.0] 2025-05-19

Fixed

  • Incorrect NimBLECharacteristic::onSubscribe value when indications are set.
  • NimBLECharacteristic::onRead callback not called in some cases.
  • Clear attribute value when zero length value is written.
  • Notify/Indicate incorrectly returning success with custom value.
  • Corrected NimBLEClient array initialization.
  • Prevent potential exception when scan is restarted.
  • Attribute getValue failing with some data types
  • Incorrectly passing a pointer to a function taking const reference.

Added

  • Support for esp32c5
  • L2CAP infrastructure.
  • Scan duplicate cache reset time.

Changed

  • Cleaned up examples.
  • Allow PHY updates without enabling extended advertising.

[2.2.1] 2025-02-28

Fixed

[2.2.0] 2025-02-24

Fixed

Added

[2.1.1] 2025-01-26

Fixed

  • remote descriptor discovery error when no descriptors exist.
  • scan filter settings not enabled for esp32s3/c3.
  • remote descriptor discovery returning more than the desired descriptor.

[2.1.0] 2025-01-12

Fixed

  • Crash when retrieving descriptors if more than one exists.
  • Incorrect TX power value being advertised.
  • New user guide code for 2.x
  • Potential race condition if `NimBLEScan::clearResults1 is called from multiple tasks.

Changed

Added

  • Config option CONFIG_NIMBLE_CPP_ADDR_FMT_EXCLUDE_DELIMITER, if defined will remove the ":" delimiter from the BLE address string.
  • Config option CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE if defined will make the BLE address strings uppercase.

[2.0.3] 2025-01-05

Fixed

  • Unused variable warning when log level is below info.
  • Build error missing definition of CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT in platformio.
  • Race condition in NimBLEScan that can cause a crash due to heap corruption if NimBLEScan::stop is called from the onResult callback.
  • Advertisement data not set if scan response is enabled after the data is set.
  • NimBLECharacteristic/NimBLEDescriptor not able to update their values in the onRead callback.
  • Too short of a timeout being requested in NimBLE_Server example leading to frequent disconnects.

Changed

  • NimBLEHIDDevice now allows for the same report ID in multiple input/output/feature reports.

Added

  • Config for custom log colors pre level.
  • Error logs in the case that NIMBLE_CPP_DEBUG_ASSERT is not defined.
  • Error logs when setting advertisement data fails.
  • Missing documentation in the migration guide about enabling automatic advertising on disconnect, which was disabled by default in 2.x.

[2.0.2] 2024-12-21

Fixed

  • Compile error when only advertising role is enabled.
  • Possible crash if bonded client reconnects.

Changed

[2.0.1] 2024-12-16

Fixed

Changed

[2.0.0] 2024-12-14

<strong>Breaking changes</strong>

Fixed

  • NimBLEDevice::getPower and NimBLEDevice::getPowerLevel bug worked around for the esp32s3 and esp32c3.
  • NimBLEDevice::setPower and NimBLEDevice::getPower now support the full power range for all esp devices.
  • NimBLEDevice::setOwnAddrType will now correctly apply the provided address type for all devices.
  • NimBLEDevice::getPower (esp32) return value is now calculated to support devices with different min/max ranges.
  • Crash if NimBLEDevice::deinit is called when the stack has not been initialized.
  • NimBLEServer service changed notifications will now wait until the changes have taken effect and the server re-started before indicating the change to peers, reducing difficultly for some clients to update their data.
  • NimBLEService::getHandle will now fetch the handle from the stack if not valid to avoid returning an invalid value.
  • std::vector input to set/write values template.
  • NimBLEHIDDevice::pnp will now set the data correctly.
  • Check for Arduino component
  • Fixed building with esp-idf version 5.x.
  • Fixed pairing failing when the process was started by the peer first.
  • Fixed building with esp-idf and Arduino component.
  • Workaround for esp32s3 and esp32c3 not returning the correct txPower with some IDF versions.

Changed

Added

[1.4.1] - 2022-10-30

Fixed

Changed

  • Revert previous change that forced writing with response when subscribing in favor of allowing the application to decide.

Added

  • Added NimBLEHIDDevice::batteryLevel.
  • Added NimBLEDevice::setDeviceName allowing for changing the device name while the BLE stack is active.
  • CI Builds

[1.4.0] - 2022-07-31

Fixed

  • Fixed missing data from long notification values.
  • Fixed NimbleCharacteristicCallbacks::onRead not being called when a non-long read command is received.
  • Prevent a potential crash when retrieving characteristics from a service if the result was successful but no characteristics found.
  • logs/typos.

Changed

  • AD flags are no longer set in the advertisements of non-connectable beacons, freeing up 3 bytes of advertisement room.
  • Save resources when retrieving descriptors if the characteristic handle is the same as the end handle (no descriptors).
  • Subscribing to characteristic notifications/indications will now always use write with response, as per BLE specifications.
  • NimBLEClient::discoverAttributes now returns a bool value to indicate success/failure.
  • Scan result callbacks are no longer called when the scan response data is updated in order to reduce duplicates.

Added

  • Preliminary support for non-esp devices, NRF51 and NRF52 devices supported with n-able arduino core
  • Alias added for NimBLEServerCallbacks::onMTUChange to onMtuChanged in order to support porting code from original library.
  • NimBLEAttValue Class added to reduce and control RAM footprint of characteristic/descriptor values and support conversions from Arduino Strings and many other data types.
  • Bluetooth 5 extended advertising support for capable devices. CODED Phy, 2M Phy, extended advertising data, and multi-advertising are supported, periodic advertising will be implemented in the future.

[1.3.3] - 2022-02-15

Changed

  • If attribute retrieval fails with a "not found" try again with the 16 bit version if a 128 bit base uuid is used.

Fixed

  • Memory leak when deleting client instance.
  • IDf version check for data length extension.
  • Memory leak when server services changed.
  • Compiler warnings for non-esp32 devices.

[1.3.2] - 2022-01-15

Fixed

  • Initialize advertising complete callback in NimBLEAdvertising constructor.
  • Clear client disconnect timer in constructor before initializing.
  • Fix missing data when reading large values.
  • Fix missing data in notifications when using a large MTU size and more than 270 bytes of data are sent.
  • Workaround fix added for cases when the task notification value is not cleared, causing various functions that should block not to block.

Added

  • NimBLEClient::getLastError : Gets the error code of the last function call that produces a return code from the stack.
  • NimBLECharacteristic::notify : Overload method to send notifications/indications with custom values.
  • Added conditional checks for ESP32 specific functions/values to support use of the library on non-esp32 devices.
  • Added an alias to use the callback name from the original library onMtuChanged.
  • NimBLEClient::setDataLen and NimBLEServer::setDataLen: Data length extension support (IDF version >= 4.3.2 only)
  • Config option to set logging level for esp-nimble-cpp

Changed

  • Critical section calls now use the NimBLE API instead of FreeRTOS directly. This removes the need for a portMUX_TYPE variable in the class definitions.
  • Removed unnecessary variables in NimBLEService and changed the constructor no no longer accept numHandles and inst_id parameters.

[1.3.1] - 2021-08-04

Fixed

  • Corrected a compiler/linker error when an application or a library uses bluetooth classic due to the redefinition of btInUse.

[1.3.0] - 2021-08-02

Added

Changed

  • FreeRTOS files have been removed as they are not used by the library.
  • Services, characteristics and descriptors can now be created statically and added after.
  • Excess logging and some asserts removed.
  • Use ESP_LOGx macros to enable using local log level filtering.

Fixed

  • NimBLECharacteristicCallbacks::onSubscribe Is now called after the connection is added to the vector.
  • Corrected bonding failure when reinitializing the BLE stack.
  • Writing to a characteristic with a std::string value now correctly writes values with null characters.
  • Retrieving remote descriptors now uses the characteristic end handle correctly.
  • Missing data in long writes to remote descriptors.
  • Hanging on task notification when sending an indication from the characteristic callback.
  • BLE controller memory could be released when using Arduino as a component.
  • Compile errors with NimBLE release 1.3.0.

[1.2.0] - 2021-02-08

Added

Changed

Fixed

  • NimBLEHIDDevice Characteristics now use encryption, this resolves an issue with communicating with devices requiring encryption for HID devices.

[1.1.0] - 2021-01-20

Added

  • NimBLEDevice::setOwnAddrType added to enable the use of random and random-resolvable addresses, by asukiaaa
  • New examples for securing and authenticating client/server connections, by mblasee.
  • NimBLEAdvertising::SetMinPreferred and NimBLEAdvertising::SetMinPreferred re-added.
  • Conditional checks added for command line config options in nimconfig.h to support custom configuration in platformio.
  • NimBLEClient::setValue Now takes an extra bool parameter response to enable the use of write with response (default = false).
  • NimBLEClient::getCharacteristic(uint16_t handle) Enabling the use of the characteristic handle to be used to find the NimBLERemoteCharacteristic object.
  • NimBLEHIDDevice class added by wakwak-koba.
  • NimBLEServerCallbacks::onDisconnect overloaded callback added to provide a ble_gap_conn_desc parameter for the application to obtain information about the disconnected client.
  • Conditional checks in nimconfig.h for command line defined macros to support platformio config settings.

Changed

  • NimBLEAdvertising::start now returns a bool value to indicate success/failure.
  • Some asserts were removed in NimBLEAdvertising::start and replaced with better return code handling and logging.
  • If a host reset event occurs, scanning and advertising will now only be restarted if their previous duration was indefinite.
  • NimBLERemoteCharacteristic::subscribe and NimBLERemoteCharacteristic::registerForNotify will now set the callback regardless of the existence of the CCCD and return true unless the descriptor write operation failed.
  • Advertising tx power level is now sent in the advertisement packet instead of scan response.
  • NimBLEScan When the scan ends the scan stopped flag is now set before calling the scan complete callback (if used) this allows the starting of a new scan from the callback function.

Fixed

  • Sometimes NimBLEClient::connect would hang on the task block if no event arrived to unblock. A time limit has been added to timeout appropriately.
  • When getting descriptors for a characteristic the end handle of the service was used as a proxy for the characteristic end handle. This would be rejected by some devices and has been changed to use the next characteristic handle as the end when possible.
  • An exception could occur when deleting a client instance if a notification arrived while the attribute vectors were being deleted. A flag has been added to prevent this.
  • An exception could occur after a host reset event when the host re-synced if the tasks that were stopped during the event did not finish processing. A yield has been added after re-syncing to allow tasks to finish before proceeding.
  • Occasionally the controller would fail to send a disconnected event causing the client to indicate it is connected and would be unable to reconnect. A timer has been added to reset the host/controller if it expires.
  • Occasionally the call to start scanning would get stuck in a loop on BLE_HS_EBUSY, this loop has been removed.
  • 16bit and 32bit UUID's in some cases were not discovered or compared correctly if the device advertised them as 16/32bit but resolved them to 128bits. Both are now checked.
  • FreeRTOS compile errors resolved in latest Arduino core and IDF v3.3.
  • Multiple instances of time() called inside critical sections caused sporadic crashes, these have been moved out of critical regions.
  • Advertisement type now correctly set when using non-connectable (advertiser only) mode.
  • Advertising payload length correction, now accounts for appearance.
  • (Arduino) Ensure controller mode is set to BLE Only.

[1.0.2] - 2020-09-13

Changed

  • NimBLEAdvertising::start Now takes 2 optional parameters, the first is the duration to advertise for (in seconds), the second is a callback that is invoked when advertising ends and takes a pointer to a NimBLEAdvertising object (similar to the NimBLEScan::start API).
  • (Arduino) Maximum BLE connections can now be altered by only changing the value of CONFIG_BT_NIMBLE_MAX_CONNECTIONS in nimconfig.h. Any changes to the controller max connection settings in sdkconfig.h will now have no effect when using this library.
  • (Arduino) Revert the previous change to fix the advertising start delay. Instead a replacement fix that routes all BLE controller commands from a task running on core 0 (same as the controller) has been implemented. This improves response times and reliability for all BLE functions.

[1.0.1] - 2020-09-02

Added

  • Empty NimBLEAddress constructor: NimBLEAddress() produces an address of 00:00:00:00:00:00 type 0.
  • Documentation of the difference of NimBLEAddress::getNative vs the original bluedroid library.

Changed

  • notify_callback typedef is now defined as std::function to enable the use of std::bind to call a class member function.

Fixed

  • Fix advertising start delay when first called.

[1.0.0] - 2020-08-22

First stable release.

All the original library functionality is complete and many extras added with full documentation.