Skip to content

Commit

Permalink
[preferences] returning the response of the modem when putting bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Dec 2, 2024
1 parent 8e297d0 commit 76ff27d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/Preferences/src/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ size_t Preferences::putBytes(const char* key, const void* value, size_t len) {
string res = "";
if ( key != nullptr && strlen(key) > 0 && value != nullptr && len > 0) {
modem.write_nowait(string(PROMPT(_PREF_PUT)), res, "%s%s,%d,%d\r\n", CMD_WRITE(_PREF_PUT), key, PT_BLOB, len);
if(modem.passthrough((uint8_t *)value, len)) {
return len;
if(modem.passthrough((uint8_t *)value, len, &res)) {
return atoi(res.c_str());
}
}
return 0;
Expand Down

0 comments on commit 76ff27d

Please sign in to comment.