Commit Graph

16 Commits

Author SHA1 Message Date
oopsbagel
fa9e9319c2 fix(serial.enable_command_mode): claim usb device interface
Windows does not support nusb::Device.control_out_blocking

Claim the interface before writing as required on Windows.
2025-04-11 10:07:02 -07:00
dependabot[bot]
775468f037 Bump tokio from 1.44.1 to 1.44.2
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.1 to 1.44.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.44.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-08 08:44:46 -07:00
oopsbagel
3c0716c877 feat(serial): replace all panics with error handling from anyhow
Support -h and --help arguments.
Print a better error message when the Orbic device is not found.
Replace every panic! with anyhow::bail!
Replace .expect() with .context()?
Wraps all function returns with anyhow::Result
2025-04-01 13:40:01 -07:00
oopsbagel
431a97ca65 chore: bump all Cargo.toml versions to 0.2.6 2025-03-25 17:02:01 -07:00
oopsbagel
9af8e006b0 fix(serial): use tokio's timeout with USB bulk in/out
Replace futures_lite::future::block_on (which will block indefinitely) with
tokio::time::timeout to restore the original behaviour of this utility, where
communication over USB interface bulk endpoints times out after 1 second.
2025-03-25 16:46:35 -07:00
oopsbagel
e841e22774 refactor(serial): replace rusb with nusb
nusb is a pure Rust library providing the same low level access to USB devices
that rusb/libusb provide.

This commit removes rusb (and thus the dependence on libusb) and replaces it
with nusb in the serial utility.

The only functional change is that nusb does not support timeouts for bulk data
commands. nusb is async. This commit contains a naïve implementation that simply
blocks on bulk reads and writes in send_command().
2025-03-25 16:46:35 -07:00
Will Greenberg
565c0f1e67 serial: fix UTF-8 panic on macOS 2025-01-26 17:05:42 -08:00
Will Greenberg
4e862841b3 serial: use vendored rusb 2024-10-22 14:46:40 -07:00
will
78d33b2cff serial: claim USB interface
Without doing this, it seems macOS can't use any interface endpoints.
Also disconnect any kernel extensions that're using the interface,
since that can cause issues on macOS as well.
2024-10-18 09:43:12 -07:00
Will Greenberg
7cbb3369d8 serial: when rooting, don't panic if device is already rooted 2024-08-05 09:57:09 -07:00
Will Greenberg
65e1cd4967 serial: split out --root process, don't wait for reboot, update usage text
We need to wait for atfwd_daemon to startup before sending any AT
commands, and I can't think of a way to reliably do that within rust.
So, instead of trying to switch the device to command mode before
executing a command, require the user to run the "--root" step
beforehand, and then start executing AT commands.
2024-08-05 09:57:09 -07:00
Cooper Quintin
5c4bd161fa fix timeout bug in rooting script and update docs 2024-08-02 14:45:55 -07:00
Cooper Quintin
0ad60ef8bb starting docs 2024-02-02 16:31:24 -08:00
Matthew Garrett
23edacc877 Make more idiomatic 2024-01-10 20:28:14 -08:00
Matthew Garrett
ea84d74f9d Some fixes
Ensure the mode switch works, and handle broken pipe failures. Also handle
devices that are in diag+rndis mode.
2024-01-10 15:13:28 -08:00
Matthew Garrett
4d39248bf9 Add bootstrapping support
Add tools for launching a root shell on the device, and for sending
serial commands to the device. Extend the make.sh script to push those
and configure a root shell. Commands can now be executed as root via:

adb shell rootshell -c \"touch /tmp/test\"

allowing automatic configuration of the tooling.
2024-01-07 19:45:15 -08:00