Don't convert to null-terminated string prior to writeValue (#4473)

fixes: #4472
This commit is contained in:
snosrap 2020-11-02 08:34:57 -08:00 committed by GitHub
parent f7fb00632e
commit f39024675c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -535,7 +535,7 @@ std::string BLERemoteCharacteristic::toString() {
* @return N/A.
*/
void BLERemoteCharacteristic::writeValue(std::string newValue, bool response) {
writeValue((uint8_t*)newValue.c_str(), strlen(newValue.c_str()), response);
writeValue((uint8_t*)newValue.data(), newValue.length(), response);
} // writeValue