Commit graph

15 commits

Author SHA1 Message Date
h2zero
ef049ddf19 Fix compile errors in latest IDF (NimBLE 1.3.0) see (#37).
Const qualifiers were added to multiple struct members in NimBLE 1.3.0.
This solves compilation errors related to those.
2021-02-10 10:54:53 -07:00
h2zero
9527c41486 Refactor advertisedDevice (#181)
* Stores complete advertisement payload and only performs parsing on demand. The advertised data is no longer parsed automatically as it is discovered, instead it will be parsed to find only the data requested by the user application when it makes a call to do so. This saves processing time and approximately 2.4k in flash size, with the new methods listed below included.

Add more advertised device field methods:
* Adds haveAdvInterval/getAdvInterval - checks if the interval is advertised / gets the advertisement interval value.

* Adds haveConnParams/getMinInterval/getMaxInterval - checks if the parameters are advertised / get min value / get max value.

* Adds haveURI/getURI - checks if a URI is advertised / gets the URI data.

* Adds haveTargetAddress/getTargetAddressCount/getTargetAddress(index) - checks if a target address is present / gets a count of the addresses targeted / gets the address of the target at index.
2021-01-30 18:06:29 -07:00
h2zero
492bcf6f78 Add undefined getServiceUUIDCount() 2020-08-15 07:40:01 -06:00
h2zero
f3e0d66853 Remove advertisment type from advertised device string. 2020-08-03 20:25:48 -06:00
h2zero
1a5beaa7c0
Store address type in NimBLEAddress. (#25) 2020-07-30 14:57:47 -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
aae2a8f1e3
Fix comments for doxygen (#16)
* Fix comments for doxygen

* Add documentation and update readme.
2020-07-08 19:27:26 -06:00
h2zero
745f9c00ed Implement scan wantDuplicates parameter in callback registration.
Also adds:
* NimBLEScan::setDuplicateFilter() to tell the controller to filter duplicates
before sending the result to the host.

* NimBLEScan::setLimitedOnly() to tell the controller only report scan results
from devices advertising in limited discovery mode, i.e. directed advertising.

* NimBLEScan::setFilterPolicy() to set the filter policy i.e whitelist only devices.
2020-07-01 17:26:44 -06:00
h2zero
10f544f80a Update remote characteristic value from a notification
* Add NimBLERemoteCharacteristic::getValue(time_t *timestamp = nullptr) to get the latest remote characteristic and (optionally) it's timestamp.

* Added a timestamp to NimBLEAdvertisedDevice for the moment a device was scanned
2020-05-29 18:26:41 -06:00
h2zero
5667c97efe Add access to the adv type of remote device
Adds new method `uint8_t NimBLEAdvertisedDevice::getAdvType()`
to get the advertisement type of the found device.
2020-05-25 18:52:46 -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
fba7e0fd68 NimBLEAdvertisedDevice: Prevent adding dupicate service uuid's. 2020-05-07 22:30:58 -06:00
h2zero
74ba03e3a8 Add CMakeLists.txt.
Fix compilation in strict enviroments.
Fix compliation in IDF v4.0.
2020-03-31 20:16:27 -06:00
h2zero
5d4332e945 Initial commit. 2020-03-29 17:44:20 -06:00