Expand description
§mavrouter
High-performance, intelligent MAVLink router for embedded systems.
§Features
- Intelligent Routing: Learns network topology, routes messages efficiently
- Multi-Protocol: TCP, UDP, Serial support
- Reliability: Automatic endpoint restart, deduplication, filtering
- Performance: 50ns routing lookup, 34kHz+ throughput tested
§Quick Start
The simplest way to use mavrouter as a library is with the high-level Router API:
use mavrouter::Router;
// Start from a TOML string
let router = Router::from_str(r#"
[[endpoint]]
type = "udp"
address = "0.0.0.0:14550"
mode = "server"
"#).await?;
// Or from a configuration file
// let router = Router::from_file("mavrouter.toml").await?;
// Access the message bus to subscribe to messages
let mut rx = router.bus().subscribe();
// ... do your work ...
// Gracefully shut down
router.stop().await;§Configuration
See config::Config for TOML configuration structure. You can also create
configurations programmatically using config::Config::parse or the
standard FromStr trait.
§Re-exported Dependencies
For convenience, commonly needed dependencies are re-exported:
CancellationToken: For graceful shutdown controlRwLock: Used by the routing table (fromparking_lot)
§Architecture
Modules§
- config
- Router configuration and parsing utilities.
- dedup
- Message deduplication logic. Message deduplication logic for MAVLink messages.
- endpoint_
core - Core logic for generic endpoint operations. Core logic for MAVLink endpoints.
- endpoints
- Various MAVLink endpoint implementations (TCP, UDP, Serial, TLOG).
- error
- Custom error types for structured error handling. Custom error types for mavrouter-rs.
- filter
- Message filtering capabilities for endpoints. Message filtering logic for MAVLink messages based on various criteria.
- framing
- MAVLink message framing and parsing from byte streams. MAVLink framing and parsing utilities.
- mavlink_
utils - Utility functions for MAVLink message processing. MAVLink protocol utilities for target extraction and routing
- router
- Core message routing logic and types.
- routing
- Routing table implementation for MAVLink messages.
- stats
- Statistics history tracking and aggregation. Statistics history tracking for MAVLink router.
Structs§
- Cancellation
Token - Re-export of
tokio_util::sync::CancellationTokenfor graceful shutdown control. A token which can be used to signal a cancellation request to one or more tasks. - Router
- A high-level handle to a running MAVLink router.
Type Aliases§
- RwLock
- Re-export of
parking_lot::RwLockused by the routing table. A reader-writer lock