Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions demo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,20 @@ static void packetProcessor(const Packet &packet) {
* source as the Tier-2 diagnostics — so a consumer like
* corruption_analysis.py can correlate BER with link quality on a
* per-frame basis instead of relying on aggregated statistics. */
/* seq + tsfl: chip-side sequence number (12-bit u16) and TSF low
* (full 32-bit u32). Consumers can dedup by seq and measure
* one-way latency by diffing TSF against the host clock. Optional
* fields — pre-#84 regex consumers tolerate them via the same
* pass-through pattern. */
printf("<devourer-stream>rate=%u len=%zu crc_err=%u icv_err=%u "
"rssi=%d,%d evm=%d,%d snr=%d,%d body=",
"rssi=%d,%d evm=%d,%d snr=%d,%d seq=%u tsfl=%u body=",
packet.RxAtrib.data_rate, packet.Data.size(),
packet.RxAtrib.crc_err ? 1u : 0u,
packet.RxAtrib.icv_err ? 1u : 0u,
packet.RxAtrib.rssi[0], packet.RxAtrib.rssi[1],
packet.RxAtrib.evm[0], packet.RxAtrib.evm[1],
packet.RxAtrib.snr[0], packet.RxAtrib.snr[1]);
packet.RxAtrib.snr[0], packet.RxAtrib.snr[1],
packet.RxAtrib.seq_num, packet.RxAtrib.tsfl);
for (size_t i = 24; i < packet.Data.size(); ++i)
printf("%02x", packet.Data[i]);
printf("\n");
Expand Down
8 changes: 6 additions & 2 deletions src/FrameParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,12 @@ static rx_pkt_attrib rtl8812_query_rx_desc_status(uint8_t *pdesc) {
* tools/precoder/seed_probe.py is the reliable path. */
pattrib.scrambler = (uint8_t)LE_BITS_TO_4BYTE(pdesc + 16, 9, 7);

/* Offset 20 */
/* pattrib.tsfl=(byte)GET_RX_STATUS_DESC_TSFL_8812(pdesc); */
/* Offset 20 — chip-side TSF low (32 bits). Surfaced via RxAtrib.tsfl
* for downstream latency measurement and dup-detection (see
* demo/main.cpp's <devourer-stream> line). The macro reads bits 0..31
* of pdesc+20 (full 4-byte u32), not a byte — the original commented
* `(byte)` cast in master was a copy-paste from another field. */
pattrib.tsfl = GET_RX_STATUS_DESC_TSFL_8812(pdesc);

return pattrib;
}
Expand Down
6 changes: 6 additions & 0 deletions src/FrameParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ struct rx_pkt_attrib
encrypt algorith */
bool crc_err;
bool icv_err;
/* TSF low (4 bytes at RX-descriptor offset 20) — chip-side timestamp
* for the frame. With the seq_num just above it, a downstream layer
* can drop duplicates by seq and measure one-way latency by diffing
* the chip's TSF against its own wall clock. Populated by
* FrameParser; surfaced through demo/main.cpp's <devourer-stream>. */
uint32_t tsfl;
uint8_t data_rate;
uint8_t bw;
uint8_t stbc;
Expand Down
Loading