listener.rs — Incoming Packet Handler
run_listener() is the main receive loop. It runs for the lifetime of the app as a spawned async task. On every received UDP datagram it:
- Decodes the raw bytes as a
PbEnvelopeusing prost - Extracts the inner payload variant
- Checks a per-payload throttle — events are forwarded to the frontend at most once every 100ms per payload type, regardless of how fast the rover sends
- Emits a Tauri event to the frontend with the decoded message as the payload
Throttling
Each payload type has its own independent Throttle instance. This prevents high-frequency streams (e.g. IMU at 50Hz) from flooding the frontend with more updates than it can usefully render.
Tauri events emitted
These are the event names the frontend can listen to with listen():
Note for future developers: If you add new protobufers you must add them here or you want be able to listen to them
No comments to display
No comments to display