|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Receive-only radio channel sniffer -> pcap capture records (PROTOCORE_ENABLE_RADIO_SNIFF). More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | RadioSniffNs |
| Dispatch table. Addressed by offset, so the layout is asserted below. More... | |
Macros | |
| #define | RADIO_SNIFF_TAP_LEN 20 |
| The TAP pseudo-header length this codec emits: 4 header + RSSI TLV(8) + channel TLV(8). | |
Functions | |
| PROTOCORE_NS_LAYOUT (RadioSniffNs, global_header, i2f32, tap_record) | |
| size_t | protocore_radio_sniff_global_header (uint8_t *work, uint8_t *out, size_t cap) |
| Write the pcap global header for a TAP-framed 802.15.4 sniff. 24, . | |
| uint32_t | protocore_radio_sniff_i2f32 (uint8_t *work, int32_t dbm) |
| Encode a signed integer dBm value as an IEEE-754 float32 . | |
| size_t | protocore_radio_sniff_tap_record (uint8_t *work, uint8_t *out, size_t cap, const uint8_t *frame, size_t flen, int32_t rssi_dbm, uint16_t channel, uint32_t ts_sec, uint32_t ts_usec) |
| Write one capture record: a pcap record header, the 802.15.4 TAP . | |
Variables | |
| PROTOCORE_NS RadioSniffNs RadioSniff | PROTOCORE_UNUSED |
| Module namespace. | |
Receive-only radio channel sniffer -> pcap capture records (PROTOCORE_ENABLE_RADIO_SNIFF).
The RF gateway drivers (CC1101, LoRa, the Thread 802.15.4 RCP) can run receive-only - sniff a channel without joining - and the frames they pull off the air belong in the same capture pipeline as the CAN and Wi-Fi captures (shared/protocore_pcap). For 802.15.4 that means wrapping each frame in the Wireshark IEEE 802.15.4 TAP pseudo-header so the per-frame RSSI and channel travel with it, then a standard pcap record, giving a .pcap a wired Wireshark opens with the radio metadata intact.
This is that pure framing: ::protocore_radiosniff_global writes the pcap global header (DLT TAP), and ::protocore_radiosniff_tap_record writes one record (TAP header + RSSI/channel TLVs + the MAC frame). The radio drivers own the receive; this owns the on-wire capture bytes. No heap, no stdlib, host-testable.
work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.
Definition in file radio_sniff.h.
| #define RADIO_SNIFF_TAP_LEN 20 |
The TAP pseudo-header length this codec emits: 4 header + RSSI TLV(8) + channel TLV(8).
Definition at line 35 of file radio_sniff.h.
| PROTOCORE_NS_LAYOUT | ( | RadioSniffNs | , |
| global_header | , | ||
| i2f32 | , | ||
| tap_record | |||
| ) |
| size_t protocore_radio_sniff_global_header | ( | uint8_t * | work, |
| uint8_t * | out, | ||
| size_t | cap | ||
| ) |
Write the pcap global header for a TAP-framed 802.15.4 sniff. 24, .
| work | PROTOCORE_RADIO_SNIFF_BORROW bytes the caller took. Not held past the call. |
| out | Out |
| cap | Cap |
| uint32_t protocore_radio_sniff_i2f32 | ( | uint8_t * | work, |
| int32_t | dbm | ||
| ) |
Encode a signed integer dBm value as an IEEE-754 float32 .
| work | PROTOCORE_RADIO_SNIFF_BORROW bytes the caller took. Not held past the call. |
| dbm | Dbm |
| size_t protocore_radio_sniff_tap_record | ( | uint8_t * | work, |
| uint8_t * | out, | ||
| size_t | cap, | ||
| const uint8_t * | frame, | ||
| size_t | flen, | ||
| int32_t | rssi_dbm, | ||
| uint16_t | channel, | ||
| uint32_t | ts_sec, | ||
| uint32_t | ts_usec | ||
| ) |
Write one capture record: a pcap record header, the 802.15.4 TAP .
| work | PROTOCORE_RADIO_SNIFF_BORROW bytes the caller took. Not held past the call. |
| out | Out |
| cap | Cap |
| frame | Frame |
| flen | Flen |
| rssi_dbm | Rssi dbm |
| channel | Channel |
| ts_sec | Ts sec |
| ts_usec | Ts usec |
| PROTOCORE_NS RadioSniffNs RadioSniff PROTOCORE_UNUSED |
Module namespace.
Definition at line 78 of file radio_sniff.h.