|
From: Alan S. <st...@ro...> - 2010-07-20 17:00:29
|
On Tue, 20 Jul 2010, Nikolai Kondrashov wrote: > > How do you envision the tool working? > Do you mean the "wizard" tool or hid-dump? Anyway, here is the plan. > > The hid-dump does the usual libusb setup like opening device, detaching and > claiming interfaces. It finds all the HID interfaces of the specified device > or just uses the specified one. Then it should send Set_Idle request with > wValue set to zero to specify that any reports should be sent when and only > if the state is changed. After that it should dump whatever is received via > interrupt IN endpoints to stdout continuously. It should also support output > pausing/resuming with, say, SIGUSR1/SIGUSR2. It already supports report > descriptor dumping to some extent. I get it. Then the answer to your original question is easy: You don't need to worry about parsing report descriptors, variable report lengths, or anything else. Simply transfer individual maxpacket-sized buffers and dump whatever you get. All reports (except possibly the longest) will terminate with a short packet. In any case, the hid-dump program wouldn't need to parse the reports or determine their boundaries. Alan Stern |