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