tools: parse_rdesc: use .dump method instead loop over items

the object allows us to directly dump it, so use this.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_rdesc: remove trailing whitespace in raw values

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_rdesc: create a very hackish kernel compliant output

hackish because you need to put another arg (whatever it is) to get this
to not break previous outputs.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_rdesc: decrease indent level

this lead to long lines, mark indents with only one whitespace.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: parse_hid: mark missing raw values by <.>

When the report descriptors declare more fields than we actually received,
instead of putting 0, put a specific marker so the user know which fields
are missing in teh report (or which fields are in excess in the report
descriptor).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: editor: separate fields in the editor

Each input report is separated from the other by one blank line.
Each report is separated by a dash line.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: editor: also remember the horizontal scrolling in the events view

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbmon2hid-replay: use a dict in HID_COMMANDS

using an array is good for compactness but prevents us adding new fields

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbmon2hid-replay: add get/set report parsing

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbmon2hid-replay: add debug param while parsing the reports

allows to get access to raw data while debugging the script

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbmon2hid-replay: rename request into request_device

this will be called when the device answers, so mark it

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbmon2hid-replay: parse completely the Control prefix

It started getting difficult finding all the way through the different
"params" arguments. So take the full ctrl prefix and parse it for all the
requests.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbhid2hid-replay: parse once for all the ctrl prefix

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbhid2hid-replay: add callback for Ctrl Out also

Set_report are callbacks emitted by the host to the device.
We need to get access to the data sent by the host, and thus add a new
callback mechanism.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
tools: usbhid2hid-replay: objectify HID_COMMANDS array

we are in python, and it removes a bunch of quotes

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>