flipperzero-rs / flipperzero

Rust on the Flipper Zero
MIT License
521 stars 35 forks source link

tools: Migrate from text-based CLI to Protobuf RPC #76

Open str4d opened 1 year ago

str4d commented 1 year ago

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).

dcoles commented 1 year ago

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.