Files
roro9stack/lib/services/src/key_value_store.h
T
twislaandClaude Opus 5.5 987406fa7c Add M0 services: settings, battery, clock, storage, power
lib/services holds the host-tested logic:
- Settings: typed, validated, persisted, SettingChanged events,
  transmit gated on a confirmed Region
- BatteryEstimator: LiPo curve, median smoothing against TX sags
- ClockModel: source priority GNSS > NTP > mesh, relative ages,
  Europe/Brussels local time via POSIX TZ
- StorageMonitor: warning once per boot at 80%, Logs stop at 90%,
  Captures stop with < 2 MiB left
- PowerPolicy / PowerButton: dim/off timeouts, wake key swallowed only
  when the screen was off, G0 long press

src/services wires them to the hardware (NVS, battery ADC, SD on the
shared SPI bus with the LoRa CS held high, backlight, deep sleep), and
main.cpp is a temporary diagnostics screen for the hardware checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
2026-10-02 09:47:36 +02:00

19 lines
527 B
C++

#pragma once
#include <cstdint>
#include <string>
namespace roro {
// Persistent key/value storage (NVS on the device, a map in tests). Keys are at most 15 chars.
class KeyValueStore {
public:
virtual ~KeyValueStore() = default;
virtual bool getInt(const char* key, int32_t& out) = 0;
virtual bool getString(const char* key, std::string& out) = 0;
virtual void putInt(const char* key, int32_t value) = 0;
virtual void putString(const char* key, const std::string& value) = 0;
};
} // namespace roro