Skip to content

Add sourced console support - #13

Open
ataffanel wants to merge 3 commits into
mainfrom
sourced-console
Open

ataffanel wants to merge 3 commits into
mainfrom
sourced-console

Conversation

@ataffanel

@ataffanel ataffanel commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR adds sourced console support to cfcli, so users can discover and read output from Crazyflie sources such as the Camera Deck. It makes deck startup and runtime messages available from the CLI through CRTP protocol 13 while keeping cfcli console focused on the Crazyflie's local console.

cfcli console --list-sources prints the advertised source paths in a table or CSV. cfcli console --source PATH enables one source by its exact path, replays available output, and continues streaming live output. Formatted and raw output are supported. Local --preserve-console history still applies only to the Crazyflie's local console.

The pinned crazyflie-lib-rs revision follows the current firmware response format and can retain packets received before catalog discovery. Those packets appear when their source is enabled, so replay may include output from an earlier connection. The library keeps a 64 KiB budget for these early packets and cannot recover packets lost over radio. On timeout or interruption, cfcli makes a bounded attempt to disable the selected source before disconnecting.

Related work

Verification

On commit ba3ad3b:

  • cargo test --locked --offline passed: 19 tests, including the process-signal cleanup test, when run outside sandbox process isolation.
  • cargo build --locked --offline passed.
  • git diff --check passed.

Earlier hardware acceptance covered source listing, replay and live output, disable and re-enable, missing-source reporting, and the local console with the previous library pin. The new protocol parser and reconnect buffering have not been tested through cfcli on hardware.

Before merge

  • Replace the temporary Git pin with a released crazyflie-lib-rs version containing sourced console support.

@ataffanel
ataffanel marked this pull request as ready for review August 31, 2026 13:03
@ataffanel
ataffanel requested review from evoggy and stefanthorstenson and a lite review from Copilot August 31, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for “sourced console” discovery and streaming on top of the existing legacy Crazyflie console behavior, including CSV output for catalog listing and bounded cleanup on exit.

Changes:

  • Add console --list-sources (human/CSV) and console --source <PATH> (replay history + live streaming) flows.
  • Update command classification and cleanup logic to treat sourced-console streaming correctly and disable an enabled source before disconnecting.
  • Document the new UX and add focused unit tests around argument behavior and source-path rendering.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/modules/console.rs Implements source catalog listing, not-found errors, and single-source streaming (replay + live).
src/main.rs Routes new console flags, adjusts streaming-command detection, and adds bounded disable-on-exit cleanup.
src/cli.rs Adds --source / --list-sources flags and clap conflict rules.
README.md Documents sourced-console discovery/streaming and updates --csv coverage list.
docs/console.md Adds detailed sourced-console UX docs and timeout/cleanup behavior.
Cargo.toml Bumps crazyflie-link and pins crazyflie-lib to a git rev with sourced-console support.
Cargo.lock Updates lockfile for dependency changes and bumps cfcli version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/modules/console.rs
Comment on lines +89 to +90
*enabled_source = Some(selector);
cf.console.enable(selector).await?;

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants