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
//! # skydroid-fpv
//!
//! A **`no_std`**, **allocation-free** Rust implementation of the Skydroid
//! camera FPV control protocol (reverse-engineered from the Android app,
//! see `PROTOCOL.md`).
//!
//! The crate builds packets to **send** ([`packet`], [`command`]) and parses
//! frames you **receive** ([`framing`]), with **no heap allocation**: all
//! output is written into caller-provided buffers. It works on bare-metal
//! embedded targets and normal OS projects alike.
//!
//! # Features
//! * `default = []` — pure `no_std`, no `alloc`, no `std`.
//! * `std` — enables the optional OS socket transport ([`transport`]).
//! * `transport` — implies `std`; enables the [`transport`] module.
//!
//! # Quick start (send a command)
//! ```
//! use skydroid_protocol::packet::build_command;
//! use skydroid_protocol::command::Capture;
//!
//! let mut out = [0u8; 32];
//! let n = build_command(&Capture::TakePicture, &mut out).unwrap();
//! let wire = &out[..n]; // bytes ready for the socket
//! assert_eq!(&wire[..12], b"#TPUD2wCAP01");
//! ```
/// Maximum length of an assembled `#tp` frame payload (from the app's
/// `ARLINK_USR_DATA_MAX_LEN` = 16384).
pub const MAX_PACKET_LEN: usize = 16384;