Commit graph

207 commits

Author SHA1 Message Date
h2zero
de59693f0f Add response parameter to NimBLEClient::setValue 2020-12-20 09:57:26 -07:00
h2zero
77f477f428 Add conditional checks to nimconfig to support command line defines.
* Support platformio config settings on command line.

* Update changelog.
2020-12-19 23:05:54 -07:00
Anthony Doud
7ed962d963 Fix crashing caused by calling time() in a critical section (#159)
* Fix for random notify crash in ISR context

Tested for stability over 30 minutes with a daisy chain of 3 esp32

Co-authored-by: h2zero <powellperalta@gmail.com>
2020-12-19 21:58:37 -07:00
h2zero
a85ac6ad5a Add connection desc param to disconnect callback. 2020-12-04 19:03:52 -07:00
h2zero
3e9a63a514 Correct flags for advertisement type. 2020-11-06 15:44:35 -07:00
wakwak_koba
8d550a6905 Fixed incomplete payload size calculation
* Fixed incomplete payload size calculation

* Disable tx_pwr_lvl when RSP is not possible
2020-10-24 07:57:17 -06:00
wakwak_koba
8e7fcafa9e Add NimBLEHIDDevice class 2020-10-13 19:55:51 -06:00
h2zero
22103af037 Allow scan start from scan complete callback.
* Correct comment in scan start
2020-10-13 19:49:45 -06:00
Guo-Rong Koh
a331cb05e9 NimBLEClient/ Add getCharacteristic() by handle.
* Add getCharacteristic() by handle.

Add a convenience method for getting a characteristic by the 16-bit
handle.
2020-09-23 19:44:11 -06:00
h2zero
d9e11ee630 Release 1.0.2 2020-09-13 21:37:13 -06:00
h2zero
91b5916cf4
Add duration and callback parameter to NimBLEAdvertising::start
* Adds functionality to advertise for a set duration, similar to NimBLEScan::start.
The first parameter being the duration (in seconds).
The second parameter is a pointer to a callback function that is invoked when advertising stops.

* NimBLEAdvertising::isAdvertising method added, returns true if advertising is currently active.
2020-09-13 20:36:59 -06:00
h2zero
1a52245012 Update documentation.
* typo fix
2020-09-13 20:02:15 -06:00
h2zero
8add6e86c4 Release v1.0.1 2020-09-02 19:45:08 -06:00
h2zero
10acb004dc NimBLEAddress: New constructor added to create blank addresses
* Docuement NimBLEAddress::getNative in migration docs.
2020-09-02 14:52:34 -06:00
Cornelius Munz
9cdf60d360 Change notify_callback typedef to enable the usage of member function as callback
With this change the callback function could be also a member function
2020-09-02 12:15:02 -06:00
h2zero
26b3ba3e8f Fix delayed advertising when first called. 2020-09-02 12:05:05 -06:00
h2zero
bd0c7992ef Update Readme 2020-08-22 10:57:57 -06:00
h2zero
47a1f753bc Release version 1.0.0 2020-08-22 10:51:44 -06:00
h2zero
34c6417b48 Add examples 2020-08-22 09:56:19 -06:00
h2zero
f672d04a90 Update Documentation. 2020-08-22 09:15:53 -06:00
h2zero
d3aa435448 NimBLEAdvertising: Remove setMin/maxPreferred methods.
* These methods were noop's and are now removed due to lack of usefulness and advertisment space consumed if used.
Applications can still manually set these values if desired using NimBLEAdvertisementData::addData.
2020-08-21 20:22:13 -06:00
h2zero
708afebbbf Fix compilation in IDF v4 2020-08-21 11:46:45 -06:00
h2zero
3b81d93d31 Update documentation. 2020-08-20 16:07:07 -06:00
Guo-Rong
88562bb310 Delete peer keys on key missing and retry.
On BLE_ERR_PINKEY_MISSING, delete the peer keys from the store and
retry the connection.
2020-08-20 09:57:20 -06:00
h2zero
4c751657ab
Merge pull request #30 from szroland/master
incorrect buffer index used when processing longer writes
2020-08-20 09:25:30 -06:00
Roland Szabo
5823703670 incorrect buffer index used when processing longer writes 2020-08-20 09:24:04 +02:00
h2zero
e9bb7eff65 Add doxygen comments in nimconfig.h 2020-08-18 15:02:57 -06:00
h2zero
74c9be3351
Update README.md
Fix link
2020-08-18 00:07:46 +00:00
h2zero
2da99504d8 Update Documentation 2020-08-17 13:45:13 -06:00
h2zero
a17f3199bd Fix client passkey callback value not sent to server. 2020-08-15 07:49:32 -06:00
h2zero
492bcf6f78 Add undefined getServiceUUIDCount() 2020-08-15 07:40:01 -06:00
h2zero
17d53432a6 Update documentation. 2020-08-14 13:25:50 -06:00
h2zero
1172df0a49 Fix travis deploy 2020-08-13 16:13:52 -06:00
h2zero
8136ae4d68
Update travis to use doxygen 1.8.19 (#28)
Use newer version of doxygen for better support of markdown files.
2020-08-13 15:53:47 -06:00
h2zero
cf6b0e9a5a Update Readme. 2020-08-08 07:29:45 -06:00
h2zero
a460eca1ef Update documentation
Co-authored-by: wakwak-koba <wakwak-koba@users.noreply.github.com>
2020-08-03 22:13:57 -06:00
h2zero
97832d4d95 Initialize peerAddress in client constructor.
Co-authored-by: wakwak-koba <wakwak-koba@users.noreply.github.com>
2020-08-03 22:13:57 -06:00
h2zero
73cec7a92a Remove type parameter from NimBLEClient::connect()
* The type is available in the NimBLEAddress parameter, no longer needed separately.

Co-authored-by: wakwak-koba <wakwak-koba@users.noreply.github.com>
2020-08-03 22:13:57 -06:00
h2zero
b901eeb1e5 Connect address type default to public.
* Cleanup logs.

Co-authored-by: wakwak-koba <wakwak-koba@users.noreply.github.com>
2020-08-03 22:13:57 -06:00
h2zero
8fbab09f53 Rename refreshServices to deleteAttributes in connect().
Minor semantic change for clarity.

Co-authored-by: wakwak-koba <wakwak-koba@users.noreply.github.com>
2020-08-03 22:13:57 -06:00
h2zero
33d0a732a6 Set peer address of client when creating the instance.
* Adds new client connect method that will connect to the address already set.

Co-authored-by: wakwak-koba <wakwak-koba@users.noreply.github.com>
2020-08-03 22:13:57 -06:00
h2zero
f3e0d66853 Remove advertisment type from advertised device string. 2020-08-03 20:25:48 -06:00
h2zero
28e9e3d79d Remove type from address string. 2020-08-03 07:33:11 -06:00
h2zero
353e5a6cb1 Fix compile error. 2020-08-01 20:17:12 -06:00
h2zero
1a5beaa7c0
Store address type in NimBLEAddress. (#25) 2020-07-30 14:57:47 -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
b2df8384b3
Add support for getting multiple services data from advertisments. (#20)
* Add support for getting multiple services data from advertisments.

* Adds new methods for getting advertised service data and UUIDS.
- getServiceData(index), gets the service data by index value.
- getServiceData(NimBLEUUID), gets the service data by UUID.
- getServiceDataCount(), gets the number of services with data advertised.

* Templates added for getServiceData(index) and getServiceData(NimBLEUUID)
  to be able to specify the data type returned by these methods
  Example:
      getServiceData<uint32_t>(NimBLEUUID("ABCD");

* Also added:
- getServiceUUID(index), gets the advertised service UUID by index value.
- getServiceUUIDCount(), gets the number of advertised services.
2020-07-28 20:09:54 -06:00
h2zero
f1a13d5949 Advertising: Add overloaded method for addData.
* Implements addData(char * data, size_t length) as an alternative to passing a std::string.
2020-07-27 21:38:22 -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
fe4586a3ca NimBLEScan: Add isScanning method.
Adds a method to check if the scan is currently running.

* Clear up some NimBLEScan method parameter semantics.
2020-07-23 20:18:41 -06:00