Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
d057e544
Commit
d057e544
authored
Aug 14, 2018
by
lbernstone
Committed by
Me No Dev
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a freeEntries method to Preferences library (#1722)
parent
b05430cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
libraries/Preferences/src/Preferences.cpp
libraries/Preferences/src/Preferences.cpp
+10
-0
libraries/Preferences/src/Preferences.h
libraries/Preferences/src/Preferences.h
+1
-0
No files found.
libraries/Preferences/src/Preferences.cpp
View file @
d057e544
...
...
@@ -468,3 +468,13 @@ size_t Preferences::getBytes(const char* key, void * buf, size_t maxLen){
}
return
len
;
}
size_t
Preferences
::
freeEntries
()
{
nvs_stats_t
nvs_stats
;
esp_err_t
err
=
nvs_get_stats
(
NULL
,
&
nvs_stats
);
if
(
err
){
log_e
(
"Failed to get nvs statistics"
);
return
0
;
}
return
nvs_stats
.
free_entries
;
}
libraries/Preferences/src/Preferences.h
View file @
d057e544
...
...
@@ -64,6 +64,7 @@ class Preferences {
size_t
getString
(
const
char
*
key
,
char
*
value
,
size_t
maxLen
);
String
getString
(
const
char
*
key
,
String
defaultValue
=
String
());
size_t
getBytes
(
const
char
*
key
,
void
*
buf
,
size_t
maxLen
);
size_t
freeEntries
();
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment