Skip to main content

Crate rvcsi_adapter_nexmon

Crate rvcsi_adapter_nexmon 

Source
Expand description

§rvCSI Nexmon adapter (napi-c boundary)

Wraps the isolated C shim in native/rvcsi_nexmon_shim.{c,h} — the only C in the rvCSI runtime (ADR-095 D2, ADR-096). The shim parses a compact, byte-defined “rvCSI Nexmon record” (a normalized superset of the nexmon_csi UDP payload). Everything above ffi is safe Rust; all unsafe is confined to this crate, bounds-checked on the C side, and documented.

Two source paths:

Both yield Pending CsiFrames; the runtime runs rvcsi_core::validate_frame on each before exposing it.

Re-exports§

pub use chips::known_chips;
pub use chips::known_pi_models;
pub use chips::nexmon_adapter_profile;
pub use chips::raspberry_pi_profile;
pub use chips::NexmonChip;
pub use chips::RaspberryPiModel;
pub use ffi::decode_chanspec;
pub use ffi::decode_nexmon_udp;
pub use ffi::decode_record;
pub use ffi::encode_nexmon_udp;
pub use ffi::encode_record;
pub use ffi::parse_nexmon_udp_header;
pub use ffi::shim_abi_version;
pub use ffi::DecodedChanspec;
pub use ffi::NexmonCsiHeader;
pub use ffi::NexmonFfiError;
pub use ffi::NexmonRecord;
pub use ffi::NEXMON_CSI_FMT_INT16_IQ;
pub use ffi::NEXMON_HEADER_BYTES;
pub use ffi::NEXMON_MAGIC;
pub use ffi::RECORD_HEADER_BYTES;
pub use pcap::extract_udp_payload;
pub use pcap::synthetic_udp_pcap;
pub use pcap::PcapPacket;
pub use pcap::PcapReader;
pub use pcap::LINKTYPE_ETHERNET;
pub use pcap::LINKTYPE_IPV4;
pub use pcap::LINKTYPE_LINUX_SLL;
pub use pcap::LINKTYPE_RAW;
pub use pcap::NEXMON_DEFAULT_PORT;
pub use pcap::PCAP_MAGIC_NS;
pub use pcap::PCAP_MAGIC_US;

Modules§

chips
The Nexmon-supported Broadcom chip registry and Raspberry Pi model map (ADR-095 D15, ADR-096) — including the Raspberry Pi 5.
ffi
Raw FFI to the napi-c shim plus safe wrappers (ADR-096).
pcap
Minimal, dependency-free reader for the classic libpcap (.pcap) file format — enough to pull the UDP payloads out of a nexmon_csi capture (tcpdump -i wlan0 dst port 5500 -w csi.pcap).

Structs§

NexmonAdapter
A CsiSource that replays a buffer of rvCSI Nexmon records.
NexmonPcapAdapter
A CsiSource that reads the real nexmon_csi UDP payloads out of a libpcap (.pcap) capture (tcpdump -i wlan0 dst port 5500 -w csi.pcap).

Functions§

synthetic_nexmon_pcap
Build a synthetic nexmon_csi .pcap (LE/µs/Ethernet) from (timestamp_ns, NexmonCsiHeader, i_values, q_values) entries, sending every CSI packet to UDP port port. Useful for tests, examples and the rvcsi self-tests; real captures come off a Pi running patched firmware.