511 Commits

Author SHA1 Message Date
h2zero dd1b884c41 Release 2.4.0 2.4.0 2026-03-20 19:20:15 -06:00
h2zero d3f5063ace [Bugfix] getBondedAddress index could go out of array bounds. 2026-03-20 18:50:41 -06:00
h2zero 2db8fedb77 Cleanup compiler warnings when using HID device or bonds disabled. 2026-03-20 18:50:39 -06:00
copilot-swe-agent[bot] 56580cbf51 Add NimBLECppVersion.h with version macros and runtime version function
Co-authored-by: h2zero <32826625+h2zero@users.noreply.github.com>
2026-03-20 18:50:36 -06:00
Ryan Powell 9d6e48caa4 [Bugfix] NimBLEDevice::createServer can crash if stack not initialized.
* [Bugfix] NimBLEDevice::createServer can crash if stack not initialized.

This removes the gatts/gap reset calls from NimBLEDevice::createServer so that it can be safely used before initializing the stack.

This also deprecates NimBLEService::start the the services will now be added/created only when the server is started.
2026-03-20 18:50:34 -06:00
copilot-swe-agent[bot] 83fb1dfef8 Add onPassKeyEntry to NimBLEServerCallbacks and onPassKeyDisplay to NimBLEClientCallbacks
Co-authored-by: h2zero <32826625+h2zero@users.noreply.github.com>
2026-03-20 18:50:32 -06:00
h2zero 4cf0e7c705 [Bugfix] Delete all bonds does not allow re-pairing.
This change iterates through each bond and unpairs it rather than just deleting the bond data in nvs, allowing a connected peer to rebond.
2026-03-20 18:50:11 -06:00
h2zero ee325395d5 [Bugfix] Missing notification data when length > 255 bytes
When the ACL buffer is less than the MTU, the data arrives in more than one mbuf.
This combines the data from the mbuf chain and stores it before calling the appliation callback, ensuring it has all the data.
2026-03-20 18:49:54 -06:00
h2zero 1b6f152ae7 Update build workflow - remove IDF v4.x builds 2026-03-20 18:49:51 -06:00
h2zero ee8ea37ebb Add BLE stream classes.
Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
2026-03-20 18:49:43 -06:00
Stijn Eijndhoven 8c51a9027c Restore comment for disable_observer_mode field 2026-03-20 18:49:37 -06:00
Stijn Eijndhoven c87b76e997 Conditionally guard disable_observer_mode behind ESP_PLATFORM and CONFIG_USING_NIMBLE_COMPONENT 2026-03-20 18:49:35 -06:00
Stijn Eijndhoven 84c5b05b27 Use designated initializer for NimBLEScan::m_scanParams and guard disable_observer_mode field for ESP-IDF >= 5.4.2
The NimBLEScan constructor previously used positional struct initialization,
which no longer matches the ble_gap_disc_params layout in newer ESP-IDF
versions (>= 5.4.2) where the field `disable_observer_mode` was added.

This is caused by -Wmissing-field-initializers.

Switch to designated initializers to make the field assignments explicit
and more robust across ESP-IDF/NimBLE revisions. The new field is only
initialized when building against ESP-IDF 5.4.2 or later to maintain
backwards compatibility.
2026-03-20 18:49:28 -06:00
copilot-swe-agent[bot] da13bcc74c [Bugfix] whitelist bounds checks
Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
2026-03-20 18:49:15 -06:00
h2zero 363c142d25 Properly set attribute handles and improve dynamic service changes
This changes how attribute handles are set so they can be correctly identified when there is more than one attribute with the same UUID.
Instead of reading from the stack by UUID to get the handles this will now use the registration callback to set them correctly.

This also improves handling of dynamic service changes by properly removing characteristics/descriptors when required and resetting the GATT when advertising is started instead of after the last client disconnects.

* Adds NimBLEUUID constructor overload for ble_uuid_t*.
* NimBLECharacteristic::getDescriptorByUUID now takes an optional index value to support multiple same-uuid descriptors.
2026-03-20 18:49:08 -06:00
h2zero 5e33d2659d Add NimBLEConnInfo::toString method. 2026-03-20 18:48:57 -06:00
h2zero 27a9df6d77 Use a single macro to detect if scan duplicate filtering is enabled 2026-03-20 18:48:44 -06:00
h2zero a78ea43be9 Fix kconfig warnings
Redefining the kconfig BLE options for the esp32p4 is no longer needed as
bluetooth support is enabled in newer esp-idf versions and can be added to
the project config if older versions are used.
2026-03-20 18:48:35 -06:00
h2zero 095150e0b7 Release 2.3.4 2.3.4 2025-12-27 08:33:26 -07:00
h2zero 7e4df1907e Add void pointer argument to setCustomGapHandler. 2025-12-08 17:13:29 -07:00
hjlee 43c59bf6ff Fix descriptor search range in retrieveDescriptors()
The previous implementation incorrectly used the service's end handle
when searching for descriptors, which caused it to retrieve descriptors
from subsequent characteristics as well.

This fix calculates the correct end handle by finding the next
characteristic's handle and using (next_handle - 1) as the search limit.
This ensures only descriptors belonging to the current characteristic
are retrieved.

