ESPHome
2026.4.0-dev
Loading...
Searching...
No Matches
esphome
components
libretiny
preference_backend.h
Go to the documentation of this file.
1
#pragma once
2
#ifdef USE_LIBRETINY
3
4
#include <cstddef>
5
#include <cstdint>
6
7
// Forward declare FlashDB types to avoid pulling in flashdb.h
8
struct
fdb_kvdb;
9
struct
fdb_blob;
10
11
namespace
esphome::libretiny
{
12
13
class
LibreTinyPreferenceBackend
final {
14
public
:
15
bool
save
(
const
uint8_t *data,
size_t
len
);
16
bool
load
(uint8_t *data,
size_t
len
);
17
18
uint32_t
key
;
19
struct
fdb_kvdb *
db
;
20
struct
fdb_blob *
blob
;
21
};
22
23
class
LibreTinyPreferences
;
24
LibreTinyPreferences
*
get_preferences
();
25
26
}
// namespace esphome::libretiny
27
28
namespace
esphome
{
29
using
PreferenceBackend
=
libretiny::LibreTinyPreferenceBackend
;
30
}
// namespace esphome
31
32
#endif
// USE_LIBRETINY
esphome::libretiny::LibreTinyPreferenceBackend
Definition
preference_backend.h:13
esphome::libretiny::LibreTinyPreferenceBackend::load
bool load(uint8_t *data, size_t len)
Definition
preferences.cpp:40
esphome::libretiny::LibreTinyPreferenceBackend::db
struct fdb_kvdb * db
Definition
preference_backend.h:19
esphome::libretiny::LibreTinyPreferenceBackend::save
bool save(const uint8_t *data, size_t len)
Definition
preferences.cpp:24
esphome::libretiny::LibreTinyPreferenceBackend::key
uint32_t key
Definition
preference_backend.h:18
esphome::libretiny::LibreTinyPreferenceBackend::blob
struct fdb_blob * blob
Definition
preference_backend.h:20
esphome::libretiny::LibreTinyPreferences
Definition
preferences.h:11
esphome::libretiny
Definition
core.h:7
esphome::libretiny::get_preferences
LibreTinyPreferences * get_preferences()
Definition
preferences.cpp:168
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
esphome::len
std::string size_t len
Definition
helpers.h:1045
uint32_t
static void uint32_t
Definition
crash_handler.cpp:141
esphome::PreferenceBackend
Definition
preference_backend.h:30
Generated by
1.12.0