flipperzero-rs / flipperzero

Rust on the Flipper Zero

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tools: Migrate from text-based CLI to Protobuf RPC

str4d opened this issue · comments

Currently the binaries in tools/ use the text-based CLI over the serial port to communicate with a Flipper Zero and run FAPs. We should instead use the start_rpc_session CLI command to drop into the Protobuf RPC control mode, using e.g. the prost crate. This would remove most of the hand-written CLI parsing logic, and probably be more accurate and flexible.

In particular, I am curious about whether PB_App.StartRequest is specifically a request to Applications that enables us to provide arguments to FAPs (which the text CLI loader open Applications foo.fap does not), or whether it is a request to loader (and thus the same as the text CLI).

Absolutely agree. When implementing the current storage_cli code in tools/, I tried to keep it identical to the Python implementation because of just how fragile that kind of CLI driving is.