Skip to main content

Crate skydroid_protocol

Crate skydroid_protocol 

Source
Expand description

§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");

Modules§

at
Secondary AT+ command family. Allocation-free.
command
Command builders for the #TP camera protocol. Allocation-free.
framing
The receive-side #TP frame parser (RX side) - allocation-free. Synchs on #tp\0 header, parses msgid/dataLen/data/checkSum, stream-tolerant.
hex
Hex helpers. Allocation-free.
packet
The transmit-side packet builder — allocation-free.

Constants§

MAX_PACKET_LEN
Maximum length of an assembled #tp frame payload (from the app’s ARLINK_USR_DATA_MAX_LEN = 16384).