Commit graph

233 commits

Author SHA1 Message Date
h2zero
123825d483 Fix health model fault reporting. 2022-04-13 20:42:34 -06:00
h2zero
5b206b97a3 Update include directives. 2022-04-13 20:42:28 -06:00
h2zero
08a3e676f8 Add files to cmake. 2022-04-13 20:41:42 -06:00
h2zero
356459d352 Merge branch 'master' into mesh 2022-04-13 20:40:18 -06:00
h2zero
9e5db157f8
Add extended advertising support. (#72)
Adds support for advertising and connections with coded/2M PHY's.

Adds new classes `NimBLEExtAdvertising` and `NimBLEExtAdvertisement`.
When extended advertising is enabled the original advertising classes become unavailable and the new classes must be used.

Changed some return values for advertising methods for consistency with the new classes methods.
2022-04-10 10:21:45 -06:00
h2zero
58787b516b Prevent crash when characteristic vector is empty. 2022-04-02 14:22:23 -06:00
h2zero
a1428e63a6 Fixup client logs. 2022-02-20 10:04:13 -07:00
h2zero
0f4326d3fd Check characteristic handles before fetching descriptors. 2022-02-20 10:02:09 -07:00
h2zero
f414a5ac73 Release v1.3.3 2022-02-15 20:33:02 -07:00
h2zero
99a23d3c19 Remove recursive calling when fetching remote attributes. 2022-02-15 20:32:18 -07:00
h2zero
6cda761f13 Fix memory leak when deleting client instance. 2022-02-15 20:31:26 -07:00
jvrobert
288ee92d39
Added extended advertising scan support (#69) 2022-02-06 16:52:42 -07:00
h2zero
2e498cef2b Fix IDF version check. 2022-02-06 12:58:26 -07:00
h2zero
2386a8a68a Retrieve attributes with 16bit uuid if 128bit fails.
When retrieving attribute handles using the 128bit base version of a 16 bit UUID some devices will
report "not found". This will attempt to convert the UUID to the 16bit version and try again.

* Adds `to16()` method to NimBLEUUID.
2022-01-18 14:48:07 -07:00
h2zero
6b858a0efd Fix memory leak when services changed. 2022-01-18 14:44:47 -07:00
h2zero
e3ee082dd7
Add NimBLEAttValue class. (#67)
This is a specialized container class to hold BLE attribute values.

- Removes the use of std::string previously used to store the values.
- Allows for setting/getting/notifying values from std::string, std::vector<uint8_t>, Arduino String, const char*, and uint8_t buffers.
- Has operators retrieve the value as std::string, Arduino String, std::vector<uint8_t>, uint8_t* or char pointers.
- Includes iterators and subscript/random access operator.
- Introduces a max length parameter to the creation of server characteristics/descriptors to limit the size of the memory footprint.
- Nearly Seamless integration with existing code.
- Adds a config option to enable/disable timestamp storage when the value is updated.
- Adds a config option to specify the initial size of the value container if not specified in the constructor.
2022-01-16 20:11:18 -07:00
h2zero
be9cdc1ab6 Update docs 2022-01-15 15:21:41 -07:00
h2zero
cf482f9112 Cleanup ARM-gcc compiler warnings. 2022-01-15 12:43:17 -07:00
h2zero
bbed8d1d4b Release v1.3.2 2022-01-15 09:07:08 -07:00
h2zero
099e7cc326 Remove travis docs build. 2022-01-15 08:57:40 -07:00
h2zero
830c4cc39e Re-enable data length extension newer IDF versions. 2022-01-15 08:51:49 -07:00
Jackson Ming Hu
ea6e2101e3 Fix compilation on ESP32-S3 2022-01-14 21:46:30 -07:00
h2zero
d47cf59ba9 Cleanup compile errors in arm-gcc. 2022-01-14 20:45:24 -07:00
h2zero
ea02eb9452 Add config option for log verbosity. 2022-01-14 19:47:44 -07:00
h2zero
798726c05d Update change log. 2022-01-14 10:32:47 -07:00
h2zero
9824bdfe73 Update log level macro name 2022-01-14 10:02:47 -07:00
h2zero
fac16f2428 Fix long data notifications.
The notification data when received was using an incorrect length value and would cut off long values, this has now been corrected.
2022-01-13 08:57:50 -07:00
h2zero
0957d7f6ad The latest versions of IDF include a new esp_timer library that seems to be incrementing the task notification values in unexpected places depending on other tasks in operation.
This causes task blocking to fail in client operations leading to exceptions and crashing.

This is a workaround for this situation and will need to be reworked properly in the future.
2022-01-09 19:04:41 -07:00
David Lehrian
5facd89a00
Update NimBLEServer.h (#65) 2022-01-01 18:00:45 -07:00
h2zero
f2ade345f4 Fix missing data when reading large values.
The wrong length value was being used to set the values read from peer attributes.
This has been corrected to use the proper value size.
2021-12-29 14:01:37 -07:00
h2zero
7a82067177 Add last error function to client. 2021-12-29 08:12:38 -07:00
h2zero
d041a089e6 [NimBLEService] Remove unused variables/parameters. 2021-12-29 08:12:07 -07:00
h2zero
9debfcd226 Use NimBLE calls for critical sections 2021-12-29 08:10:57 -07:00
h2zero
8620092c90 Cleanup and add support for non-esp devices. 2021-12-29 08:08:25 -07:00
h2zero
96459073a4 Initialize advertising complete callback in NimBLEAdvertising constructor.
* cleanup advertising start return.
2021-12-29 07:51:57 -07:00
h2zero
a4403fe6b8 Clear client disconnect timer in constructor before initializing. 2021-12-29 07:50:42 -07:00
David Robertson
f841f030ae
Add method to send notifications/indications with custom values (#63) 2021-12-28 20:11:37 -07:00
h2zero
d793b1251e Remove data length extension in IDF (not released yet) 2021-09-13 20:45:36 -06:00
Author: Mr-Mime
5925782a65 [Server][Client] Add function to set data length.
Enables the use of BLE data length extension to improve data transfer rates.
2021-09-12 19:11:38 -06:00
h2zero
ccea428b9e Refactor include directives to use different paths for arduino/idf.
* Sets macros to allow compiling when Central role is enabled and Observer disabled, or Peripheral enabled and Broadcaster disabled.

* Adds a macro definition for CONFIG_NIMBLE_CPP_IDF to enable different include paths/functionality for IDF / Arduino.
2021-09-12 18:43:31 -06:00
h2zero
06e2d188b1 Update to work with NimBLE core changes. 2021-09-06 09:15:44 -06:00
h2zero
afb76b8cb6 Implement health server callbacks. 2021-09-06 09:14:46 -06:00
h2zero
56c68d7eea Add support for app created health server models. 2021-09-06 09:14:46 -06:00
h2zero
bceda5a8cf Update example 2021-09-06 09:14:46 -06:00
h2zero
799a7a84db Use std::vector instead of std::string for values. 2021-09-06 09:14:45 -06:00
h2zero
6de87945e7 Implement set/get values and add templates. 2021-09-06 09:14:45 -06:00
h2zero
dc7d9d5b73 Use std::string for internal values 2021-09-06 09:14:45 -06:00
h2zero
06037f8bf6 Return NimBLEMeshModel pointer from NimBLEMeshElement::createModel 2021-09-06 09:14:45 -06:00
h2zero
4d78c3013b Add publish methods to server models. 2021-09-06 09:14:45 -06:00
h2zero
bc2e11637e Add transition and delay timers to models.
* Remove level server setDelta() callback as it is unnecessary.

* Add target value and remaining time to status messages.
2021-09-06 09:14:45 -06:00