WIP: Initial implementation of persistence

Persistence implemented with the help of the ArduinoJson library using
MessagePack format.
This commit is contained in:
attermann committed 2023-12-05 11:06:49 -07:00
1 parent c39e9e7fee
commit f9a679ffc2
20 files changed
+1031 -54

No files matched your search

+13
View File
@@ -176,3 +176,16 @@ namespace RNS {
};
}
namespace ArduinoJson {
inline bool convertToJson(const RNS::Interface& src, JsonVariant dst) {
if (!src) {
return dst.set(nullptr);
}
return dst.set(src.get_hash().toHex());
}
void convertFromJson(JsonVariantConst src, RNS::Interface& dst);
inline bool canConvertFromJson(JsonVariantConst src, const RNS::Interface&) {
return src.is<const char*>() && strlen(src.as<const char*>()) == 64;
}
}