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
This commit is contained in:
h2zero
2020-05-29 18:26:41 -06:00
parent 5667c97efe
commit 10f544f80a
7 changed files with 37 additions and 6 deletions

View File

@@ -143,6 +143,7 @@ NimBLEScan::NimBLEScan() {
advertisedDevice->parseAdvertisement(&fields);
advertisedDevice->setScan(pScan);
advertisedDevice->setAdvertisementResult(event->disc.data, event->disc.length_data);
advertisedDevice->m_timestamp = time(nullptr);
if (pScan->m_pAdvertisedDeviceCallbacks) {
// If not active scanning report the result to the listener.