Commit graph

7 commits

Author SHA1 Message Date
h2zero
99ad62cdd4 Add template casting to readValue and advertisement data (#52)
The value returned by reading a remote characteristic or by getting a notification for it is kept in the class instance of the NimBLERemoteCharacteristic. This value can be accessed as a std::string type using the getValue() function.

This adds templates to read the value in the type used by the peripheral. The same functionality is implemented for getting the manufacturer data or the service data of an advertised device.
2020-05-29 20:02:26 -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
32e1022e67 Correct error in creation of NimBLEAddress from six bytes in a std::string
* Add creation of a NimBLEAddress from a std::string of 6 exactly bytes.

* Add creation of a NimBLEAddress from an empty string.
2020-05-18 10:11:54 -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
5d4332e945 Initial commit. 2020-03-29 17:44:20 -06:00