mirror of
https://github.com/ratspeak/microReticulum
synced 2026-11-27 13:52:14 +00:00
WIP: Initial implementation of persistence
Persistence implemented with the help of the ArduinoJson library using MessagePack format.
This commit is contained in:
1 parent
c39e9e7fee
commit
f9a679ffc2
20 files changed
+1031
-54
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user