#pragma once
// NVS-backed persistence for the Wi-Fi profile store.
//
// Kept out of board.cpp and out of the pure store: the store only sees the
// WiFiProfileStorage interface, and this is the one implementation that talks
// to NVS (docs/wifi-provisioning-plan.md section 37).
#include "wifi_profiles.h"

namespace wearable {

// Reads/writes a single blob in the "wifi" NVS namespace. A missing key is
// reported as Missing (not an error), so a first-run migration can be
// distinguished from a corrupt or unreadable store. Never erases an existing
// blob on a failed write.
class NvsWiFiStorage final : public WiFiProfileStorage {
public:
    WiFiStoreLoadState load(WiFiStoreImage &out) override;
    bool save(const WiFiStoreImage &image) override;
    bool erase() override;
};

}  // namespace wearable