Skip to content

feat: add USB transport support#16

Draft
okhsunrog wants to merge 4 commits into
hauntedfail:mainfrom
okhsunrog:agent/usb-transport
Draft

feat: add USB transport support#16
okhsunrog wants to merge 4 commits into
hauntedfail:mainfrom
okhsunrog:agent/usb-transport

Conversation

@okhsunrog

@okhsunrog okhsunrog commented Jul 14, 2026

Copy link
Copy Markdown

Summary

  • Add --usb as an alternative to BLE discovery for one-shot commands and the interactive console.
  • Make the command registry operate on the runtime-selectable IqosTransport.
  • Use SCP battery voltage when the GATT battery percentage is unavailable over USB.
  • Preserve model capability checks across both transports.
  • Trim trailing NUL bytes from BLE GATT metadata before displaying it.
  • Document USB usage, supported read-only commands, and Linux permissions.

Dependency / draft status

This draft depends on hauntedfail/iqos#5.

The manifest intentionally uses the feature branch for review and reproducible CI:

iqos = { git = "https://github.com/okhsunrog/iqos", branch = "agent/usb-transport", features = ["btleplug-support", "usb-support"] }

Before this PR is marked ready or merged:

  • Merge feat: add async USB HID transport iqos#5.
  • Publish the corresponding iqos crate release.
  • Replace the temporary git dependency with the released crates.io version.
  • Regenerate Cargo.lock and rerun the verification commands.

User impact

Users can connect directly to an attached IQOS without BLE scanning:

iqos --usb info
iqos --usb battery
iqos --usb diagnosis

Read-only brightness, vibration, FlexPuff, FlexBattery, and AutoStart queries use the same command implementations as BLE. Stateful USB commands remain experimental.

Hardware validation

Validated on an IQOS ILUMA i over BLE and USB. Product numbers, firmware versions, settings, battery voltage, and diagnosis counters matched across transports. Diagnosis returned identical raw counters (1296 usage counter and 1074 currently unidentified counter); their exact semantics remain unverified. Battery voltage matched at 4.614 V.

Verification

  • cargo fmt --all --check
  • cargo check --locked
  • cargo test --all-targets --locked (66 tests)
  • cargo clippy --all-targets --locked -- -D warnings
  • real-device BLE and USB read-only command suites

Release notes

  • User-facing change: add direct IQOS USB HID connections through --usb.
  • Recommended label: feature

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e3330a0-bb69-40a7-ac28-0f91ef5f164a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant