15 bool save(
const uint8_t *data,
size_t len)
override;
16 bool load(uint8_t *data,
size_t len)
override;
25 bool reset()
override;
29 return make_preference(length, type,
false);
32 bool save(uint32_t key,
const uint8_t *data,
size_t len) {
36 std::vector vec(data, data + len);
37 this->data[key] = vec;
41 bool load(uint32_t key, uint8_t *data,
size_t len) {
45 if (this->data.count(key) == 0)
47 auto vec = this->data[key];
48 if (vec.size() !=
len)
50 memcpy(data, vec.data(),
len);
56 bool setup_complete_{};
57 std::string filename_{};
58 std::map<uint32_t, std::vector<uint8_t>> data{};
bool load(uint32_t key, uint8_t *data, size_t len)
bool save(const uint8_t *data, size_t len) override
HostPreferences * host_preferences
ESPPreferenceObject make_preference(size_t length, uint32_t type) override
bool load(uint8_t *data, size_t len) override
bool save(uint32_t key, const uint8_t *data, size_t len)
HostPreferenceBackend(uint32_t key)
Implementation of SPI Controller mode.