Fixes incorrect descriptor retrieval when multiple characteristics
exist in the same service.
2025-12-04 14:23:13 -07:00
iranl d0557b6af0 Add support for esp32c61 2025-12-04 14:23:10 -07:00
h2zero de587b3319 Add characteristic callbacks onStatus overload with conn info.
Adds a new overloaded callback to NimBLECharacteristicCallbacks for the notification/indication onStatus method that provides a NimBLEConnInfo reference.
2025-12-04 14:23:07 -07:00
h2zero 1f0957a873 Refactor notify/indicate
This refactors the handling of sending notifications and indications for greater efficiency.
* Adds client subscription state tracking to NimBLECharacteristic rather than relying on the stack.
* Notifications/indications are now sent directly, no longer calling the callback to read the values.
  This avoids delays and flash writes in the stack, allowing for greater throughput.
2025-12-04 14:23:05 -07:00
srgg dda2d5a79a correct container byte size calculation to writeValue, notify, and indicate 2025-12-04 14:23:02 -07:00
srgg 01e33e18c3 fix: correct byte size calculation for ATT values set from containers 2025-12-04 14:22:58 -07:00
h2zero ec5e5d3fcc [Bugfix] make sure the notify event is sent to server created clients 2025-10-24 13:30:08 -06:00
Quentin F 13b06b760b Update 1.x_to2.x_migration_guide.md 2025-10-24 13:30:05 -06:00
Guo-Rong 38aba3e999 Find client by handle during disconnect event.
If the peer has RPA enabled, searching by address fails due to address
resolution.
If this occurs, attempt to find the client by connection handle.
2025-10-24 13:30:00 -06:00
Chris Morgan 14a1c484bb Usage_tips.md - Note that the library is threadsafe. 2025-10-24 13:29:56 -06:00
Chris Morgan f2b0388be8 README.md - Add a note about threadsafety 2025-10-24 13:29:53 -06:00
Chris Morgan 788215fa83 Usage_tips.md - 'Device Local Name' information to help guide setting the GATT Device Name or Advertising name. 2025-10-24 13:29:49 -06:00
Chris Morgan 7af9191cf3 Usage_tips.md - Detail persisted bonds limitations and considerations relative to CONFIG_BT_NIMBLE_MAX_CCCDS 2025-10-24 13:29:46 -06:00
h2zero 66d6e2aa58 Convert NIMBLE_CPP macros to MYNEWT. 2025-10-24 13:29:37 -06:00
h2zero 1d6d43f48a Update workflows + add release publish 2025-10-24 13:09:22 -06:00
h2zero 815c5556e0 Release 2.3.3 2.3.3 2025-09-05 16:11:57 -06:00
h2zero 14f8737c41 Support up to 1650 bytes of advertisement with extended advertising. 2025-09-05 16:11:54 -06:00
h2zero 5b4e4bd7dc [Bugfix] Extended advertisements not reporting full data.
Extended advertisement reports would be truncated incorrectly as the handler was not checking the data status.

Correct advertisement length and set status on update.
2025-09-05 16:11:51 -06:00
h2zero 91f9b979d4 [Bugfix] NimBLEAdvertisedDevice::isConnectable incorrect result 2025-09-05 16:11:49 -06:00
h2zero f80605aff8 Release 2.3.2 2.3.2 2025-09-02 14:54:56 -06:00
h2zero e26c7406fb Improve macros for code enablement 2025-09-02 14:42:46 -06:00
h2zero a547f2529a Fix docs build 2025-09-02 14:42:42 -06:00
h2zero ad145ad503 Fix build with idf v5.5+ and specific roles are defined. 2025-09-02 14:42:40 -06:00
h2zero ecc617f9eb Refactor to use MYNEWT_VAL macros.
This replaces the previously prefixed CONFIG_BT_X config macros with the underlying MYNEWT_VAL_X config macros that they affected.
2025-09-02 14:42:38 -06:00
iranl 485a01b78c Fix undefined reference to ble_svc_gap_device_name_set when GATT server is disabled (#349)
* Fix undefined reference to ble_svc_gap_device_name_set when GATT server is disabled

* Do not affect ESP-IDF <5.5.0
2025-09-02 14:42:32 -06:00
h2zero f0ca3bf35d [Bugfix] OnConnectfail not called when connection not established.
Workaround for when the disconnect event is sent when no connection has been established.
Espressif changed this from a connect event with error code to disconnect event.
2025-09-02 14:42:30 -06:00
h2zero ac55482b18 Change default security settings to BLE secure connections off.
Fixing some connection issues when enabled, users should enable if desired.
2025-09-02 14:42:28 -06:00
h2zero 8b9e430e5b [Bugfix](workaround) OnConnect not being called.
Upstream changes have resulted in a possible status of BLE_ERR_UNSUPP_REM_FEATURE, this resulted in the onConnect callback not being called despite the connection actually being created.
This works around that bug to ensure that the connections are correctly tracked.
2025-09-02 14:42:26 -06:00
h2zero 6da9905235 Fix build with idf versions < 5.x 2025-09-02 14:42:23 -06:00
h2zero 18cc463c2c [Bugfix] allow peripheral and central roles without broadcast/scan. 2025-09-02 14:42:21 -06:00