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

+12
View File
@@ -554,3 +554,15 @@ void PacketReceipt::check_timeout() {
}
}
}
void ArduinoJson::convertFromJson(JsonVariantConst src, RNS::Packet& dst) {
if (!src.isNull()) {
RNS::Bytes hash;
hash.assignHex(src.as<const char*>());
// Query transport for matching interface
dst = Transport::get_cached_packet(hash);
}
else {
dst = {RNS::Type::NONE};
}
}