#pragma once #include #include #include #include namespace roro::lora { // Whose packets the radio's settings were for, by their sync word: whose clear header to read. enum class Protocol : uint8_t { None, Meshtastic, MeshCore }; Protocol protocolOf(uint8_t syncWord); // What the LoRa Scanner shows of one packet (M3, Q96). struct PacketSummary { const uint8_t* data; size_t len; float rssi, snr; bool crcOk; Protocol protocol; // what the settings it was received on were for }; // One list row, at most about 36 characters: "21:45:07 -97 6.2 5678>all 1/3". Meshtastic nodes by their // default short name (the last 4 hex digits); headerLines() has the full numbers. MeshCore: what // it is, then who ("adv Brussels-R1", "txt a3>7f", "chan #11", "who's there?", "here 18a6") and the hops in its path ("2h"); // a message on the public channel is read: "Alice: hello fro 2h". std::string row(const PacketSummary& p, const std::string& time); // Eight bytes a line, with the printable ones: "0000 ff ff ff ff 78 56 34 12 ....xV4.". std::vector hexDump(const uint8_t* data, size_t len); // What is in clear, one field a line: the Meshtastic header, or MeshCore's header, path and (for an // advert) who the node says it is, and a message on its public channel. Empty when the packet can't be read as that. std::vector headerLines(const uint8_t* data, size_t len, Protocol protocol = Protocol::Meshtastic); } // namespace roro::lora