- 10 Feb, 2021 4 commits
-
-
Peter Hutterer authored
May be nice to have for symmetry with the max value, but really, nothing reads this value. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
We'll get that if we ctrl+c or unplug a device, let's just print it as normal message, no need for a stack trace here. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Together with better visual alignment Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 09 Feb, 2021 1 commit
-
-
Peter Hutterer authored
As the comment suggests, if a report (i.e. the event data) is larger than it should be according to the ReportDescriptor, that's fine, we'll just end up ignoring the bits. This fixes issues with the stylus recordings seen in libinput/libinput!558 (comment 792834) That device sends 32 bytes for report ID 8 (13 bytes in the descriptor) Fixes #32Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 08 Feb, 2021 3 commits
-
-
Peter Hutterer authored
I spent too long wondering why we fail a job but don't actually have any explanation what failed or artifacts in this stage. So let's simply add a message that points us to where those can be found. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
No point running through the array twice if we can just do it all in one go. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Where the file wasn't a human-readable descriptor, we'd end up returning an empty list - and that is not None. So we ended up never detecting the format. Regression introduced in 6de38774Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 25 Jan, 2021 1 commit
-
-
Peter Hutterer authored
These tests must be invoked via pytest, so let's remove the exec bit. It wasn't set on all tests anyway. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 22 Jan, 2021 5 commits
-
-
Peter Hutterer authored
Feature Reports can be const if they represent physical device properties, e.g. Keyboard Physical Layout. Format those accordingly unless the Usage is zero. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
In cases where we only have the HidReport object itself to pass around, it's still useful to know which type that report is. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
bytes(x) gives us x bytes with value zero, making it a bit simpler than decoding and ljust-ing a '\0' string. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
For input/output reports we don't really care about const items, they're likely just padding. But Feature reports may have const items with meaningful Usages, specified through min/max. For example my keyboard here has Keyboard Physical Layout, Keyboard Form Factor, etc. 0x05, 0x0c, // Usage Page (Consumer Devices) 56 0x0a, 0xc0, 0x02, // Usage (Extended Keyboard Attributes Collection) 58 0xa1, 0x02, // Collection (Logical) 61 0x1a, 0xc1, 0x02, // Usage Minimum (705) 63 0x2a, 0xc6, 0x02, // Usage Maximum (710) 66 0x95, 0x06, // Report Count (6) 69 0xb1, 0x03, // Feature (Cnst,Var,Abs) 71 0xc0, // End Collection 73 When parsing those, extract them as separate items, just like we do for the variable data. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Slightly less confusing, I hope. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 20 Jan, 2021 2 commits
-
-
Benjamin Tissoires authored
On Fedora 33, the power_supply is not presented by udev with an 'add' event, but a 'change'. Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
We have a test that checks for the battery, but we present the device whenever the inputs and leds are ready. This does not impact normally because the battery is presented by the kernel before the power_supply is added, but if we fail at adding the power_supply, we are failing with an incorrect message. Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
- 19 Jan, 2021 18 commits
-
-
Peter Hutterer authored
Printing the human form from an rdesc and re-reading that form should yield the same report descriptor as before. For the test we use the same rdesc as for the parsing test above, with some Logical Maximums fixed manually to only use the number of bytes they should use. Since we don't (yet) parse the byte number at the end of the human output, we cannot guess that 0xff wants 2 bytes in the item. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
This is the format that hid-record spits out as part of the comments, e.g. Usage Page (Power Device) 0 Usage (Vendor Usage 0x04) 2 Collection (Application) 4 Usage (Vendor Usage 0x24) 6 Collection (Physical) 8 Usage (Vendor Usage 0x02) 10 We just search for at least one line with 'Usage Page (', if it exists then we pass it to the parser. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
When parsing a human description, match the twos comp calculation from where we generated the value to begin with. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
We shouldn't care about preceding spaces Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
This is the inverse of HidUnit.__str__(), generating the object from a generated output string. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Allows us to go from a parsed HidUnit back to the 4-byte value it represents. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Aside from better 'type safety' it moves all the code related to collections handling/parsing into one location. The new parsing code is more flexible than the old one too, previously we only checked for a fixed prefix, the regex now is more flexible in regards to whitespaces and how the hex code is written. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
It's unclear why this was handled this way but it produced wrong calculations for items at the bit boundary - all those got bumped up to the next size (e.g. vendor usage 0xffff ended up being 0x0000ffff in the report because it got bumped to the next size). The number of bytes needed is simply whatever the actual value requires, no need to count the length of the hex string. This produces the wrong value for cases where extra bytes are present in the original file descriptor, e.g. this case: # 0x26, 0xff, 0x00, // Logical Maximum (255) This line reconverted would output a single-byte only # 0x25, 0xff // Logical Maximum (255) Without parsing the byte count at the end of the outputted line, this isn't something that can be fixed here. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Unit(None) is a value of 0, so let's get on with it. This should be handled correctly by the normal parser, but until that one is fixed just make this one a special case. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
All predefined systems have None at index 0 Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Before: Collection (Vendor_defined) After: Collection (Vendor_defined 0x81) This matches our behaviour for vendor usages/usage pages and is required to recover the exact bytes from the human description. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
The comments we print will append the byte in the line, so we end up with this: End Collection 123 End Collection doesn't have parenthesis, so it's not covered by the existing condition. Let's handle it separately. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
For those strings, the value is the 0xd0. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
parse() is too flimsy when it comes to handling optional whitespaces, let's replace it with regex matching. This now correctly handles the optional exponent and the case of Unit(None) Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 18 Jan, 2021 3 commits
-
-
Benjamin Tissoires authored
In case of a failure, it might be interesting to have a peek at the console log. Export it as an artifact. Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Allowed to fail because we're not tracking the upstream kernel so some tests are expected to fail. But this will at least detect severe breakages that pass the existing flake/setup.py checks. Before we can run the test though we need to modprobe all of the hid modules. The ITE keyboard has its own kernel module and that causes device creation to fail, specifically: "It turns out that this device loads the hid_ite kernel module. So what happens is that we create the hid device, hid-generic sees it, presents the nodes to the userspace, but then udev loads hid-ite, which kills the input nodes attached to hid-generic and everything related to it. The next attempt at loading the device works fine, because hid-ite is there already." See #29 (comment 766562) Simply modprobing all modules before we run the test fixes this issue. This is a separate script to avoid the escaping of subshells otherwise needed to get to the kernel module path. Fixes #29Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 14 Jan, 2021 3 commits
-
-
Peter Hutterer authored
Prep work for enabling qemu images - ci-templates does not support those for arch yet so Fedora it is. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Create an (arch) image and use that to run our jobs. For now this primarily avoids falling afoul of the docker pull limits. No real functional changes, at least while the Arch image is recent. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
We don't need udev rules until we run a test that creates a test device. So we modify our class to set up the udev rule on the second context entered (first is session, second is the current test case) and clean up once the last context (== session context) is exited. This way we never mess with udev rules if we only run tests without test devices. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-