Releases: h2zero/NimBLE-Arduino
Releases · h2zero/NimBLE-Arduino
2.1.2
2.1.1
Fixed
NimBLEHIDDevice::getOutputReport
will now return the correct characteristic.- Compile error when central is disabled, class
NimBLEServer
has no member namedm_pClient
. - Compile error with nRF devices, unresolved symbol
nimble_port_stop
.
Changed
- Added missing includes for
NimBLEConnInfo
andNimBLEUtils
toNimBLEDevice.h
.
2.1.0
Finally! A new release with something more than a bugfix or some minor additions!
I'm excited to present this release properly after the unfortunate Arduino Library Manager debacle 🎉.
This was a complete overhaul of the codebase, every file as been touched up and some completely re-designed, removed, added, or changed significantly. This required A LOT of changes, many will break your current application code, but don't worry, it will be much better!
This release has so much in it!
Highlights
- Reduced the code size by over 40KB.
- Significant reduction in memory use.
- Huge performance boost.
- Asynchronous client connect, MTU exchange, and secure connection options to speed up the connecting process.
- Asynchronous passkey entry/confirmation so the client/server can have time to properly display/enter the passkey before action is performed.
- Scan restart option to clear the duplicate cache so the same devices will be found again.
- New scan callbacks class with extra functions that will get called on first discovery, before and scan response data is received.
- Ability to update advertised data while advertising.
- Improved support for dynamically changing services/characteristics/descriptors.
- Simplified code for easier maintenance and understanding for contributors.
Full Changelog
Breaking changes
- NimBLESecurity class removed.
- All connection oriented callbacks now receive a reference to
NimBLEConnInfo
, theble_gap_conn_desc
has also been replace withNimBLEConnInfo
in the functions that received it. - All functions that take a time input parameter now expect the value to be in milliseconds instead of seconds.
NimBLEDevice
Ignore list functions removed.NimBLEDevice::startSecurity
now returns abool
, true on success, instead of an int to be consistent with the rest of the library.NimBLEDevice::getInitialized
renamed toNimBLEDevice::isInitialized
.NimBLEDevice::setPower
no longer takes theesp_power_level_t
andesp_ble_power_type_t
, instead only an integer value in dbm units is accepted.NimBLEDevice::setOwnAddrType
no longer takes abool nrpa
parameter.NimBLEDevice::getClientListSize
replaced withNimBLEDevice::getCreatedClientCount
.NimBLEDevice::getClientList
was removed.NimBLEServer::disconnect
now returnsbool
, true = success, instead ofint
to be consistent with the rest of the library.NimBLEServer::getPeerIDInfo
renamed toNimBLEServer::getPeerInfoByHandle
to better describe it's use.NimBLEServerCallbacks::onMTUChanged
renamed toNimBLEServerCallbacks::onMTUChange
to be consistent with the client callback.NimBLEServerCallbacks::onPassKeyRequest
has been replaced withNimBLEServer::onPassKeyDisplay
which should display the pairing pin that the client is expected to send.NimBLEServerCallbacks::onAuthenticationComplete
now takes aNimBLEConnInfo&
parameter.NimBLEClient::getServices
now returns a const reference to std::vector<NimBLERemoteService*> instead of a pointer to the internal vector.NimBLEClient::getConnId
has been renamed togetConnHandle
to be consistent with bluetooth terminology.NimBLEClient::disconnect
now returns abool
, true on success, instead of an int to be consistent with the rest of the library.NimBLEClientCallbacks::onDisconnect
now takes an additionalint reason
parameter to let the application know why the disconnect occurred.NimBLEClientCallbacks::onPassKeyRequest
has been changed toNimBLEClientCallbacks::onPassKeyEntry
which takes aNimBLEConnInfo&
parameter 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::onConfirmPIN
renamed toNimBLEClientCallbacks::onConfirmPasskey
and no longer returns a value and now takes aNimBLEConnInfo&
parameter. 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::setMinPreferred
andNimBLEAdvertising::setMaxPreferred
have been removed, useNimBLEAdvertising::setPreferredParams
instead.- Advertising the name and TX power of the device will no longer happen by default and should be set manually by the application.
NimBLEAdvertising::setAdvertisementType
has been renamed toNimBLEAdvertising::setConnectableMode
to better reflect it's function.NimBLEAdvertising::setScanResponse
has been renamed toNimBLEAdvertising::enableScanResponse
to better reflect it's function.NimBLEAdvertising
; Scan response is no longer enabled by default.NimBLEAdvertising::start
No longer takes a callback pointer parameter, instead the new methodNimBLEAdvertising::setAdvertisingCompleteCallback
should be used.NimBLEAdvertisementData::addData
now takes either astd::vector<uint8_t>
oruint8_t* + length
instead ofstd::string
orchar + length
.NimBLEAdvertisementData::getPayload
now returnsstd::vector<uint8_t>
instead ofstd::string
.- The callback parameter for
NimBLEScan::start
has been removed and the blocking overload ofNimBLEScan::start
has been replaced by an overload ofNimBLEScan::getResults
with the same parameters. NimBLEAdvertisedDeviceCallbacks
Has been replaced byNimBLEScanCallbacks
which contains the following methods:onResult
,onScanEnd
, and `onDiscovered-
NimBLEScanCallbacks::onResult
, functions the same as the oldNimBLEAdvertisedDeviceCallbacks::onResult
but now takes aaconst NimBLEAdvertisedDevice*
instead of non-const.
-
NimBLEScanCallbacks::onScanEnd
, replaces the scanEnded callback passed toNimBLEScan::start
and now takes aconst NimBLEScanResults&
andint reason
parameter.
-
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::stop
will no longer call theonScanEnd
callback as the caller should know its been stopped when this is called.NimBLEScan::clearDuplicateCache
has been removed as it was problematic and only for the esp32. Stop and start the scanner for the same effect.NimBLEScanResults::getDevice
methods now returnconst NimBLEAdvertisedDevice*
.NimBLEScanResults
iterators are nowconst_iterator
.NimBLEService::getCharacteristics
now returns aconst std::vector<NimBLECharacteristic*>&
instead of std::vector<NimBLECharacteristic *>.NimBLECharacteristic::notify
no longer takes abool is_notification
parameter, insteadindicate()
should be called to send indications.NimBLECharacteristicCallbacks::onNotify
removed as unnecessary, the library does not call notify without app input.NimBLECharacteristicCallbacks::onStatus
No longer takes astatus
parameter, refer to the return code for success/failure.NimBLERemoteService::getCharacteristics
now returns aconst std::vector<NimBLERemoteCharacteristic*>&
instead of non-conststd::vector<NimBLERemoteCharacteristic*>*
.NimBLERemoteService::getValue
now returnsNimBLEAttValue
instead ofstd::string
.NimBLERemoteCharacteristic::getRemoteService
now returns aconst NimBLERemoteService*
instead of non-const.NimBLERemoteCharacteristic::readUInt32
Has been removed.NimBLERemoteCharacteristic::readUInt16
Has been removed.NimBLERemoteCharacteristic::readUInt8
Has been removed.NimBLERemoteCharacteristic::readFloat
Has been removed.NimBLERemoteCharacteristic::registerForNotify
Has been removed.NimBLEAdvertisedDevice::hasRSSI
removed as redundant, RSSI is always available.NimBLEAdvertisedDevice::getPayload
now returnsconst std::vector<uint8_t>
instead of a pointer to internal memory.NimBLEAdvertisedDevice
Timestamp removed, if needed then the app should track the time from the callback.NimBLEAddress
constructor; default value for thetype
parameter removed, caller should know the address type and specify it.NimBLEAddress::getNative
replaced withNimBLEAddress::getBase
and now returns a pointer toconst ble_addr_t
instead of a pointer to the address value.NimBLEAddress::equals
method andNimBLEAddress::== operator
will now also test if the address types are the same.NimBLEUUID::getNative
method replaced withNimBLEUUID::getBase
which returns a read-only pointer to the underlyingble_uuid_t
struct.NimBLEUUID
;msbFirst
parameter has been removed from constructor, caller should reverse the data first or call the newreverseByteOrder
method after.NimBLEUtils::dumpGapEvent
function removed.NimBLEUtils::buildHexData
replaced withNimBLEUtils::dataToHexString
, which returns astd::string
containing the hex string.- Removed Eddystone URL as it has been shutdown by google since 2021.
NimBLEEddystoneTLM::setTemp
now takes anint16_t
parameter instead of float to be friendly to devices without floating point support.NimBLEEddystoneTLM::getTemp
now returnsint16_t
to work with devices that don't have floating point support.NimBLEEddystoneTLM::setData
now takes a reference to *NimBLEEddystoneTLM::BeaconData
instead ofstd::string
.NimBLEEddystoneTLM::getData
now returns a reference to *NimBLEEddystoneTLM::BeaconData
instead ofstd::string
.NimBLEBeacon::setData
now takesconst NimBLEBeacon::BeaconData&
instead ofstd::string
.NimBLEBeacon::getData
now returnsconst NimBLEBeacon::BeaconData&
instead ofstd::string
.NimBLEHIDDevice::reportMap
renamed toNimBLEHIDDevice::getReportMap
.NimBLEHIDDevice::hidControl
renamed toNimBLEHIDDevice::getHidControl
.NimBLEHIDDevice::inputReport
renamed toNimBLEHIDDevice::getInputReport
.- `NimBLEHIDDevice::o...
1.4.3
1.4.2
What's Changed
- Fix Typo by @fabdelgado in #472
- Fix CONFIG_BT_NIMBLE_NVS_PERSIST value not being used. by @h2zero in #520
- Update build/release workflows and Doxyfile by @h2zero in #524
- Add directed peer address parameter to advertising start. by @h2zero in #507
- Expose advertisement flags in NimBLEAdvertisedDevice by @lultimouomo in #504
- Add index parameter for multiple manufacturer data sets. by @h2zero in #506
- Update NimBLE core to esp-nimble @0fc6282 by @h2zero in #499
- Set service handle in getHandle function if not set already. by @h2zero in #544
- Update example to initialize pAdvertising after NimBLEDevice::init() by @ankgt in #545
- Set manufacturer data directly instead of converting from string by @eighty2fifty1 in #529
- Add generic advertisement 'type' functions by @jcontrerasf in #575
- Added nimble_port_freertos_get_hs_hwm() visibility for ESP32 platform by @devmirek in #654
- Bug fix on PNP info by @afpineda in #519
- Fix Error in converting EddystoneTLM negative temperatures to float by @Max93 in #677
- Remove IPC calls in the esp32 HCI. by @h2zero in #681
- Add clearData method to NimBLEAdvertisementData. by @h2zero in #683
- Remove asserts in NimBLECharacteristic read/write. by @h2zero in #684
- Rename "TAG" to "LOG_TAG" to avoid conflict with Arduino core. by @h2zero in #682
New Contributors
- @fabdelgado made their first contribution in #472
- @lultimouomo made their first contribution in #504
- @ankgt made their first contribution in #545
- @eighty2fifty1 made their first contribution in #529
- @jcontrerasf made their first contribution in #575
- @devmirek made their first contribution in #654
- @afpineda made their first contribution in #519
- @Max93 made their first contribution in #677
Full Changelog: 1.4.1...1.4.2
1.4.1
What's Changed
- Fix getPower return value by @0xxon in #443
- Update CHANGELOG.md to include config options by @j4m3s in #450
- Fix pairing when already in progress. by @h2zero in #469
- Revert 42201d4, app should specify response when (un)subscribing. by @h2zero in #470
New Contributors
Full Changelog: 1.4.0...1.4.1
BT5 and nRF5 support
[1.4.0] - 2022-07-10
Fixed
- Fixed missing data from long notification values.
- Fixed NimbleCharacteristicCallbacks::onRead not being called when a non-long read command is received.
Changed
- 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.
Added
- Preliminary support for non-esp devices, NRF51 and NRF52 devices supported with n-able arduino core
- Alias added for
NimBLEServerCallbacks::onMTUChange
toonMtuChanged
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.
Release 1.3.8
Fixed
- Fix compile error with ESP32S3.
- Prevent a potential crash when retrieving characteristics from a service if the result was successful but no characteristics found.
Changed
- 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
1.3.7
1.3.6
Changed
- 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.
Fixed
- 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 unintialized advertising callback pointer.