Преглед изворни кода

test: Remove superfluous null byte from ps3_hid_report_descriptor

Remove a superfluous null byte at the end of ps3_hid_report_descriptor,
as it might confuse some more stricter parser.

The data in ps3_hid_report_descriptor probably comes for a libinput
recording, and sometimes those can have superfluous null byte at the
end.

This is mentioned for example in the hidreport project:
https://github.com/hidutils/hidreport/blob/64d40674038e8bb5e76c4191f5561ec1928c3c72/tools/libinput-recording-extract-hid-descriptor.py#L25-L27

As a proof that the original HID report descriptor of the actual device
is 148 bytes long, the following lsusb capture can be compared:
http://ps3.jim.sh/sixaxis/usb/lsusb.txt

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
Antonio Ospite пре 2 месеци
родитељ
комит
d330686798
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      test/testevdev.c

+ 2 - 2
test/testevdev.c

@@ -194,9 +194,9 @@ static unsigned char ps3_hid_report_descriptor[] =
     0xc0, 0xa1, 0x02, 0x85, 0xee, 0x75, 0x08, 0x95,
     0xc0, 0xa1, 0x02, 0x85, 0xee, 0x75, 0x08, 0x95,
     0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02,
     0x30, 0x09, 0x01, 0xb1, 0x02, 0xc0, 0xa1, 0x02,
     0x85, 0xef, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01,
     0x85, 0xef, 0x75, 0x08, 0x95, 0x30, 0x09, 0x01,
-    0xb1, 0x02, 0xc0, 0xc0, 0x00,
+    0xb1, 0x02, 0xc0, 0xc0,
 };
 };
-SDL_COMPILE_TIME_ASSERT (ps3, sizeof (ps3_hid_report_descriptor) == 149);
+SDL_COMPILE_TIME_ASSERT (ps3, sizeof (ps3_hid_report_descriptor) == 148);
 
 
 /* Same for Steam Deck LCD (jupiter) and OLED (galileo) */
 /* Same for Steam Deck LCD (jupiter) and OLED (galileo) */
 static unsigned char steam_deck_mouse_hid_report_descriptor[] =
 static unsigned char steam_deck_mouse_hid_report_descriptor[] =