gate: replace json with nanopb #8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implementation decisions (protocol migration JSON -> nanopb)
GateMessageproto with aoneofovertrigger,heartbeat,log,log_start,log_line,log_end,ack,cmd. Timestamps stay uint64 Unix epoch microseconds; temperature-quirk fields (e.g. "yes" strings) become real proto types (bool/scalars). Normalization (heartbeat->keepalive,trigger->timekeeping) stays in the server marshalling layer, output dict shape unchanged.nanopb/NanopbPlatformIO lib (extra_script auto-generates.pb.c/.pb.h); copy ofgate.protoinsrc/, canonical copy inlibs/timekeeping_protocol/. Hand-rolledsnprintf/strstrcode inmain.cpp,heartbeat.cpp,log.cpp,network.cppreplaced withpb_encode/pb_decode.0x0A), so both directions switch to 2-byte little-endian length prefix + payload. Affects firmwarenetwork_send/network_loop, servertcp_server.pyread loop (->readexactly(2)+readexactly(n)), anddump_runtime.pycommand writes.betterproto(dataclass-style messages); generation uses protoc + the betterproto plugin (betterproto[compiler]). Generated module committed underlibs/timekeeping_protocol/.testing_sim/backend.pyports to betterproto + framing;test_marshalling.pyrewritten for the new pack/unpack; dispatch-level tests (dict-shaped) largely unchanged. Docs updated (README "TCP Protocol", MANUAL.md).make check+pio runfor the firmware envs.