1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! # API extensions for synchronous MAVLink node
pub
pub use SyncApi;
pub use Callback;
pub use Event;
pub use ;
pub use EventReceiver;
pub use FrameSender;
use crate;
use crateNode;
/// <sup>[`sync`](crate::sync)</sup>
/// Synchronous node representing an edge MAVLink device.
///
/// An edge node is a MAVlink device with defined system `ID` and component `ID`. It can send and
/// receive MAVLink messages, emit automatic heartbeats and perform other active tasks.
///
/// # Examples
///
/// Create a synchronous TCP server node:
///
/// ```no_run
/// use maviola::prelude::*;
/// use maviola::sync::prelude::*;
///
/// let addr = "127.0.0.1:5600";
///
/// // Create a node from configuration
/// // with MAVLink protocol set to `V2`
/// let mut node = Node::sync::<V2>()
/// .system_id(1) // System `ID`
/// .component_id(1) // Component `ID`
/// .connection(
/// TcpServer::new(addr) // Configure TCP server connection
/// .unwrap()
/// ).build().unwrap();
///
/// // Activate node to start sending heartbeats
/// node.activate().unwrap();
///
/// // Process incoming events
/// for event in node.events() {
/// match event {
/// Event::NewPeer(peer) => {
/// /* handle a new peer */
/// }
/// Event::PeerLost(peer) => {
/// /* handle a peer, that becomes inactive */
/// }
/// Event::Frame(frame, callback) => {
/// // Send back any incoming frame directly to its sender's channel
/// callback.respond(&frame).unwrap();
/// }
/// Event::Invalid(frame, err, callback) => {
/// /* Process invalid frame */
/// }
/// }
/// }
/// ```
pub type EdgeNode<V> = ;
/// <sup>[`sync`](crate::sync)</sup>
/// Synchronous node representing a MAVLink proxy.
pub type ProxyNode<V> = ;