View Single Post
Old 10-02-2022, 11:56 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Cactus Chef View Post
I've glanced at the code, too, and sometimes it seems like adding "support" is just a matter of bumping up a few values here and there. What's not clear to me is where those magic hex values come from for the DEVICE_PRODUCT_ID. Is that coming from the manufacturer, or something generated by the driver to keep track of the unique devices?
The device USB ids come from the manufacturer. You can easily get them for a new device using calibre's "Get information to setup the user defined device" dialog (Preferences / Miscellaneous). It asks you to unplug the device (if needed), then plug it in. It displays the USB ids that appeared. These ids get added to the appropriate driver. For example, going through the process using my Pixel 6 I get:
Code:
USB Vendor ID (in hex): 0x18d1
USB Product ID (in hex): 0x4ee1
USB Revision ID (in hex): 0x510
One problem: sometimes manufacturers just make up the ids instead of getting them "officially". We have seen conflicts where a device appears as something else. Fortunately this doesn't often happen, and AFAIK never happens with quality companies.

Another problem: sometimes the new devices don't quite act the same as the previous ones. This is why the KOBOTOUCH driver lists the ids one by one; it can do different things depending on them.
chaley is offline   Reply With Quote