cmd/jankboot: add getvar command
pkg/getVar: add method for fetching variables from client device
pkg/openIOEndpoint: add method for opening endpoints
Removes some code duplication
pkg/getResponse: parse responses based on list of valid client status
The list comes from the fastboot spec.
pkg/{get,check}Response: use a type for response+status
It's not exported because no exported methods return it. Obviously that
can change in the future!
pkg/ListDevices: don't send fb commands to devices during detection
The implementation this replaces was suuuuper janky, even for jankboot.
It resulted in some devices (e.g. hubs) getting "stuck". This queries
device class/subclass/protocol for what should be a device in fastboot
mode.
The values for class, subclass and protocol are from running lsusb on a
motorola harpia in fastboot mode:
$ lsusb -v -d 1:24
...
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 66
bInterfaceProtocol 3
I hope that's the same for other devices too...
pkg/send{data,command}: don't panic on failure
Return an error just like everything else
cmd/jankboot: add option to boot a boot.img
pkg/Boot: add initial implemention for sending/booting a boot.img
pkg/sendData: include 'data phase' initialization
The initialization for the 'data phase' doesn't make sense to have
outside of sendData since it'll have to be done every single time
sendData is called.
pkg/jankboot: document all functions and methods
README: include usage info
cmd/jankboot: print usage if no or invalid options specified
cmd/jankboot: add option for flashing partitions
pkg/Flash: add initial implementation for flashing partitions
I think the actual flash progress still needs some work, according to
the protocol clients will report progress when instructed to flash.
pkg/sendData: add method for data transfer to client
pkg/getResponse: add helper function
pkg/checkResponse: add helper function
cmd/jankboot: don't take a reference to the device ptr
devices is now a list of FastbootDevice pointers