This commit included quite a lot of changes:
* The application arguments are now divided in a read and a write part.
This is realized through structopt subcommands.
* The read and write commands are recognized in a match construction
which takes place after the device is opened.
* I refactored some of the error messages and added more error messages
* The pedals_read() function now is able to read 1, 2, or 3 pedals.
Furthermore, the table is now redrawn with box drawing symbols.
* The write function is tested and successfully writes a key to the
device
In hidapi v0.4.1 it is not yet possible to store the HidDevice in a
struct. Although there is already a pull request to implement this, it is not yet merged.
The read function is now moved into the Pedals object and split up to
read_pedals() (which reads all pedals and prints the output) and
read_pedal() (which only reads one pedal).
Furthermore, the beginning of write_pedal() and write_pedals() is added.