|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Typed NVS configuration store (PC_ENABLE_CONFIG_STORE). More...
Go to the source code of this file.
Typed NVS configuration store (PC_ENABLE_CONFIG_STORE).
A small typed key/value API for core device settings - WiFi credentials, IP configuration, feature toggles - that routes them into the ESP32's native Non-Volatile Storage (NVS) partition as binary entries, rather than a JSON text file on the filesystem. NVS is wear-levelled and independent of the LittleFS/SPIFFS partition, so configuration survives a filesystem corruption and credentials live in the storage area meant for them.
Three value types: null-terminated strings, uint32_t, and raw blobs - each with a default returned when the key is absent. On ESP32 the backend is the Arduino Preferences NVS wrapper; on host builds it is a fixed in-memory table (PC_CONFIG_MAX_ENTRIES x PC_CONFIG_VAL_MAX) so the typed contract is unit-testable without flash.
Writes hit NVS, so call the setters at provisioning / config time, not in the request hot path. Keys are limited to 15 chars (NVS), plus null.
Definition in file config_store.h.