Hi.
I'm not new to Arduino but I am a very infrequent user, so please bear with me.
Some context: I'm about two weeks (well, using my free time at work, so probably more like ten hours) into a personal research project, the aim of which is to reprogram an Arduino Leonardo to mimic an existing USB HID game controller - specifically a Logitech G27. I'm reading the third edition of Jan Axelson's USB Complete (because it's free to read online, but all the references to Windows 98 and XP are pushing me toward buying the 5th edition!), snooping on the USB traffic between my G27 and PC using Wireshark and the built-in USBPcap software, reading everything I can get my hands on, accidentally 'bricking' (by changing the VID and PID) then unbricking my Leonardo... But there's a piece missing that I can't figure out.
That is, where would I find the Leo's HID descriptor? The next step in my project is to attempt to replace the Leo's HID descriptor with the descriptor I've gotten out of the G27 with Wireshark to see if the driver recognises it as a G27. I expect there will be more to it than that, of course, but I can't find anything resembling a HID descriptor in the Arduino files. I'm sure it's there, too, and I'm just not recognising it, so I'm hoping someone will tell me where to look so I can stare at it until it makes sense, right now I don't know if USBCore.h or USBAPI.h are just rabbitholes to nowhere or what.
Since I'm posting about it, is there any way I can write the descriptor to the Leo as a hex file? I'm assuming not without a more complex IDE than Arduino, right? I mean I assume the Leo has the descriptor stored somewhere in the memory so if I could read that back using Wireshark, access the memory directly, find the memory addresses that store the descriptor and replace that descriptor with the one from the G27... That might work? I know that's reaching but in the absence of actually knowing what to do or how to find out what I need to know, I'm kind of stuck.
Thanks!