skydroid-protocol 0.1.0

no_std, allocation-free Rust implementation of the SkydroidCameraFPV control protocol (#TP and AT+ command families). Build and parse camera control packets for embedded and OS projects.
Documentation
//! # 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");
//! ```

#![cfg_attr(not(feature = "std"), no_std)]
#![forbid(unsafe_code)]

pub mod at;
pub mod command;
pub mod framing;
pub mod hex;
pub mod packet;

#[cfg(feature = "transport")]
pub mod transport;

/// 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;