Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
flipper-rpc
flipper-rpc is a Rust library for talking to a Flipper Zero over its RPC
serial protocol. It ships generated protobuf bindings, a higher-level
request/response layer, serial transports, and feature-gated filesystem helpers.
The crate tracks the official Flipper protobuf schema published in
flipperdevices/flipperzero-protobuf.
The serial framing uses protobuf length-delimited messages, which means each
PB.Main envelope is prefixed with a varint length as described in the
Protocol Buffers encoding guide.
Crate layout
proto: generated Rust types for the Flipper RPC schemarpc: ergonomicRequestandResponseenums overproto::Maintransport: serial CLI and serial RPC transportsfs: feature-gated filesystem helpers built on top ofeasy-rpc
Features
| Feature | Purpose |
|---|---|
default |
Enables minimal |
minimal |
Generated protobuf types only (proto) |
proto |
prost encoding and decoding support |
easy-rpc |
High-level request and response wrappers |
fs-all |
Enables all filesystem helper traits |
fs-read |
Read files from the device |
fs-read-metadata |
Pre-size read buffers by fetching metadata first |
fs-write |
Write files to the device |
fs-readdir |
List directory contents |
fs-remove |
Remove files or directories |
fs-createdir |
Create directories |
fs-metadata |
Query file size metadata |
fs-md5 |
Ask the device to calculate an MD5 for a file |
fs-tar-extract |
Ask the device to extract a .tar archive |
transport-serial |
Serial transport support |
transport-serial-optimized |
Faster serial response reader |
transport-serial-optimized-large-stack-limit |
Larger stack buffer for very large responses |
tracing |
Integrate with tracing spans and events |
Prefer enabling only the features you actually use.
Installation
Example Cargo.toml entry:
[]
= { = "0.9.5", = ["easy-rpc", "transport-serial-optimized"] }
Example
use Result;
use ;
use ;
use Transport;
Protocol notes
The current transport implementation follows the same structure documented by the official schema and the existing Flipper client implementations:
- Open the serial device and drain the text prompt (
">: "). - Enter RPC mode with
start_rpc_session\r. - Encode a
proto::Mainmessage withprostlength-delimited framing. - Read the length varint, then read and decode the protobuf payload.
- Check
command_statusbefore converting the payload intorpc::Response.
The official protobuf schema defines the PB.Main envelope with these core
fields:
command_idcommand_statushas_nextcontent
That envelope is what this crate reads and writes on the wire.
Development
flipper-rpc includes a Nix dev shell and pinned Rust toolchain: