Streamlined NVS recall for String values
Avoids need for intermediate variable
This commit is contained in:
parent
9e3f6c8303
commit
c4e88d7df0
|
|
@ -635,9 +635,8 @@ class SpanCharacteristic{
|
|||
}
|
||||
} else {
|
||||
if(!nvs_get_str(homeSpan.charNVS,nvsKey,NULL,&len)){
|
||||
char c[len];
|
||||
nvs_get_str(homeSpan.charNVS,nvsKey,c,&len);
|
||||
uvSet(value,(const char *)c);
|
||||
value.STRING = (char *)HS_REALLOC(value.STRING,len);
|
||||
nvs_get_str(homeSpan.charNVS,nvsKey,value.STRING,&len);
|
||||
}
|
||||
else {
|
||||
nvs_set_str(homeSpan.charNVS,nvsKey,value.STRING); // store string data
|
||||
|
|
|
|||
Loading…
Reference in New Issue