mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-01-28 10:02:19 +01:00
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.
This commit is contained in:
@@ -725,6 +725,7 @@ uint16_t NimBLEClient::getMTU() {
|
||||
(*characteristic)->m_timestamp = time(nullptr);
|
||||
(*characteristic)->m_semaphoreReadCharEvt.give();
|
||||
}
|
||||
|
||||
if ((*characteristic)->m_notifyCallback != nullptr) {
|
||||
NIMBLE_LOGD(LOG_TAG, "Invoking callback for notification on characteristic %s",
|
||||
(*characteristic)->toString().c_str());
|
||||
|
||||
Reference in New Issue
Block a user