How exactly does a computer know what device is connected on the USB port?
Look at &quot;Universal Serial Bus Specification&quot; Version 2.0 Sections 9.1.2 and 11.12.6
The specification can be found at...
https://www.usb.org/document-library/usb-20-specification
Get the zip file containing all the base specificaiton PDFs and then look in usb_20.pdf.