ESPHome
2026.8.1
Loading...
Searching...
No Matches
esphome
components
libretiny
preferences.h
Go to the documentation of this file.
1
#pragma once
2
#ifdef USE_LIBRETINY
3
4
#include "
esphome/core/preference_backend.h
"
5
#include <flashdb.h>
6
7
namespace
esphome::libretiny
{
8
9
struct
NVSData;
10
11
class
LibreTinyPreferences
final :
public
PreferencesMixin
<LibreTinyPreferences> {
12
public
:
13
using
PreferencesMixin
<
LibreTinyPreferences
>
::make_preference
;
14
void
open
();
15
ESPPreferenceObject
make_preference
(
size_t
length
,
uint32_t
type
,
bool
in_flash) {
16
return
this->
make_preference
(length,
type
);
17
}
18
ESPPreferenceObject
make_preference
(
size_t
length
,
uint32_t
type
);
20
bool
load_from_key
(
uint32_t
type
, uint8_t *data,
size_t
len
);
21
bool
sync
();
22
bool
reset
();
23
24
struct
fdb_kvdb
db
;
25
struct
fdb_blob
blob
;
26
27
protected
:
28
LibreTinyPreferenceBackend
make_backend_
(
uint32_t
type
);
29
bool
is_changed_
(fdb_kvdb_t
db
,
const
NVSData &to_save,
const
char
*key_str);
30
};
31
32
void
setup_preferences
();
33
34
}
// namespace esphome::libretiny
35
36
DECLARE_PREFERENCE_ALIASES(
esphome::libretiny::LibreTinyPreferences
)
37
38
#endif
// USE_LIBRETINY
esphome::ESPPreferenceObject
Definition
preference_backend.h:57
esphome::PreferencesMixin
CRTP mixin providing type-safe template make_preference<T>() helpers.
Definition
preference_backend.h:118
esphome::libretiny::LibreTinyPreferenceBackend
Definition
preference_backend.h:15
esphome::libretiny::LibreTinyPreferences
Definition
preferences.h:11
esphome::libretiny::LibreTinyPreferences::db
struct fdb_kvdb db
Definition
preferences.h:24
esphome::libretiny::LibreTinyPreferences::make_preference
ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)
Definition
preferences.h:15
esphome::libretiny::LibreTinyPreferences::load_from_key
bool load_from_key(uint32_t type, uint8_t *data, size_t len)
One-shot read of a stored preference by key, without allocating a backend.
Definition
preferences.cpp:85
esphome::libretiny::LibreTinyPreferences::is_changed_
bool is_changed_(fdb_kvdb_t db, const NVSData &to_save, const char *key_str)
Definition
preferences.cpp:136
esphome::libretiny::LibreTinyPreferences::open
void open()
Definition
preferences.cpp:62
esphome::libretiny::LibreTinyPreferences::make_backend_
LibreTinyPreferenceBackend make_backend_(uint32_t type)
Definition
preferences.cpp:77
esphome::libretiny::LibreTinyPreferences::reset
bool reset()
Definition
preferences.cpp:162
esphome::libretiny::LibreTinyPreferences::blob
struct fdb_blob blob
Definition
preferences.h:25
esphome::libretiny::LibreTinyPreferences::sync
bool sync()
Definition
preferences.cpp:90
preference_backend.h
type
uint16_t type
Definition
dns_server_esp32_idf.cpp:0
esphome::libretiny
Definition
core.h:7
esphome::libretiny::setup_preferences
void setup_preferences()
Definition
preferences.cpp:175
esphome::len
const void size_t len
Definition
hal.h:64
uint32_t
static void uint32_t
Definition
crash_handler.cpp:141
length
uint16_t length
Definition
tt21100.cpp:0
Generated by
1.12.0