Turnouts stored in NVS. More...
#include <turnouts.hpp>
Public Member Functions | |
| Turnouts () | |
| mw::dcc::NvTurnoutBase | get (dcc::Address::value_type addr) const |
| Get turnout by address. | |
| mw::dcc::NvTurnoutBase | get (std::string const &key) const |
| Get turnout by key. | |
| esp_err_t | set (dcc::Address::value_type addr, mw::dcc::NvTurnoutBase const &loco) |
| Set turnout from address. | |
| esp_err_t | set (std::string const &key, mw::dcc::NvTurnoutBase const &loco) |
| Set turnout from key. | |
| esp_err_t | erase (dcc::Address::value_type addr) |
| Erase turnout from address. | |
| Public Member Functions inherited from mem::nvs::Base | |
| auto | begin () const |
| auto | cbegin () const |
| auto | end () const |
| auto | cend () const |
| esp_err_t | find (std::string const &key) const |
| Lookup key-value pair with given key name. | |
| esp_err_t | erase (std::string const &key) |
| Erase key-value pair with given key name. | |
| esp_err_t | eraseAll () |
| Erase all key-value pairs in a namespace. | |
Additional Inherited Members | |
| Protected Member Functions inherited from mem::nvs::Base | |
| Base (char const *namespace_name, nvs_open_mode_t open_mode) | |
| Ctor. | |
| ~Base () | |
| Dtor. | |
| std::string | getBlob (std::string const &key) const |
| Get blob value for given key. | |
| esp_err_t | setBlob (std::string const &key, std::string_view str) |
| Set blob value for given key. | |
| uint8_t | getU8 (std::string const &key) const |
| Get uint8_t value for given key. | |
| esp_err_t | setU8 (std::string const &key, uint8_t value) |
| Set uint8_t value for given key. | |
| uint8_t | getU16 (std::string const &key) const |
| Get uint16_t value for given key. | |
| esp_err_t | setU16 (std::string const &key, uint16_t value) |
| Set uint16_t value for given key. | |
|
inline |
| esp_err_t mem::nvs::Turnouts::erase | ( | dcc::Address::value_type | addr | ) |
| addr | Address |
| ESP_OK | Erase operation was successful |
| ESP_FAIL | Internal error |
| ESP_ERR_NVS_NOT_FOUND | Requested key doesn't exist |
| mw::dcc::NvTurnoutBase mem::nvs::Turnouts::get | ( | dcc::Address::value_type | addr | ) | const |
| addr | Address |
| mw::dcc::NvTurnoutBase mem::nvs::Turnouts::get | ( | std::string const & | key | ) | const |
| addr | key |
| esp_err_t mem::nvs::Turnouts::set | ( | dcc::Address::value_type | addr, |
| mw::dcc::NvTurnoutBase const & | turnout ) |
| addr | Address |
| turnout | Turnout |
| ESP_OK | Value was set successfully |
| ESP_FAIL | Internal error |
| ESP_ERR_NVS_INVALID_NAME | Key name doesn't satisfy constraints |
| ESP_ERR_NVS_NOT_ENOUGH_SPACE | Not enough space |
| ESP_ERR_NVS_REMOVE_FAILED | Value wasn't updated because flash write operation has failed |
| ESP_ERR_NVS_VALUE_TOO_LONG | String value is too long |
| esp_err_t mem::nvs::Turnouts::set | ( | std::string const & | key, |
| mw::dcc::NvTurnoutBase const & | turnout ) |
| key | Key |
| turnout | Turnout |
| ESP_OK | Value was set successfully |
| ESP_FAIL | Internal error |
| ESP_ERR_NVS_INVALID_NAME | Key name doesn't satisfy constraints |
| ESP_ERR_NVS_NOT_ENOUGH_SPACE | Not enough space |
| ESP_ERR_NVS_REMOVE_FAILED | Value wasn't updated because flash write operation has failed |
| ESP_ERR_NVS_VALUE_TOO_LONG | String value is too long |