All notable changes to this project will be documented in this file.
NimBLEClientconnection state tracking.- Calling disconnect will no longer return false if the HCI response is "Unknown ID".
- Remote descriptors not found when characteristic vector handles out of order.
setValuewith char inputs now calculates the data length correctly.
NimBLEServer::sendServiceChangedIndicationSends the service changed indication to peers so they refresh their database.NimBLEScanuser configuarable scan response timer added to prevent unreported devices on long duration scans.NimBLEClientConnection retry on connection establishment failure, retry count configurable by app, default 2.- ANCS Example
l2CapDisconnect API
- GATT attribute handles are now assigned from the registration callback so duplicate UUID attributes are identified correctly.
- Dynamic service changes now properly remove characteristics/descriptors and reset the GATT database when advertising starts.
- Missing notification/indication payload data when the value spans multiple mbufs, such as values larger than 255 bytes with small ACL buffers.
NimBLEDevice::createServerwill longer crash when called before the stack is initialized.- Re-pairing after deleting all bonds now works by unpairing each stored bond instead of only deleting NVS data.
- Whitelist bounds checks.
NimBLEDevice::getBondedAddressindex bounds validation.- ESP32 linker error when both central and peripheral roles are disabled.
- Compiler warnings when bonds are disabled.
NimBLEStream,NimBLEStreamClient, andNimBLEStreamServerclasses and examples.NimBLECppVersion.hwith compile-time version macros.NimBLEDevice::getVersionruntime version string helper.- Matching passkey callbacks for both roles:
NimBLEServerCallbacks::onPassKeyEntryandNimBLEClientCallbacks::onPassKeyDisplay. - Bond migration helpers to convert bond storage between v1 and current formats while preserving existing bonds.
NimBLEUUIDconstructor overload forble_uuid_t*.- Optional
indexparameter forNimBLECharacteristic::getDescriptorByUUIDto access multiple descriptors with the same UUID.
NimBLEService::startis deprecated; services are now added when the server starts.NimBLEHIDDevice::startServices()is deprecated; services are now added when the server starts.
- Crash when scanning with esp32c6/c5/c2/h2.
- Scan duplicate filter not resetting on scan restart.
NimBLEConnInfo::toStringmethod to get a string representation of the connection information for logging/debugging purposes.
- Crash on init with esp32 devices with Arduino core 3.3.7 and later.
- Crash on deinit with esp32c6/c5/c2/h2.
- Memory leak on init/deinit with esp32c6/c5/c2/h2 when NimBLE is enabled in the Arduino core.
- Multiple definition compilation errors with esp32c2 when using an Arduino core with NimBLE enabled.
- Server created client instance will now receive notifications/indications from the peer.
- Improper HCI delay when ACL buffers are full (esp32)
NimBLEClientdisconnect event not triggered if the peer address doesn't match a connection.- Attribute value sizes now correctly calculated for types larger than 8 bits.
NimBLERemoteCharacteristic::retrieveDescriptorswill now use the handle range of the characteristic.
NimBLECharacteristicCallbacks::onStatusoverload that takes aNimBLEConnInfo¶meter to indicate which client the status is for.
NimBLEDevice::setCustomGapHandleradded a void pointer parameter to allow passing user data to the custom handler.
- NimBLEAdvertisedDevice::isConnectable returning incorrect result.
- Extended advertisements not reporting full data.
- Support up to 1650 bytes of advertisement with extended advertising.
- esp32c3/s3 max connections not being properly applied.
NimBLEClientCallbacks::OnConnectFailnot called when connection not established.- Removed invalid reference to refactored original examples in README.md.
- Cleanup redefinition warnings for arduino core 3.3+.
- Multiple definition errors for some functions with esp32c6/h2/c2 with Arduino core 3.3+.
- Max connections not being applied correctly above 4.
- Build errors with arduino cores using IDF v4.x
onConnectcallback not being called when the status isBLE_ERR_UNSUPP_REM_FEATURE, workaround for upstream issue.
- FreeRTOS port uses the old porting layer for all but the latest esp32 mcus.
- By default BLE secure connections is disabled now to reduce issues when it's enabled but not used by the application.
- BLE mesh files are now only compiled if mesh is enabled in the project configuration.
- EddystoneTLM example not setting the data.
- Build errors when disabling BLE roles.
- esp32c2 build issues due to multiple definitions of various functions.
NimBLEClient::readValuecall not returning when the instance was created with aNimBLEServerand reading a secured characteristic.NimBLEScandestructor potentially causing a crash.
- iBeacon example.
NimBLEBeacon::BeaconDatastd::vector<uint8_t>operator to allow it to be used as a parameter toNimBLEAdvertisementData::setManufacturerData.
- Incorrect
NimBLECharacteristic::onSubscribevalue when indications are set. NimBLECharacteristic::onReadcallback 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.
- Support for esp32c2, esp32c5, esp32c6, esp32h2
- L2CAP infrastructure.
- Scan duplicate cache reset time.
- Cleaned up examples.
- Update nimble core to esp-nimble @70439dd.
- Disable flow control for all targets except original esp32.
- Allow PHY updates without enabling extended advertising.
- Reduced iram usage
- Added back
NimBLEClient::connectoverload withNimBLEAdvertisedDeviceparameter to resolve connection error due to NULL address. - Crash caused by returning invalid vector entry when retrieving remote descriptors.
- Crash when calling
NimBLEClient::DiscoverAttributes.
NimBLEDeviceCallbacksclass with a callback for handling bond storage.
- 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.
- 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::clearResultsis called from multiple tasks.
- If privacy is not enabled identity keys will not be shared.
NimBLEDevice::setPowerandNimBLEDevice::getPowernow take an additional parameterNimBLETxPowerTypeto set/get the power level for different operations.- ESP32 devices now use esp_timer instead of freeRTOS timers for BLE operations by default.
- Config option to use mbedtls instead of tinycrypt for crypto operations, this will save approximately 8k of flash if already using mbedtls for other applications (https, mqtts, etc..).
- 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_UPPERCASEif defined will make the BLE address strings uppercase.
- Unused variable warning when log level is below info.
- Race condition in
NimBLEScanthat can cause a crash due to heap corruption ifNimBLEScan::stopis called from theonResultcallback. - Advertisement data not set if scan response is enabled after the data is set.
NimBLECharacteristic/NimBLEDescriptornot able to update their values in theonReadcallback.- Too short of a timeout being requested in NimBLE_Server example leading to frequent disconnects.
NimBLEHIDDevicenow allows for the same report ID in multiple input/output/feature reports.
- 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.
- Compile error when only advertising role is enabled.
- Possible crash if bonded client reconnects.
NimBLEHIDDevicecan now create more than one in/out/feature report map.
NimBLEHIDDevice::getOutputReportwill now return the correct characteristic.- Compile error when central is disabled, class
NimBLEServerhas no member namedm_pClient. - Compile error with nRF devices, unresolved symbol
nimble_port_stop.
- Added missing includes for
NimBLEConnInfoandNimBLEUtilstoNimBLEDevice.h.
- NimBLESecurity class removed.
- All connection oriented callbacks now receive a reference to
NimBLEConnInfo, theble_gap_conn_deschas also been replace withNimBLEConnInfoin the functions that received it. - All functions that take a time input parameter now expect the value to be in milliseconds instead of seconds.
NimBLEDeviceIgnore list functions removed.NimBLEDevice::startSecuritynow returns abool, true on success, instead of an int to be consistent with the rest of the library.NimBLEDevice::getInitializedrenamed toNimBLEDevice::isInitialized.NimBLEDevice::setPowerno longer takes theesp_power_level_tandesp_ble_power_type_t, instead only an integer value in dbm units is accepted.NimBLEDevice::setOwnAddrTypeno longer takes abool nrpaparameter.NimBLEDevice::getClientListSizereplaced withNimBLEDevice::getCreatedClientCount.NimBLEDevice::getClientListwas removed.NimBLEServer::disconnectnow returnsbool, true = success, instead ofintto be consistent with the rest of the library.NimBLEServer::getPeerIDInforenamed toNimBLEServer::getPeerInfoByHandleto better describe it's use.NimBLEServerCallbacks::onMTUChangedrenamed toNimBLEServerCallbacks::onMTUChangeto be consistent with the client callback.NimBLEServerCallbacks::onPassKeyRequesthas been replaced withNimBLEServer::onPassKeyDisplaywhich should display the pairing pin that the client is expected to send.NimBLEServerCallbacks::onAuthenticationCompletenow takes aNimBLEConnInfo¶meter.NimBLEClient::getServicesnow returns a const reference to std::vector<NimBLERemoteService*> instead of a pointer to the internal vector.NimBLEClient::getConnIdhas been renamed togetConnHandleto be consistent with bluetooth terminology.NimBLEClient::disconnectnow returns abool, true on success, instead of an int to be consistent with the rest of the library.NimBLEClientCallbacks::onDisconnectnow takes an additionalint reasonparameter to let the application know why the disconnect occurred.NimBLEClientCallbacks::onPassKeyRequesthas been changed toNimBLEClientCallbacks::onPassKeyEntrywhich takes aNimBLEConnInfo¶meter and does not return a value. Instead or returning a value this callback should prompt a user to enter a pin number which is sent later viaNimBLEDevice::injectPassKey.NimBLEClientCallbacks::onConfirmPINrenamed toNimBLEClientCallbacks::onConfirmPasskeyand no longer returns a value and now takes aNimBLEConnInfo¶meter. This should be used to prompt a user to confirm the pin on the display (YES/NO) after which the response should be sent withNimBLEDevice::injectConfirmPasskey.NimBLEAdvertising::setMinPreferredandNimBLEAdvertising::setMaxPreferredhave been removed, useNimBLEAdvertising::setPreferredParamsinstead.- Advertising the name and TX power of the device will no longer happen by default and should be set manually by the application.
NimBLEAdvertising::setAdvertisementTypehas been renamed toNimBLEAdvertising::setConnectableModeto better reflect it's function.NimBLEAdvertising::setScanResponsehas been renamed toNimBLEAdvertising::enableScanResponseto better reflect it's function.NimBLEAdvertising; Scan response is no longer enabled by default.NimBLEAdvertising::startNo longer takes a callback pointer parameter, instead the new methodNimBLEAdvertising::setAdvertisingCompleteCallbackshould be used.NimBLEAdvertisementData::addDatanow takes either astd::vector<uint8_t>oruint8_t* + lengthinstead ofstd::stringorchar + length.NimBLEAdvertisementData::getPayloadnow returnsstd::vector<uint8_t>instead ofstd::string.- The callback parameter for
NimBLEScan::starthas been removed and the blocking overload ofNimBLEScan::starthas been replaced by an overload ofNimBLEScan::getResultswith the same parameters. NimBLEAdvertisedDeviceCallbacksHas been replaced byNimBLEScanCallbackswhich contains the following methods:onResult,onScanEnd, and `onDiscovered-
NimBLEScanCallbacks::onResult, functions the same as the oldNimBLEAdvertisedDeviceCallbacks::onResultbut now takes aaconst NimBLEAdvertisedDevice*instead of non-const.
-
NimBLEScanCallbacks::onScanEnd, replaces the scanEnded callback passed toNimBLEScan::startand now takes aconst NimBLEScanResults&andint reasonparameter.
-
NimBLEScanCallbacks::onDiscovered, This is called immediately when a device is first scanned, before any scan response data is available and takes aconst NimBLEAdvertisedDevice*parameter.
NimBLEScan::stopwill no longer call theonScanEndcallback as the caller should know its been stopped when this is called.NimBLEScan::clearDuplicateCachehas been removed as it was problematic and only for the esp32. Stop and start the scanner for the same effect.NimBLEScanResults::getDevicemethods now returnconst NimBLEAdvertisedDevice*.NimBLEScanResultsiterators are nowconst_iterator.NimBLEService::getCharacteristicsnow returns aconst std::vector<NimBLECharacteristic*>&instead of std::vector<NimBLECharacteristic *>.NimBLECharacteristic::notifyno longer takes abool is_notificationparameter, insteadindicate()should be called to send indications.NimBLECharacteristicCallbacks::onNotifyremoved as unnecessary, the library does not call notify without app input.NimBLECharacteristicCallbacks::onStatusNo longer takes astatusparameter, refer to the return code for success/failure.NimBLERemoteService::getCharacteristicsnow returns aconst std::vector<NimBLERemoteCharacteristic*>&instead of non-conststd::vector<NimBLERemoteCharacteristic*>*.NimBLERemoteService::getValuenow returnsNimBLEAttValueinstead ofstd::string.NimBLERemoteCharacteristic::getRemoteServicenow returns aconst NimBLERemoteService*instead of non-const.NimBLERemoteCharacteristic::readUInt32Has been removed.NimBLERemoteCharacteristic::readUInt16Has been removed.NimBLERemoteCharacteristic::readUInt8Has been removed.NimBLERemoteCharacteristic::readFloatHas been removed.NimBLERemoteCharacteristic::registerForNotifyHas been removed.NimBLEAdvertisedDevice::hasRSSIremoved as redundant, RSSI is always available.NimBLEAdvertisedDevice::getPayloadnow returnsconst std::vector<uint8_t>instead of a pointer to internal memory.NimBLEAdvertisedDeviceTimestamp removed, if needed then the app should track the time from the callback.NimBLEAddressconstructor; default value for thetypeparameter removed, caller should know the address type and specify it.NimBLEAddress::getNativereplaced withNimBLEAddress::getBaseand now returns a pointer toconst ble_addr_tinstead of a pointer to the address value.NimBLEAddress::equalsmethod andNimBLEAddress::== operatorwill now also test if the address types are the same.NimBLEUUID::getNativemethod replaced withNimBLEUUID::getBasewhich returns a read-only pointer to the underlyingble_uuid_tstruct.NimBLEUUID;msbFirstparameter has been removed from constructor, caller should reverse the data first or call the newreverseByteOrdermethod after.NimBLEUtils::dumpGapEventfunction removed.NimBLEUtils::buildHexDatareplaced withNimBLEUtils::dataToHexString, which returns astd::stringcontaining the hex string.- Removed Eddystone URL as it has been shutdown by google since 2021.
NimBLEEddystoneTLM::setTempnow takes anint16_tparameter instead of float to be friendly to devices without floating point support.NimBLEEddystoneTLM::getTempnow returnsint16_tto work with devices that don't have floating point support.NimBLEEddystoneTLM::setDatanow takes a reference to *NimBLEEddystoneTLM::BeaconDatainstead ofstd::string.NimBLEEddystoneTLM::getDatanow returns a reference to *NimBLEEddystoneTLM::BeaconDatainstead ofstd::string.NimBLEBeacon::setDatanow takesconst NimBLEBeacon::BeaconData&instead ofstd::string.NimBLEBeacon::getDatanow returnsconst NimBLEBeacon::BeaconData&instead ofstd::string.NimBLEHIDDevice::reportMaprenamed toNimBLEHIDDevice::getReportMap.NimBLEHIDDevice::hidControlrenamed toNimBLEHIDDevice::getHidControl.NimBLEHIDDevice::inputReportrenamed toNimBLEHIDDevice::getInputReport.NimBLEHIDDevice::outputReportrenamed toNimBLEHIDDevice::getOutputReport.NimBLEHIDDevice::featureReportrenamed toNimBLEHIDDevice::getFeatureReport.NimBLEHIDDevice::protocolModerenamed toNimBLEHIDDevice::getProtocolMode.NimBLEHIDDevice::bootOutputrenamed toNimBLEHIDDevice::getBootOutput.NimBLEHIDDevice::pnprenamed toNimBLEHIDDevice::setPnp.NimBLEHIDDevice::hidInforenamed toNimBLEHIDDevice::setHidInfo.NimBLEHIDDevice::deviceInforenamed toNimBLEHIDDevice::getDeviceInfoService.NimBLEHIDDevice::hidServicerenamed toNimBLEHIDDevice::getHidService.NimBLEHIDDevice::batteryServicerenamed toNimBLEHIDDevice::getBatteryService.
NimBLEDevice::getPowerandNimBLEDevice::getPowerLevelbug worked around for the esp32s3 and esp32c3.NimBLEDevice::setPowerandNimBLEDevice::getPowernow support the full power range for all esp devices.NimBLEDevice::setOwnAddrTypewill 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::deinitis called when the stack has not been initialized. NimBLEServerservice 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::getHandlewill now fetch the handle from the stack if not valid to avoid returning an invalid value.std::vectorinput to set/write values template.- Pairing failing when the process was started by the peer first.
NimBLEClient::secureConnectionnow takes an additional parameterbool async, if true, will send the secure command and return immediately with a true value for successfully sending the command, else false. This allows for asynchronously securing a connection.- Deleting the client instance from the
onDisconnectcallback is now supported. NimBLEClient::connectwill no longer cancel already in progress connections.NimBLEClient::setDataLennow returns bool, true if successful.NimBLEClient::updateConnParamsnow returns bool, true if successful.NimBLEClient::setPeerAddressnow returns a bool, true on success.NimBLEDevice::startSecuritynow takes and additional parameterint* rcPtrwhich will provide the return code from the stack if provided.NimBLEDevice::deleteClientno longer blocks tasks.NimBLEDevice::getAddresswill now return the address currently in use.NimBLEDevice::initnow returns a bool withtrueindicating success.NimBLEDevice::deinitnow returns a bool withtrueindicating success.NimBLEDevice::setDeviceNamenow returns a bool withtrueindicating success.NimBLEDevice::setCustomGapHandlernow returns a bool withtrueindicating success.NimBLEDevice::setOwnAddrTypenow returns a bool withtrueindicating success and works with non-esp32 devices.NimBLEDevice::setPowernow returns a bool value, true = success.NimBLEDevice::setMTUnow returns a bool value, true = success.NimBLEDevice::deleteAllBondsnow returns true on success, otherwise false.NimBLEEddystoneTLMinternal data struct typeBeaconDatais now public and usable by the application.NimBLEBeaconinternal data struct typeBeaconDatais now public and can be used by the application.- Removed tracking of client characteristic subscription status from
NimBLEServerandNimBLECharacteristicand instead uses the functions and tracking in the host stack. NimBLECharacteristic::indicatenow takes the same parameters asnotify.NimBLECharacteristic::notifyandNimBLECharacteristic::indicatenow return abool, true = success.- Added optional
connHandleparameter toNimBLECharacteristic::notifyto allow for sending notifications to specific clients. NimBLEServerNow uses a std::array to store client connection handles instead of std::vector to reduce memory allocation.NimBLEExtAdvertisement; All functions that set data now returnbool, true = success.NimBLEAdvertisingAdvertising data is now stored in instances ofNimBLEAdvertisingDataand old vectors removed.NimBLEAdvertising::setAdvertisementDataandNimBLEAdvertising::setScanResponseDatanow returnbool, true = success.- Added optional
NimBLEAddressparameter toNimBLEAdvertising::startto allow for directed advertising to a peer. - All
NimBLEAdvertisingfunctions that change data values now returnbool, true = success. - All
NimBLEAdvertisementDatafunctions that change data values now returnbool, true = success. NimBLEAdvertisementData::setNamenow takes an optionalboolparameter to indicate if the name is complete or incomplete, default = complete.NimBLEAdvertisementDatamoved to it's own .h and .cpp files.NimBLEScan::starttakes a newbool restartparameter, defaulttrue, that will restart an already in progress scan and clear the duplicate filter so all devices will be discovered again.- Scan response data that is received without advertisement first will now create the device and send a callback.
NimBLEScan::startwill no longer clear cache or results if scanning is already in progress.NimBLEScan::startwill now allow the start command to be sent with updated parameters if already scanning.NimBLEScan::clearResultswill now reset the vector capacity to 0.- Host reset will now no longer restart scanning and instead will call
NimBLEScanCallbacks::onScanEnd. - Added optional
indexparameter toNimBLEAdvertisedDevice::getPayloadByType NimBLEUtils: Add missing GAP event strings.NimBLEUtils: Add missing return code strings.NimBLEUtils: Event/error code strings optimized.NimBLEAttValuecleanup and optimization.- cleaned up code, removed assert/abort calls, replaced with a configurable option to enable debug asserts.
- (esp32 specific)
NimBLEDevice::setPowerLevelandNimBLEDevice::getPowerLevelwhich take and return the relatedesp_power_level*types. NimBLEDevice::setDefaultPhywhich will set the default preferred PHY for all connections.NimBLEDevice::getConnectedClients, which returns a vector of pointers to the currently connected client instances.NimBLEDevice::setOwnAddrfunction added, which takes auint8_t*orNimBLEAddress&and will set the mac address of the device, returnsbooltrue = success.NimBLEDevice::injectPassKeyUsed to send the pairing passkey instead of a return value from the client callback.NimBLEDevice::injectConfirmPasskeyUsed to send the numeric comparison pairing passkey confirmation instead of a return value from the client callback.NimBLEDevice::setDeviceNameto change the device name after initialization.NimBLECharacteristic::create2904which will specifically create a Characteristic Presentation Format (0x2904) descriptor.NimBLEAdvertising::refreshAdvertisingDatarefreshes the advertisement data while still actively advertising.NimBLEClient::updatePhyto request a PHY change with a peer.NimBLEClient::getPhyto read the current connection PHY setting.Configstruct toNimBLEClientto efficiently set single bit config settings.NimBLEClient::setSelfDeletethat takes the bool parametersdeleteOnDisconnectanddeleteOnConnectFail, which will configure the client to delete itself when disconnected or the connection attempt fails.NimBLEClient::setConfigandNimBLEClient::getConfigwhich takes or returns aNimBLEClient::Configobject respectively.NimBLEClient::cancelConnect()to cancel an in-progress connection, returnsbool, true = success.- Non-blocking
NimBLEClient::connectoption added via 2 newboolparameters added to the function: -
asyncConnect; if true, will send the connect command and return immediately.
-
exchangeMTU; if true will send the exchange MTU command upon connection.
NimBLEClientCallbacks::onConnectFailcallback that is called when the connection attempt fail while connecting asynchronously.NimBLEClientCallbacks::onMTUChangecallback which will be called when the MTU exchange completes and takes aNimBLEClient*anduint16_t MTUparameter.NimBLEClientCallbacks::onPhyUpdateand -NimBLEServerCallbacks::onPhyUpdateWhich are called when the PHY update is complete.- Extended scan example.
NimBLEServer::updatePhyto request a PHY change with a peer.NimBLEServer::getPhyto read the PHY of a peer connection.NimBLEServer::getClientwhich will create a client instance from the provided peer connHandle or connInfo to facilitate reading/write from the connected client.NimBLEServerCallbacks::onConnParamsUpdatecallback.NimBLEScan::eraseoverload that takes aconst NimBLEAdvertisedDevice*parameter.NimBLEScan::setScanPhyto enable/disable the PHY's to scan on (extended advertising only).NimBLEScan::setScanPeriodwhich will allow for setting a scan restart timer in the controller (extended advertising only).NimBLEAdvertisedDevice::isScannable()that returns true if the device is scannable.NimBLEAdvertisedDevice::beginandNimBLEAdvertisedDevice::endread-only iterators for convenience and use in range loops.NimBLEAdvertisedDevice::haveTypeGeneric use function that returns true if the advertisement data contains a field with the specified type.NimBLEExtAdvertisement::removeData, which will remove the data of the specified type from the advertisement.NimBLEExtAdvertisement::addServiceUUID, which will append to the service uuids advertised.NimBLEExtAdvertisement::removeServiceUUID, which will remove the service from the uuids advertised.NimBLEExtAdvertisement::removeServices, which will remove all service uuids advertised.- New overloads for
NimBLEExtAdvertisement::setServiceDatawith the parametersconst NimBLEUUID& uuid, const uint8_t* data, size_t lengthandconst NimBLEUUID& uuid, const std::vector<uint8_t>& data. NimBLEExtAdvertisement::getDataLocation, which returns the location in the advertisement data of the type requested in parameteruint8_t type.NimBLEExtAdvertisement::toStringwhich returns a hex string representation of the advertisement data.NimBLEAdvertising::getAdvertisementData, which returns a reference to the currently set advertisement data.NimBLEAdvertising::getScanData, which returns a reference to the currently set scan response data.- New overloads for
NimBLEAdvertising::removeServiceUUIDandNimBLEAdvertisementData::removeServiceUUIDto accept aconst char* NimBLEAdvertising::setManufacturerDataOverload that takes aconst uint8_t*and , size_t` parameter.NimBLEAdvertising::setServiceDataOverload that takesconst NimBLEUUID& uuid,const uint8_t* data,size_t lengthas parameters.NimBLEAdvertising::setServiceDataOverload that takesconst NimBLEUUID& uuid,const std::vector<uint8_t>&as parameters.NimBLEAdvertising::setDiscoverableModeto allow applications to control the discoverability of the advertiser.NimBLEAdvertising::setAdvertisingCompleteCallbacksets the callback to call when advertising ends.NimBLEAdvertising::setPreferredParamsthat takes the min and max preferred connection parameters as an alternative forsetMinPreferredandsetMaxPreferred.NimBLEAdvertising::setAdvertisingIntervalSets the advertisement interval for min and max to the same value instead of callingsetMinIntervalandsetMaxIntervalseparately if there is not value difference.NimBLEAdvertisementData::removeData, which takes a parameteruint8_t type, the data type to remove.NimBLEAdvertisementData::toString, which will print the data in hex.NimBLEUtils::taskWaitwhich causes the calling task to wait for an event.NimBLEUtils::taskReleasereleases the task from and event.NimBLEUtils::generateAddrfunction added with will generate a random address and takes aboolparameter, true = create non-resolvable private address, otherwise a random static address is created, returnsNimBLEAddress.NimBLEUUID::getValuewhich returns a read-onlyuint8_tpointer to the UUID value.NimBLEUUID::reverseByteOrder, this will reverse the bytes of the UUID, which can be useful for advertising/logging.NimBLEUUIDconstructor overload that takes a reference toble_uuid_any_t.NimBLEAddress::isNrpamethod to test if an address is random non-resolvable.NimBLEAddress::isStaticmethod to test if an address is random static.NimBLEAddress::isPublicmethod to test if an address is a public address.NimBLEAddress::isNullmethods to test if an address is NULL.NimBLEAddress::getValuemethod which returns a read-only pointer to the address value.NimBLEAddress::reverseByteOrdermethod which will reverse the byte order of the address value.NimBLEHIDDevice::batteryLevelreturns the HID device battery level characteristic.NimBLEBeacon::setDataoverload that takesuint8_t* dataanduint8_t length.NimBLEHIDDevice::getPnpfunction added to access the pnp characteristic.NimBLEHIDDevice::getHidInfofunction added to access the hid info characteristic.
- BT5 examples for non-esp devices.
- Build errors when configured as a non-connecting device
- Coded PHY support for nRF52833 and nRF52820
CONFIG_BT_NIMBLE_NVS_PERSISTvalue not being used to enable/disable persistance.- Set service handle in
NimBLEService::getHandlefunction if not set already. - NimBLE_service_data_advertiser example updated to initialize the advertising pointer after stack initialization.
- Unhandled exception on
NimBLECharacteristic::handleGapEventwhen the connection handle is invalid. NimBLEHIDDevice::pnpnow correctly sets the byte order.NimBLEEddystoneTLMnow correctly sets/gets negative temperatures.- Adding to the whitelist will now allow the device to be added again if the previous attempts failed.
- The IPC calls added to esp_nimble_hci have been removed to prevent IPC stack crashing.
- Espressif log tag renamed from "TAG" to "LOG_TAG" to avoid conflict with Arduino core definition.
- Removed broken links in docs
NimBLEAdvertisedDevicenew method:getAdvFlags, to read the flags advertised.NimBLEAdvertising::setManufacturerDatanew overload method that accepts a vector ofuint8_t.NimBLEAdvertisementData::setManufacturerDatanew overload method that accepts a vector ofuint8_t.NimBLEAdvertisedDevicenew method:getPayloadByType, to get data from generic data types advertised.NimBLEServicenew method:isStarted, checks if the service has been started.NimBLEAdvertisingnew method:removeServicesremoves all service UUID's from the advertisement.NimBLEAdvertisementDatanew method:clearDatasets all data to NULL to reuse the instance.
NimBLEAdvertisedDevice::getManufacturerData, now takes an index value parameter to use when there is more than 1 instance of manufacturer data.NimBLEAdvertisingdirected peer address parameter to advertising start.- Update NimBLE core to esp-nimble @0fc6282
- Can now create more than 255 Characteristics/Descriptors in a service.
nimble_port_freertos_get_hs_hwmfunction is now available to the application to get the core task stack usage.- changed default pairing keys shared to include ID key which is now needed by iOS
- Removed abort in server start when a service is not found, logs a warning message instead.
NimBLEAdvertising::starton complete callback is now a std::function to allow the use of std::bind to class methodsNimBLEAdvertisingsetXXX methods will now properly clear the previous data before setting the new values.- Removed asserts in
NimBLECharacteristicevent handler when conn_handle is invalid, sends a NULL conn info to the callback instead.
- Compile warning removed for esp32c3
- NimBLEDevice::getPower incorrect value when power level is -3db.
- Failed pairing when already in progress.
- Revert previous change that forced writing with response when subscribing in favor of allowing the application to decide.
- Added NimBLEHIDDevice::batteryLevel.
- Added NimBLEDevice::setDeviceName allowing for changing the device name while the BLE stack is active.
- CI build tests.
- Missing items in CHANGELOG that were not recorded correctly
- Fixed missing data from long notification values.
- Fixed NimbleCharacteristicCallbacks::onRead not being called when a non-long read command is received.
- Updated NimBLE core to use the v1.4.0 branch of esp-nimble.
- AD flags are no longer set in the advertisements of non-connectable beacons, freeing up 3 bytes of advertisement room.
- Config option CONFIG_BT_NIMBLE_DEBUG replaced with CONFIG_BT_NIMBLE_LOG_LEVEL (see src/nimconfig.h for usage)
- Config option CONFIG_NIMBLE_CPP_ENABLE_ADVERTISMENT_TYPE_TEXT renamed to CONFIG_NIMBLE_CPP_ENABLE_ADVERTISEMENT_TYPE_TEXT
- Config option CONFIG_BT_NIMBLE_TASK_STACK_SIZE renamed to CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE
- Preliminary support for non-esp devices, NRF51 and NRF52 devices supported with n-able arduino core
- Alias added for
NimBLEServerCallbacks::onMTUChangetoonMtuChangedin order to support porting code from original library. NimBLEAttValueClass 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.
- Fix compile error with ESP32S3.
- Prevent a potential crash when retrieving characteristics from a service if the result was successful but no characteristics found.
- 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::discoverAttributesnow returns a bool value to indicate success/failure
- Crash when retrieving an attribute that does not exist on the peer.
- Memory leak when deleting client instances.
- Compilation errors for esp32s3
- When retrieving attributes from a server fails with a 128bit UUID containing the ble base UUID another attempt will be made with the 16bit version of the UUID.
- Memory leak when services are changed on server devices.
- Rare crashing that occurs when BLE commands are sent from ISR context using IPC.
- Crashing caused by uninitialized disconnect timer in client.
- Potential crash due to uninitialized advertising callback pointer.
- CONFIG_NIMBLE_CPP_DEBUG_LEVEL macro in nimconfig.h to allow setting the log level separately from the Arduino core log level.
- Memory leak when initializing/deinitializing the BLE stack caused by new FreeRTOS timers be created on each initialization.
- Workaround for latest Arduino-esp32 core that causes tasks not to block when required, which caused functions to return prematurely resulting in exceptions/crashing.
- The wrong length value was being used to set the values read from peer attributes. This has been corrected to use the proper value size.
- Workaround added for FreeRTOS bug that affected timers, causing scan and advertising timer expirations to not correctly trigger callbacks.
- Added missing macros for scan filter.
NimBLEClient::getLastError: Gets the error code of the last function call that produces a return code from the stack.
- Corrected a compiler/linker error when an application or a library uses bluetooth classic due to the redefinition of
btInUse.
-
NimBLECharacteristic::removeDescriptor: Dynamically remove a descriptor from a characteristic. Takes effect after all connections are closed and sends a service changed indication. -
NimBLEService::removeCharacteristic: Dynamically remove a characteristic from a service. Takes effect after all connections are closed and sends a service changed indication -
NimBLEServerCallbacks::onMTUChange: This is callback is called when the MTU is updated after connection with a client. -
ESP32C3 support
-
Whitelist API:
NimBLEDevice::whiteListAdd: Add a device to the whitelist.NimBLEDevice::whiteListRemove: Remove a device from the whitelist.NimBLEDevice::onWhiteList: Check if the device is on the whitelist.NimBLEDevice::getWhiteListCount: Gets the size of the whitelistNimBLEDevice::getWhiteListAddress: Get the address of a device on the whitelist by index value.
-
Bond management API:
NimBLEDevice::getNumBonds: Gets the number of bonds stored.NimBLEDevice::isBonded: Checks if the device is bonded.NimBLEDevice::deleteAllBonds: Deletes all bonds.NimBLEDevice::getBondedAddress: Gets the address of a bonded device by the index value.
-
NimBLECharacteristic::getCallbacksto retrieve the current callback handler. -
Connection Information class:
NimBLEConnInfo. -
NimBLEScan::clearDuplicateCache: This can be used to reset the cache of advertised devices so they will be immediately discovered again.
- 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.
NimBLECharacteristicCallbacks::onSubscribeIs 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.
-
NimBLECharacteristic::getDescriptorByHandle: Return the BLE Descriptor for the given handle. -
NimBLEDescriptor::getStringValue: Get the value of this descriptor as a string. -
NimBLEServer::getServiceByHandle: Get a service by its handle. -
NimBLEService::getCharacteristicByHandle: Get a pointer to the characteristic object with the specified handle. -
NimBLEService::getCharacteristics: Get the vector containing pointers to each characteristic associated with this service. Overloads to get a vector containing pointers to all the characteristics in a service with the UUID. (supports multiple same UUID's in a service)NimBLEService::getCharacteristics(const char *uuid)NimBLEService::getCharacteristics(const NimBLEUUID &uuid)
-
NimBLEAdvertisementDataNew methods:NimBLEAdvertisementData::addTxPower: Adds transmission power to the advertisement.NimBLEAdvertisementData::setPreferredParams: Adds connection parameters to the advertisement.NimBLEAdvertisementData::setURI: Adds URI data to the advertisement.
-
NimBLEAdvertisingNew methods:NimBLEAdvertising::setName: Set the name advertised.NimBLEAdvertising::setManufacturerData: Adds manufacturer data to the advertisement.NimBLEAdvertising::setURI: Adds URI data to the advertisement.NimBLEAdvertising::setServiceData: Adds service data to the advertisement.NimBLEAdvertising::addTxPower: Adds transmission power to the advertisement.NimBLEAdvertising::reset: Stops the current advertising and resets the advertising data to the default values.
-
NimBLEDevice::setScanFilterMode: Set the controller duplicate filter mode for filtering scanned devices. -
NimBLEDevice::setScanDuplicateCacheSize: Sets the number of advertisements filtered before the cache is reset. -
NimBLEScan::setMaxResults: This allows for setting a maximum number of advertised devices stored in the results vector. -
NimBLEAdvertisedDeviceNew data retrieval methods added:-
haveAdvInterval/getAdvInterval: checks if the interval is advertised / gets the advertisement interval value. -
haveConnParams/getMinInterval/getMaxInterval: checks if the parameters are advertised / get min value / get max value. -
haveURI/getURI: checks if a URI is advertised / gets the URI data. -
haveTargetAddress/getTargetAddressCount/getTargetAddress(index): checks if a target address is present / gets a count of the addresses targeted / gets the address of the target at index.
-
-
nimconfig.h(Arduino) is now easier to use. -
NimBLEServer::getServiceByUUIDNow takes an extra parameter of instanceID to support multiple services with the same UUID. -
NimBLEService::getCharacteristicNow takes an extra parameter of instanceID to support multiple characteristics with the same UUID. -
NimBLEAdvertisingTransmission power is no longer advertised by default and can be added to the advertisement by callingNimBLEAdvertising::addTxPower -
NimBLEAdvertisingCustom scan response data can now be used without custom advertisement. -
NimBLEScanNow uses the controller duplicate filter. -
NimBLEAdvertisedDeviceHas been refactored to store the complete advertisement payload and no longer parses the data from each advertisement. Instead the data will be parsed on-demand when the user application asks for specific data.
NimBLEHIDDeviceCharacteristics now use encryption, this resolves an issue with communicating with devices requiring encryption for HID devices.
-
NimBLEDevice::setOwnAddrTypeadded to enable the use of random and random-resolvable addresses, by asukiaaa -
New examples for securing and authenticating client/server connections, by mblasee.
-
NimBLEAdvertising::SetMinPreferredandNimBLEAdvertising::SetMinPreferredre-added. -
Conditional checks added for command line config options in
nimconfig.hto support custom configuration in platformio. -
NimBLEClient::setValueNow takes an extra bool parameterresponseto 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. -
NimBLEHIDDeviceclass added by wakwak-koba. -
NimBLEServerCallbacks::onDisconnectoverloaded callback added to provide a ble_gap_conn_desc parameter for the application to obtain information about the disconnected client. -
Conditional checks in
nimconfig.hfor command line defined macros to support platformio config settings.
-
NimBLEAdvertising::startnow returns a bool value to indicate success/failure. -
Some asserts were removed in
NimBLEAdvertising::startand 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::subscribeandNimBLERemoteCharacteristic::registerForNotifywill 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.
-
NimBLEScanWhen 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.
-
Sometimes
NimBLEClient::connectwould 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.
-
FreeRTOScompile 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.
-
NimBLEAdvertising::startNow 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 aNimBLEAdvertisingobject (similar to theNimBLEScan::startAPI). -
(Arduino) Maximum BLE connections can now be altered by only changing the value of
CONFIG_BT_NIMBLE_MAX_CONNECTIONSinnimconfig.h. Any changes to the controller max connection settings insdkconfig.hwill 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.
- Empty
NimBLEAddressconstructor: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.
- notify_callback typedef is now defined as std::function to enable the use of std::bind to call a class member function.
- Fix advertising start delay when first called.
First stable release.
All the original library functionality is complete and many extras added with full documentation.