#pragma once #include #include #include #include namespace roro::lora { // What the radio knew about one received packet. struct RxInfo { uint32_t frequencyHz = 0; float bandwidthKHz = 0; uint8_t spreadingFactor = 0; float rssi = 0; // dBm float snr = 0; // dB float noiseFloor = 0; // dBm, instantaneous RSSI just before the packet, when known uint8_t syncWord = 0; }; // A Capture file (M3, Q97): pcap with LoRaTap v0 headers (LINKTYPE_LORATAP, 270), which Wireshark // reads. pcap fields are little-endian, LoRaTap fields big-endian. void appendPcapHeader(std::vector& out); void appendRecord(std::vector& out, uint32_t seconds, uint32_t micros, const RxInfo& rx, const uint8_t* data, size_t len); // "/captures/lora/YYYYMMDD-HHMMSS.pcap" in UTC, dated like Tracks so Storage Clean-up can age it. std::string capturePath(int64_t utcSeconds); constexpr size_t kLoraTapSize = 15; constexpr size_t kRecordOverhead = 16 + kLoraTapSize; } // namespace roro::lora