Commit graph

13 commits

Author SHA1 Message Date
h2zero
a460eca1ef Update documentation
Co-authored-by: wakwak-koba <wakwak-koba@users.noreply.github.com>
2020-08-03 22:13:57 -06:00
h2zero
abdf6cda35
Add clearAll parameter to deinit() (#22)
* Add clearAll parameter to deinit()

Adds the ability to clear all resources consumed during BLE operation when deinitializing and shutting down BLE.
Useful when BLE is used intermittently or in a task that initializes, performs operations then deinitializes.

By setting the clearAll parameter to true all created BLE objects will be deleted, freeing the memory for other tasks.

Warning: This will invalidate any pointers that may be referencing the deleted objects.

* Add bool deleteCallbacks parameter to NimBLEServer::setCallbacks, if true (default) will delete the callback class when server is destructed.

* Delete scan results when scan is destructed.
2020-07-28 20:57:33 -06:00
h2zero
4723b1cc53
Server: Add onSubscribe() callback for characteristics. (#21)
Server: Add onSubscribe() callback for characteristics.

Adds a new method to NimBLECharacteristicCallbacks that gets called when a client
changes it's subscription status.

* Remove NimBLE2902 class.

As the NimBLE2902 class usefulness was only related to callback functions that were replaced
by the NimBLECharacteristicCallbacks:onSubscribe() method this removes the NimBLE2902 class and
moves all subscription handling to NimBLECharacteristic.

* Update documents and examples to reflect this change.

* Add getSubscribedCount() to get the number of subscribed clients.
2020-07-27 21:11:38 -06:00
h2zero
2a5df0c905
Add feature: remove service (#17)
* Get service handles on server start

* remove service + indicate service changed

* Reset gatt services when no connections active and services changed.

* NimBLEServer::createService can now be used any time and will send service changed
indication if server was already active.

* Add ability to remove advertised serviceUUIDS

* Adds addService() method to server to be allow user to re-add a service previously removed

* Add destructior to NimBLEServer, NimBLEService and NimBLECharacteristic to release allocated resources.
2020-07-13 21:24:07 -06:00
h2zero
aae2a8f1e3
Fix comments for doxygen (#16)
* Fix comments for doxygen

* Add documentation and update readme.
2020-07-08 19:27:26 -06:00
h2zero
0712f606f1
Don't send notifications to un-paired peers when READ_ENC set (#14)
* start security when peer subscribes to secured characteristic

* Don't send notifications to non-secure clients
2020-06-21 20:26:16 -06:00
h2zero
74f48f5d5e Remove semaphores, use task notifications instead. 2020-06-11 08:06:16 -06:00
h2zero
e987ad58b2 Refactor server code to use vectors instead of maps.
* Use critical sections to access characteristic/descriptor value data.

* Remove unnecessary code

* Create characteristic semaphore only if needed for indications.

* Fix advertising when not broadcasting a service.
2020-06-07 18:42:28 -06:00
h2zero
03cb7b21d9 Conditionally compile code for specific roles.
This allows NimBLE options in menuconfig to reduce code size based on
the roles selected (scan/advertising/central/peripheral).

Significant code space can be saved by removing unnecessary roles for the application.
2020-05-13 22:03:56 -06:00
h2zero
f0191eb1e6 Add ==,!= operators to NimBLEAddress, pass parameters by const reference. 2020-05-10 07:21:46 -06:00
h2zero
725807b619 Resync to arduino master 2020-04-23 15:17:09 -06:00
h2zero
3327a32341 Merge bugfix branch into master 2020-04-13 19:13:51 -06:00
h2zero
5d4332e945 Initial commit. 2020-03-29 17:44:20 -06:00