Move error codes out of nvs/nvs_handle headers and into nvs_errc.hpp
Rename espp::NVSHandle -> espp::NvsHandle
Add espp::NvsHandle::get(key, value, default, error_code) which allows a get_or_set paradigm to configure default if no value is present
Refactor espp::Nvs to use espp::NvsHandle which greatly simplifies espp::Nvs and allows for maximum code reuse.
Motivation and Context
After #257 we had duplicated code for managing nvs stored data. That PR provided a nice espp::NvsHandle implementation, which could be used to replace and simplify the implementation of espp::Nvs.
This PR performs that refactor, and updates the espp::NvsHandle to have all the necessary overloads to do so.
How has this been tested?
Building and running the nvs/example on a QtPy ESP32S3 and rebooting it through enough cycles to erase the flash.
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
When erasing the flash:
After erasing the flash:
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation Update
[ ] Hardware (schematic, board, system design) change
[x] Software change
Checklist:
[ ] My change requires a change to the documentation.
[ ] I have added / updated the documentation related to this change via either README or WIKI
Software
[ ] I have added tests to cover my changes.
[ ] I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
[x] All new and existing tests passed.
[x] My code follows the code style of this project.
Description
espp::NVSHandle
->espp::NvsHandle
espp::NvsHandle::get(key, value, default, error_code)
which allows a get_or_set paradigm to configure default if no value is presentespp::Nvs
to useespp::NvsHandle
which greatly simplifiesespp::Nvs
and allows for maximum code reuse.Motivation and Context
After #257 we had duplicated code for managing nvs stored data. That PR provided a nice
espp::NvsHandle
implementation, which could be used to replace and simplify the implementation ofespp::Nvs
.This PR performs that refactor, and updates the
espp::NvsHandle
to have all the necessary overloads to do so.How has this been tested?
Building and running the
nvs/example
on a QtPy ESP32S3 and rebooting it through enough cycles to erase the flash.Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
When erasing the flash:
After erasing the flash:
Types of changes
Checklist:
Software
.github/workflows/build.yml
file to add my new test to the automated cloud build github action.