|
From: Matthias B. <mat...@go...> - 2021-09-22 16:08:34
|
Am Mi., 22. Sept. 2021 um 17:10 Uhr schrieb Robert Ritchey <R.R...@qu...>: > > Hi Matthias, > I wish to apologize for a misstatement I made. See below > > At 11:18 AM 9/22/2021 +0200, Matthias Bolte wrote: > >Am Mi., 22. Sept. 2021 um 03:38 Uhr schrieb Xiaofan Chen <xia...@gm...>: > > > > > > On Wed, Sep 22, 2021 at 7:37 AM Robert Ritchey > > > <R.R...@qu...> wrote: > > > > > > > >A few things to check: > > > >- Why are you only checking the vendor ID before opening the device? > >You should check the product ID too to avoid trying to open the wrong > >device. > > You are right, I do not check the Product ID before opening. > > I guess since this is my Vendor ID and I intend to use this for a number > of devices (which device is checked elsewhere in the code) I did not see a > reason to restrict the USB code to look for specific Product IDs. My > products range with an ID of 1 - 127 and the test fixtures are numbered > from 128 - 255. I guess I could check this range but why would another > device have my Vendor ID and if it did, they could have a Product ID in > the range of 1 -255 anyway. Not everybody has their own VID these days. There were times where you could buy a single PID without owning a full VID. That's why I'm asking. Also are you sure that all your future USB devices with that VID will be compatible with libusb? So there's a bit of future proofing as well. I missed that you check the PID later on but only after you already opened the device. Regards Matthias |