Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 76ff27d

Browse files
committedDec 2, 2024·
[preferences] returning the response of the modem when putting bytes
1 parent 8e297d0 commit 76ff27d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎libraries/Preferences/src/Preferences.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ size_t Preferences::putBytes(const char* key, const void* value, size_t len) {
178178
string res = "";
179179
if ( key != nullptr && strlen(key) > 0 && value != nullptr && len > 0) {
180180
modem.write_nowait(string(PROMPT(_PREF_PUT)), res, "%s%s,%d,%d\r\n", CMD_WRITE(_PREF_PUT), key, PT_BLOB, len);
181-
if(modem.passthrough((uint8_t *)value, len)) {
182-
return len;
181+
if(modem.passthrough((uint8_t *)value, len, &res)) {
182+
return atoi(res.c_str());
183183
}
184184
}
185185
return 0;

0 commit comments

Comments
 (0)
Please sign in to comment.