This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
incorrections — An async UDP relay for CMR+ GPS corrections data. Replacement for samplicator.
Listens on a UDP port for packets from a configured source IP, then fans out the data to a list of destination IPs. Written in Rust with tokio async runtime. Legacy Python version (gps3.py) is retained.
cargo build # debug build
cargo build --release # release build
cargo test # run all unit tests
cargo test config # run tests in config module
cargo test stats # run tests in stats module
cargo test relay # run tests in relay module (integration)# Non-interactive mode (log keepalive stats every 5 min)
cargo run -- --no-interactive --bind-ip 10.0.0.1 --source-ip 10.0.0.2
# All CLI options
incorrections --source-ip IP --listen-port PORT --bind-ip IP --dest-port PORT --conf FILE --no-interactive --interval SECSpip install -e . # install with psutil dep
python gps3.py --no-interactive --bind-ip 10.0.0.1 --source-ip 10.0.0.2
python -m pytest test_gps3.py -vsrc/
main.rs — Entry point: CLI parsing, socket setup, startup banner
config.rs — Args struct (clap derive), parse_ip_list() config parser
stats.rs — Stats struct, calc_percent(), format_uptime()
relay.rs — run_relay() async loop: receive, filter, fan-out, stats printing
- Async I/O: tokio runtime with
UdpSocket::recv_from/send_to, timeout viatokio::time::timeout - Source filtering: Only forwards packets from
--source-ip, silently drops others - Stats output: Non-interactive mode prints a keepalive line every
--intervalseconds - No curses TUI in Rust version — non-interactive log mode only
Managed in Cargo.toml: tokio (async runtime + UDP), clap (CLI), chrono (timestamps).
One IP per line. Lines starting with # are comments. Samplicator format source:dest/port supported (dest IP extracted, port-per-IP not used — port is global).