diff --git a/libraries/BLE/src/BLE2902.h b/libraries/BLE/src/BLE2902.h index 5cbf911ea4a..fc64dee98bd 100644 --- a/libraries/BLE/src/BLE2902.h +++ b/libraries/BLE/src/BLE2902.h @@ -56,9 +56,6 @@ This class will be removed in a future version.")]] BLE2902 : public BLEDescript bool getIndications(); void setNotifications(bool flag); void setIndications(bool flag); - - private: - friend class BLECharacteristic; }; // BLE2902 #endif /* CONFIG_BLUEDROID_ENABLED || CONFIG_NIMBLE_ENABLED */ diff --git a/libraries/BLE/src/BLE2904.h b/libraries/BLE/src/BLE2904.h index 87e8c03c048..25e899a5c58 100644 --- a/libraries/BLE/src/BLE2904.h +++ b/libraries/BLE/src/BLE2904.h @@ -95,8 +95,6 @@ class BLE2904 : public BLEDescriptor { void setUnit(uint16_t unit); private: - friend class BLECharacteristic; - /*************************************************************************** * Common private properties * ***************************************************************************/ diff --git a/libraries/BLE/src/BLEAddress.cpp b/libraries/BLE/src/BLEAddress.cpp index 11c64850367..fcd8b8cf693 100644 --- a/libraries/BLE/src/BLEAddress.cpp +++ b/libraries/BLE/src/BLEAddress.cpp @@ -59,13 +59,8 @@ BLEAddress::BLEAddress() { * @param [in] otherAddress The other address to compare against. * @return True if the addresses are equal. */ -bool BLEAddress::equals(BLEAddress otherAddress) { -#if defined(CONFIG_NIMBLE_ENABLED) - if (m_addrType != otherAddress.m_addrType) { - return false; - } -#endif - return memcmp(otherAddress.getNative(), m_address, ESP_BD_ADDR_LEN) == 0; +bool BLEAddress::equals(const BLEAddress &otherAddress) const { + return *this == otherAddress; } bool BLEAddress::operator==(const BLEAddress &otherAddress) const { @@ -116,9 +111,9 @@ uint8_t *BLEAddress::getNative() { * * @return The string representation of the address. */ -String BLEAddress::toString() { - auto size = 18; - char *res = (char *)malloc(size); +String BLEAddress::toString() const { + constexpr size_t size = 18; + char res[size]; #if defined(CONFIG_BLUEDROID_ENABLED) snprintf(res, size, "%02x:%02x:%02x:%02x:%02x:%02x", m_address[0], m_address[1], m_address[2], m_address[3], m_address[4], m_address[5]); @@ -129,7 +124,6 @@ String BLEAddress::toString() { #endif String ret(res); - free(res); return ret; } @@ -158,7 +152,7 @@ BLEAddress::BLEAddress(esp_bd_addr_t address) { * * @param [in] stringAddress The hex representation of the address. */ -BLEAddress::BLEAddress(String stringAddress) { +BLEAddress::BLEAddress(const String &stringAddress) { if (stringAddress.length() != 17) { return; } @@ -193,7 +187,7 @@ BLEAddress::BLEAddress(ble_addr_t address) { m_addrType = address.type; } -uint8_t BLEAddress::getType() { +uint8_t BLEAddress::getType() const { return m_addrType; } @@ -209,7 +203,7 @@ uint8_t BLEAddress::getType() { * @param [in] stringAddress The hex representation of the address. * @param [in] type The address type. */ -BLEAddress::BLEAddress(String stringAddress, uint8_t type) { +BLEAddress::BLEAddress(const String &stringAddress, uint8_t type) { if (stringAddress.length() != 17) { return; } diff --git a/libraries/BLE/src/BLEAddress.h b/libraries/BLE/src/BLEAddress.h index 71b3bdfce5f..52a9e4c75fd 100644 --- a/libraries/BLE/src/BLEAddress.h +++ b/libraries/BLE/src/BLEAddress.h @@ -62,7 +62,7 @@ class BLEAddress { ***************************************************************************/ BLEAddress(); - bool equals(BLEAddress otherAddress); + bool equals(const BLEAddress &otherAddress) const; bool operator==(const BLEAddress &otherAddress) const; bool operator!=(const BLEAddress &otherAddress) const; bool operator<(const BLEAddress &otherAddress) const; @@ -70,7 +70,7 @@ class BLEAddress { bool operator>(const BLEAddress &otherAddress) const; bool operator>=(const BLEAddress &otherAddress) const; uint8_t *getNative(); - String toString(); + String toString() const; /*************************************************************************** * Bluedroid public declarations * @@ -78,7 +78,7 @@ class BLEAddress { #if defined(CONFIG_BLUEDROID_ENABLED) BLEAddress(esp_bd_addr_t address); - BLEAddress(String stringAddress); + BLEAddress(const String &stringAddress); #endif /*************************************************************************** @@ -87,9 +87,9 @@ class BLEAddress { #if defined(CONFIG_NIMBLE_ENABLED) BLEAddress(ble_addr_t address); - BLEAddress(String stringAddress, uint8_t type = BLE_ADDR_PUBLIC); + BLEAddress(const String &stringAddress, uint8_t type = BLE_ADDR_PUBLIC); BLEAddress(uint8_t address[ESP_BD_ADDR_LEN], uint8_t type = BLE_ADDR_PUBLIC); - uint8_t getType(); + uint8_t getType() const; #endif private: diff --git a/libraries/BLE/src/BLEBeacon.cpp b/libraries/BLE/src/BLEBeacon.cpp index 0a6c6b05258..a40368719f6 100644 --- a/libraries/BLE/src/BLEBeacon.cpp +++ b/libraries/BLE/src/BLEBeacon.cpp @@ -62,7 +62,7 @@ int8_t BLEBeacon::getSignalPower() { return m_beaconData.signalPower; } -void BLEBeacon::setData(String data) { +void BLEBeacon::setData(const String &data) { if (data.length() != sizeof(m_beaconData)) { log_e("Unable to set the data ... length passed in was %d and expected %d", data.length(), sizeof(m_beaconData)); return; diff --git a/libraries/BLE/src/BLEBeacon.h b/libraries/BLE/src/BLEBeacon.h index e0eaddda6e4..31d2bf2789f 100644 --- a/libraries/BLE/src/BLEBeacon.h +++ b/libraries/BLE/src/BLEBeacon.h @@ -55,7 +55,7 @@ class BLEBeacon { uint16_t getManufacturerId(); BLEUUID getProximityUUID(); int8_t getSignalPower(); - void setData(String data); + void setData(const String &data); void setMajor(uint16_t major); void setMinor(uint16_t minor); void setManufacturerId(uint16_t manufacturerId); diff --git a/libraries/BLE/src/BLECharacteristic.cpp b/libraries/BLE/src/BLECharacteristic.cpp index a44f73294ba..c41cd9fcded 100644 --- a/libraries/BLE/src/BLECharacteristic.cpp +++ b/libraries/BLE/src/BLECharacteristic.cpp @@ -124,7 +124,7 @@ void BLECharacteristic::addDescriptor(BLEDescriptor *pDescriptor) { * @param [in] descriptorUUID The UUID of the descriptor that we wish to retrieve. * @return The BLE Descriptor. If no such descriptor is associated with the characteristic, nullptr is returned. */ -BLEDescriptor *BLECharacteristic::getDescriptorByUUID(const char *descriptorUUID) { +BLEDescriptor *BLECharacteristic::getDescriptorByUUID(const char *descriptorUUID) const { return m_descriptorMap.getByUUID(BLEUUID(descriptorUUID)); } // getDescriptorByUUID @@ -133,7 +133,7 @@ BLEDescriptor *BLECharacteristic::getDescriptorByUUID(const char *descriptorUUID * @param [in] descriptorUUID The UUID of the descriptor that we wish to retrieve. * @return The BLE Descriptor. If no such descriptor is associated with the characteristic, nullptr is returned. */ -BLEDescriptor *BLECharacteristic::getDescriptorByUUID(BLEUUID descriptorUUID) { +BLEDescriptor *BLECharacteristic::getDescriptorByUUID(BLEUUID descriptorUUID) const { return m_descriptorMap.getByUUID(descriptorUUID); } // getDescriptorByUUID @@ -141,7 +141,7 @@ BLEDescriptor *BLECharacteristic::getDescriptorByUUID(BLEUUID descriptorUUID) { * @brief Get the handle of the characteristic. * @return The handle of the characteristic. */ -uint16_t BLECharacteristic::getHandle() { +uint16_t BLECharacteristic::getHandle() const { return m_handle; } // getHandle @@ -151,14 +151,14 @@ void BLECharacteristic::setAccessPermissions(uint16_t perm) { #endif } -esp_gatt_char_prop_t BLECharacteristic::getProperties() { +esp_gatt_char_prop_t BLECharacteristic::getProperties() const { return m_properties; } // getProperties /** * @brief Get the service associated with this characteristic. */ -BLEService *BLECharacteristic::getService() { +BLEService *BLECharacteristic::getService() const { return m_pService; } // getService @@ -166,7 +166,7 @@ BLEService *BLECharacteristic::getService() { * @brief Get the UUID of the characteristic. * @return The UUID of the characteristic. */ -BLEUUID BLECharacteristic::getUUID() { +BLEUUID BLECharacteristic::getUUID() const { return m_bleUUID; } // getUUID @@ -174,7 +174,7 @@ BLEUUID BLECharacteristic::getUUID() { * @brief Retrieve the current value of the characteristic. * @return A pointer to storage containing the current characteristic value. */ -String BLECharacteristic::getValue() { +String BLECharacteristic::getValue() const { return m_value.getValue(); } // getValue @@ -190,7 +190,7 @@ uint8_t *BLECharacteristic::getData() { * @brief Retrieve the current length of the data of the characteristic. * @return Amount of databytes of the characteristic. */ -size_t BLECharacteristic::getLength() { +size_t BLECharacteristic::getLength() const { return m_value.getLength(); } // getLength @@ -425,7 +425,7 @@ void BLECharacteristic::setWriteProperty(bool value) { * @brief Return a string representation of the characteristic. * @return A string representation of the characteristic. */ -String BLECharacteristic::toString() { +String BLECharacteristic::toString() const { String res = "UUID: " + m_bleUUID.toString() + ", handle : 0x"; char hex[5]; snprintf(hex, sizeof(hex), "%04x", m_handle); @@ -452,7 +452,7 @@ String BLECharacteristic::toString() { return res; } // toString -BLECharacteristicCallbacks::~BLECharacteristicCallbacks() {} +BLECharacteristicCallbacks::~BLECharacteristicCallbacks() = default; // Common callbacks void BLECharacteristicCallbacks::onRead(BLECharacteristic *pCharacteristic) { diff --git a/libraries/BLE/src/BLECharacteristic.h b/libraries/BLE/src/BLECharacteristic.h index 52ca1898b55..1d4a81ff307 100644 --- a/libraries/BLE/src/BLECharacteristic.h +++ b/libraries/BLE/src/BLECharacteristic.h @@ -85,13 +85,13 @@ class BLEDescriptorMap { void setByUUID(const char *uuid, BLEDescriptor *pDescriptor); void setByUUID(BLEUUID uuid, BLEDescriptor *pDescriptor); void setByHandle(uint16_t handle, BLEDescriptor *pDescriptor); - BLEDescriptor *getByUUID(const char *uuid); - BLEDescriptor *getByUUID(BLEUUID uuid); - BLEDescriptor *getByHandle(uint16_t handle); - String toString(); + BLEDescriptor *getByUUID(const char *uuid) const; + BLEDescriptor *getByUUID(BLEUUID uuid) const; + BLEDescriptor *getByHandle(uint16_t handle) const; + String toString() const; BLEDescriptor *getFirst(); BLEDescriptor *getNext(); - int getRegisteredDescriptorCount(); + int getRegisteredDescriptorCount() const; void removeDescriptor(BLEDescriptor *pDescriptor); /*************************************************************************** @@ -181,12 +181,12 @@ class BLECharacteristic { virtual ~BLECharacteristic(); void addDescriptor(BLEDescriptor *pDescriptor); - BLEDescriptor *getDescriptorByUUID(const char *descriptorUUID); - BLEDescriptor *getDescriptorByUUID(BLEUUID descriptorUUID); - BLEUUID getUUID(); - String getValue(); + BLEDescriptor *getDescriptorByUUID(const char *descriptorUUID) const; + BLEDescriptor *getDescriptorByUUID(BLEUUID descriptorUUID) const; + BLEUUID getUUID() const; + String getValue() const; uint8_t *getData(); - size_t getLength(); + size_t getLength() const; void indicate(); void notify(bool is_notification = true); void setCallbacks(BLECharacteristicCallbacks *pCallbacks); @@ -197,10 +197,10 @@ class BLECharacteristic { void setValue(int data32); void setValue(float data32); void setValue(double data64); - String toString(); - uint16_t getHandle(); + String toString() const; + uint16_t getHandle() const; void setAccessPermissions(uint16_t perm); - esp_gatt_char_prop_t getProperties(); + esp_gatt_char_prop_t getProperties() const; void setReadProperty(bool value); void setWriteProperty(bool value); void setNotifyProperty(bool value); @@ -253,7 +253,7 @@ class BLECharacteristic { ***************************************************************************/ void executeCreate(BLEService *pService); - BLEService *getService(); + BLEService *getService() const; void setHandle(uint16_t handle); /*************************************************************************** diff --git a/libraries/BLE/src/BLECharacteristicMap.cpp b/libraries/BLE/src/BLECharacteristicMap.cpp index ec3588bcde4..ceb71460379 100644 --- a/libraries/BLE/src/BLECharacteristicMap.cpp +++ b/libraries/BLE/src/BLECharacteristicMap.cpp @@ -36,7 +36,7 @@ * @param [in] handle The handle to look up the characteristic. * @return The characteristic. */ -BLECharacteristic *BLECharacteristicMap::getByHandle(uint16_t handle) { +BLECharacteristic *BLECharacteristicMap::getByHandle(uint16_t handle) const { return m_handleMap.at(handle); } // getByHandle @@ -45,7 +45,7 @@ BLECharacteristic *BLECharacteristicMap::getByHandle(uint16_t handle) { * @param [in] UUID The UUID to look up the characteristic. * @return The characteristic. */ -BLECharacteristic *BLECharacteristicMap::getByUUID(const char *uuid) { +BLECharacteristic *BLECharacteristicMap::getByUUID(const char *uuid) const { return getByUUID(BLEUUID(uuid)); } @@ -54,7 +54,7 @@ BLECharacteristic *BLECharacteristicMap::getByUUID(const char *uuid) { * @param [in] UUID The UUID to look up the characteristic. * @return The characteristic. */ -BLECharacteristic *BLECharacteristicMap::getByUUID(BLEUUID uuid) { +BLECharacteristic *BLECharacteristicMap::getByUUID(BLEUUID uuid) const { for (auto &myPair : m_uuidMap) { if (myPair.first->getUUID().equals(uuid)) { return myPair.first; @@ -95,7 +95,7 @@ BLECharacteristic *BLECharacteristicMap::getNext() { * @brief Get the number of registered characteristics. * @return The number of registered characteristics. */ -int BLECharacteristicMap::getRegisteredCharacteristicCount() { +int BLECharacteristicMap::getRegisteredCharacteristicCount() const { return m_uuidMap.size(); } // getRegisteredCharacteristicCount @@ -133,7 +133,7 @@ void BLECharacteristicMap::setByUUID(BLECharacteristic *pCharacteristic, BLEUUID * @brief Return a string representation of the characteristic map. * @return A string representation of the characteristic map. */ -String BLECharacteristicMap::toString() { +String BLECharacteristicMap::toString() const { String res; int count = 0; char hex[5]; diff --git a/libraries/BLE/src/BLEDescriptor.cpp b/libraries/BLE/src/BLEDescriptor.cpp index 6e6df767dc4..9490f87e766 100644 --- a/libraries/BLE/src/BLEDescriptor.cpp +++ b/libraries/BLE/src/BLEDescriptor.cpp @@ -109,7 +109,7 @@ void BLEDescriptor::executeCreate(BLECharacteristic *pCharacteristic) { * @brief Get the BLE handle for this descriptor. * @return The handle for this descriptor. */ -uint16_t BLEDescriptor::getHandle() { +uint16_t BLEDescriptor::getHandle() const { return m_handle; } // getHandle @@ -117,14 +117,14 @@ uint16_t BLEDescriptor::getHandle() { * @brief Get the length of the value of this descriptor. * @return The length (in bytes) of the value of this descriptor. */ -size_t BLEDescriptor::getLength() { +size_t BLEDescriptor::getLength() const { return m_value.attr_len; } // getLength /** * @brief Get the UUID of the descriptor. */ -BLEUUID BLEDescriptor::getUUID() { +BLEUUID BLEDescriptor::getUUID() const { return m_bleUUID; } // getUUID @@ -132,7 +132,7 @@ BLEUUID BLEDescriptor::getUUID() { * @brief Get the value of this descriptor. * @return A pointer to the value of this descriptor. */ -uint8_t *BLEDescriptor::getValue() { +uint8_t *BLEDescriptor::getValue() const { return m_value.attr_value; } // getValue @@ -140,7 +140,7 @@ uint8_t *BLEDescriptor::getValue() { * @brief Get the characteristic this descriptor belongs to. * @return A pointer to the characteristic this descriptor belongs to. */ -BLECharacteristic *BLEDescriptor::getCharacteristic() { +BLECharacteristic *BLEDescriptor::getCharacteristic() const { return m_pCharacteristic; } // getCharacteristic @@ -215,14 +215,14 @@ void BLEDescriptor::setAccessPermissions(uint16_t perm) { * @brief Return a string representation of the descriptor. * @return A string representation of the descriptor. */ -String BLEDescriptor::toString() { +String BLEDescriptor::toString() const { char hex[5]; snprintf(hex, sizeof(hex), "%04x", m_handle); String res = "UUID: " + m_bleUUID.toString() + ", handle: 0x" + hex; return res; } // toString -BLEDescriptorCallbacks::~BLEDescriptorCallbacks() {} +BLEDescriptorCallbacks::~BLEDescriptorCallbacks() = default; /** * @brief Callback function to support a read request. diff --git a/libraries/BLE/src/BLEDescriptor.h b/libraries/BLE/src/BLEDescriptor.h index 1e4f80f8ac5..a1e1444f121 100644 --- a/libraries/BLE/src/BLEDescriptor.h +++ b/libraries/BLE/src/BLEDescriptor.h @@ -89,18 +89,18 @@ class BLEDescriptor { BLEDescriptor(BLEUUID uuid, uint16_t max_len = 100); virtual ~BLEDescriptor(); - uint16_t getHandle(); // Get the handle of the descriptor. - size_t getLength(); // Get the length of the value of the descriptor. - BLEUUID getUUID(); // Get the UUID of the descriptor. - uint8_t *getValue(); // Get a pointer to the value of the descriptor. - BLECharacteristic *getCharacteristic(); // Get the characteristic that this descriptor belongs to. + uint16_t getHandle() const; // Get the handle of the descriptor. + size_t getLength() const; // Get the length of the value of the descriptor. + BLEUUID getUUID() const; // Get the UUID of the descriptor. + uint8_t *getValue() const; // Get a pointer to the value of the descriptor. + BLECharacteristic *getCharacteristic() const; // Get the characteristic that this descriptor belongs to. void setAccessPermissions(uint16_t perm); // Set the permissions of the descriptor. void setCallbacks(BLEDescriptorCallbacks *pCallbacks); // Set callbacks to be invoked for the descriptor. void setValue(const uint8_t *data, size_t size); // Set the value of the descriptor as a pointer to data. void setValue(const String &value); // Set the value of the descriptor as a data buffer. - String toString(); // Convert the descriptor to a string representation. + String toString() const; // Convert the descriptor to a string representation. /*************************************************************************** * Bluedroid public declarations * diff --git a/libraries/BLE/src/BLEDescriptorMap.cpp b/libraries/BLE/src/BLEDescriptorMap.cpp index e0c8b3a7cc3..635fddfb428 100644 --- a/libraries/BLE/src/BLEDescriptorMap.cpp +++ b/libraries/BLE/src/BLEDescriptorMap.cpp @@ -52,7 +52,7 @@ * @param [in] UUID The UUID to look up the descriptor. * @return The descriptor. If not present, then nullptr is returned. */ -BLEDescriptor *BLEDescriptorMap::getByUUID(const char *uuid) { +BLEDescriptor *BLEDescriptorMap::getByUUID(const char *uuid) const { return getByUUID(BLEUUID(uuid)); } @@ -61,7 +61,7 @@ BLEDescriptor *BLEDescriptorMap::getByUUID(const char *uuid) { * @param [in] UUID The UUID to look up the descriptor. * @return The descriptor. If not present, then nullptr is returned. */ -BLEDescriptor *BLEDescriptorMap::getByUUID(BLEUUID uuid) { +BLEDescriptor *BLEDescriptorMap::getByUUID(BLEUUID uuid) const { for (auto &myPair : m_uuidMap) { if (myPair.first->getUUID().equals(uuid)) { return myPair.first; @@ -76,7 +76,7 @@ BLEDescriptor *BLEDescriptorMap::getByUUID(BLEUUID uuid) { * @param [in] handle The handle to look up the descriptor. * @return The descriptor. */ -BLEDescriptor *BLEDescriptorMap::getByHandle(uint16_t handle) { +BLEDescriptor *BLEDescriptorMap::getByHandle(uint16_t handle) const { return m_handleMap.at(handle); } // getByHandle @@ -114,7 +114,7 @@ void BLEDescriptorMap::setByHandle(uint16_t handle, BLEDescriptor *pDescriptor) * @brief Get the number of registered descriptors. * @return The number of registered descriptors. */ -int BLEDescriptorMap::getRegisteredDescriptorCount() { +int BLEDescriptorMap::getRegisteredDescriptorCount() const { return m_uuidMap.size(); } @@ -132,7 +132,7 @@ void BLEDescriptorMap::removeDescriptor(BLEDescriptor *pDescriptor) { * @brief Return a string representation of the descriptor map. * @return A string representation of the descriptor map. */ -String BLEDescriptorMap::toString() { +String BLEDescriptorMap::toString() const { String res; char hex[5]; int count = 0; diff --git a/libraries/BLE/src/BLEService.h b/libraries/BLE/src/BLEService.h index 67088b60310..6efdf687748 100644 --- a/libraries/BLE/src/BLEService.h +++ b/libraries/BLE/src/BLEService.h @@ -61,13 +61,13 @@ class BLECharacteristicMap { void setByUUID(BLECharacteristic *pCharacteristic, const char *uuid); void setByUUID(BLECharacteristic *pCharacteristic, BLEUUID uuid); void setByHandle(uint16_t handle, BLECharacteristic *pCharacteristic); - BLECharacteristic *getByUUID(const char *uuid); - BLECharacteristic *getByUUID(BLEUUID uuid); - BLECharacteristic *getByHandle(uint16_t handle); + BLECharacteristic *getByUUID(const char *uuid) const; + BLECharacteristic *getByUUID(BLEUUID uuid) const; + BLECharacteristic *getByHandle(uint16_t handle) const; BLECharacteristic *getFirst(); BLECharacteristic *getNext(); - String toString(); - int getRegisteredCharacteristicCount(); + String toString() const; + int getRegisteredCharacteristicCount() const; void removeCharacteristic(BLECharacteristic *characteristic); /*************************************************************************** diff --git a/libraries/BLE/src/BLEValue.cpp b/libraries/BLE/src/BLEValue.cpp index 6559766cfea..5b80b9cc88f 100644 --- a/libraries/BLE/src/BLEValue.cpp +++ b/libraries/BLE/src/BLEValue.cpp @@ -91,7 +91,7 @@ uint8_t *BLEValue::getData() { * @brief Get the length of the data in bytes. * @return The length of the data in bytes. */ -size_t BLEValue::getLength() { +size_t BLEValue::getLength() const { return m_value.length(); } // getLength @@ -99,14 +99,14 @@ size_t BLEValue::getLength() { * @brief Get the read offset. * @return The read offset into the read. */ -uint16_t BLEValue::getReadOffset() { +uint16_t BLEValue::getReadOffset() const { return m_readOffset; } // getReadOffset /** * @brief Get the current value. */ -String BLEValue::getValue() { +String BLEValue::getValue() const { return m_value; } // getValue diff --git a/libraries/BLE/src/BLEValue.h b/libraries/BLE/src/BLEValue.h index 6a1b7cfd7e4..10d2d9d3d3c 100644 --- a/libraries/BLE/src/BLEValue.h +++ b/libraries/BLE/src/BLEValue.h @@ -39,9 +39,9 @@ class BLEValue { void cancel(); void commit(); uint8_t *getData(); - size_t getLength(); - uint16_t getReadOffset(); - String getValue(); + size_t getLength() const; + uint16_t getReadOffset() const; + String getValue() const; void setReadOffset(uint16_t readOffset); void setValue(const String &value); void setValue(const uint8_t *pData, size_t length);