- Add NimBLEL2CAPChannel::disconnect() and getConnHandle().
- Fix CoC TX mbuf ownership handling in writeFragment():
treat BLE_HS_ENOMEM / BLE_HS_EAGAIN as consumed buffer,
only free local tx mbuf on BLE_HS_EBUSY.
- Refresh L2CAP client/server examples for stress testing and
runtime stats.
- Pin example dependency mickeyl/esp-hpl to tag 1.1.0.
- Clean trailing whitespace in updated example sources.
Closes#391
This fixes a bug introduced when sorting the characteristic vector where the last item on in the vector was
returned but the characteristc wasn't at the end anymore.
This reverts the previous sorting of the vector after retrieval and instead sorts as the characteristics are found and also
provides a pointer to the characteristic from the retrieval callback.
This resolves the issue of retrieving characteristics out of handle order and then trying to subscribe or
do some other fetch of a descriptor belonging to that characteristic and the search handle was limited
to the handle of the next characteristic in the vector.
This ensures that the vector is sorted in ascending order based on handle values so the next characteristic
in the vector will always have a higher handle value and the desciptor serach will function as intended.
* Delay onConnect until connection is likely established using a timer (7x conn interval), with early completion on peer activity.
* Suppress onDisconnect for 0x3e and route terminal 0x3e failures to onConnectFail.
* Add configurable 0x3e reconnect attempts via `setConnectRetries` or client config (default 2).
* Retry logic suppresses callbacks while retrying; callbacks fire only on final outcome.
* Refactor connect-start path into a shared helper used by initial connect and retries.
This adds better client state tracking so that functions like NimBLEDevice::getDisconnectedClient get a more accurate state and will not return a connecting client.
This also fixes the client self delete on connection error where function call errors did not delete the client
This reverts changing NimBLEServer::serviceChanged from private to public and adds a new function that is more user firendly to indicate to clients that the services should be re-discovered.
* Renames serviceChanged to setServiceChanged to better indicate its function.
This ensures that the callback will be called within the configured time (in ms) when devices fail to respond to a scan response request within that time.
* Adds stats when debug logging to help tune the scan response timeout/scan parameters.
* [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.
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.
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.
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.
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.
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.
Adds a new overloaded callback to NimBLECharacteristicCallbacks for the notification/indication onStatus method that provides a NimBLEConnInfo reference.
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.
Extended advertisement reports would be truncated incorrectly as the handler was not checking the data status.
Correct advertisement length and set status on update.
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.
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.
Calling NimBLEDevice::deint with the `clearAll` parameter set to `true` will delete the scan and any scan results but it was calling `clearall` which uses critical sections, this could cause a crash because the stack has already been de-initialized.
When the client created by the server reads or writes to an attribute and it triggers a pairing action the task will not be released because the client does not get the event.
This passes the event to the client to prevent the task from being hung.
/** @brief NimBLE-Arduino library major version number. */
#define NIMBLE_CPP_VERSION_MAJOR 3
#define NIMBLE_CPP_VERSION_MAJOR 2
/** @brief NimBLE-Arduino library minor version number. */
#define NIMBLE_CPP_VERSION_MINOR 0
#define NIMBLE_CPP_VERSION_MINOR 5
/** @brief NimBLE-Arduino library patch version number. */
#define NIMBLE_CPP_VERSION_PATCH 0
@@ -58,7 +58,7 @@
* @details Include the leading '-' when defined, for example: "-beta.1"
*/
#ifndef NIMBLE_CPP_VERSION_PRERELEASE
# define NIMBLE_CPP_VERSION_PRERELEASE "-dev"
# define NIMBLE_CPP_VERSION_PRERELEASE ""
#endif
/**
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.