News for hackers. Stuff that matters.
[deleted]
Re:Get your own USB PID by nitrogen on Saturday April 04, 2015 @02:50PM (#9321767)
Of course, nobody will connect thousands of USB devices to their computer.

No, but there are thousands of preset IDs in the hundreds of drivers already present on the computer.

For this reason, isn't it safe to pick a random 32-bit identifier?

Devices don't just collide with others on the same computer, but with other drivers on the same computer.

Edit: Unfortunately sillysaurus3 deleted the parent comment. It had an interesting summary of a simulation of the collision problem.

Re:Get your own USB PID by FigBug on Saturday April 04, 2015 @02:57PM (#9321783)
I believe the 32-bit id you select needs to be unique from all the ids your OS knows about or else it will install the wrong driver and may crash / encounter other issues. Of course the user could manually uninstall that driver and install a driver you provided.

But randomly selecting an id doesn't make much sense. For example here are all the ids Linux knows about: http://www.linux-usb.org/usb.ids. Obviously don't select Logitech, Microsoft, Canon, Samsung, etc. manufacture id. Either select an unused manufacture and then randomly select the device id. Or select a manufacturer id that is no longer used like US Robotics (I doubt they are making any new modems) and then randomly select a device id.

As soon as make your device, connect it to a Windows machine which will try and find a driver -- if it doesn't, probably no conflict. If there is a conflict, it's with a product that distributes it's driver manually - so you don't have to worry. Or a product that doesn't exist yet, which could be an issue.