Tasmota/lib/libesp32_div/NimBLE-Arduino
Staars b8fd073467 rename .c to .cpp 2022-03-27 17:57:35 +02:00
..
docs NimBLE v1.36 (#14744) 2022-02-12 20:01:12 +01:00
examples NimBLE v1.36 (#14744) 2022-02-12 20:01:12 +01:00
src rename .c to .cpp 2022-03-27 17:57:35 +02:00
CHANGELOG.md NimBLE v1.36 (#14744) 2022-02-12 20:01:12 +01:00
LICENSE mv some ESP32 libs 2021-03-11 14:48:59 +01:00
README.md NimBLE 1.3.1 2021-08-22 15:52:00 +02:00
library.json NimBLE v1.36 (#14744) 2022-02-12 20:01:12 +01:00
library.properties NimBLE v1.36 (#14744) 2022-02-12 20:01:12 +01:00
tasmota_lib_changes.md NimBLE v1.36 (#14744) 2022-02-12 20:01:12 +01:00

README.md

Latest release Release Version Release Date

Need help? Have questions or suggestions? Join the Gitter

NimBLE-Arduino

A fork of the NimBLE stack restructured for compilation in the Ardruino IDE with a CPP library for use with ESP32.

Note for IDF users: This repo will not compile correctly in ESP-IDF. An ESP-IDF component version of this library can be found here.

This library significantly reduces resource usage and improves performance for ESP32 BLE applications as compared
with the bluedroid based library. The goal is to maintain, as much as reasonable, compatibility with the original
library but refactored to use the NimBLE stack. In addition, this library will be more actively developed and maintained
to provide improved capabilites and stability over the original.

Resource use improvement

(Original) BLE_client example comparison (Debug):

Arduino BLE Library

Sketch uses 1216377 bytes (58%) of program storage space.
Memory after connection: Free Heap: 171548

NimBLE-Arduino library

Sketch uses 617256 bytes (29%) of program storage space.
Memory after connection: Free Heap: 270336


(Original) BLE_notify example comparison (Debug):

Arduino BLE Library

Sketch uses 1208409 bytes (57%) of program storage space.
Memory after connection: Free Heap: 173300

NimBLE-Arduino library

Sketch uses 603432 bytes (28%) of program storage space.
Memory after connection: Free Heap: 269792

As shown: there is nearly a 50% reduction in flash use and approx. 100kB less ram consumed!

Installation

Arduino Library manager: Go to sketch -> Include Library -> Manage Libraries and search for NimBLE and install.

Alternatively: Download as .zip and extract to Arduino/libraries folder, or in Arduino IDE from Sketch menu -> Include library -> Add .Zip library.

#include "NimBLEDevice.h" at the beginning of your sketch.

Tested and working with esp32-arduino in Arduino IDE and platform IO.

Using

This library is intended to be compatible with the original ESP32 BLE functions and types with minor changes.

If you have not used the original Bluedroid library please refer to the New user guide.

If you are familiar with the original library, see: The migration guide for details about breaking changes and migration.

Also see Improvements_and_updates for information about non-breaking changes.

Full API documentation and class list can be found here.

For added performance and optimizations see Usage tips.

Check the Refactored_original_examples in the examples folder for highlights of the differences with the original library.

More advanced examples highlighting many available features are in examples/ NimBLE_Server, NimBLE_Client.

Beacon examples provided by @beegee-tokyo are in examples/ BLE_Beacon_Scanner, BLE_EddystoneTLM_Beacon, BLE_EddystoneURL_Beacon.

Change the settings in the src/nimconfig.h file to customize NimBLE to your project,
such as increasing max connections, default is 3, absolute maximum connections is 9.

Development Status

This Library is tracking the esp-nimble repo, nimble-1.3.0-idf master branch, currently @5bb7b40.

Also tracking the NimBLE related changes in ESP-IDF, master branch, currently @639e7ad.

Acknowledgments