|
From: Tim R. <ti...@pr...> - 2024-09-19 18:08:26
|
Aaron Gomez | Rother Industries & Technology wrote: > > I have been looking at the libusb source code and I have seen that > there are function to recognize the devices connect via USB and get a > list of them, a function to open devices by vendor ID and product ID, > a function to get the device descriptor and and many more. > > I would like to know if it is possible to obtain communication through > the serial port using an FTDI device. > Which FTDI device? Is it the FT232R? > I have been trying to open my device and perform data transfer but I > have not been able to do so. The steps I have followed have been to > initialize libusb, get the list of devices and get the device > descriptor. I recognized my device by vendor ID and product ID. I > reference the device, I open it and check the function > libusb_kernel_driver_active and libusb_claim_interface but at this > point I get an error. This error is LIBUSB_ERROR_PIPE. > The big problem is that the FT232R is not a USB Communication Class-compliant device. So, you can't just plug it in and use a standard USB serial port driver. Further, FTDI has never documented the protocol their devices use. You can't know which registers to poke for configuration, or what status values mean, or even which pipes carry which data. Thus, you are essentially forced to use their D2XX drivers. Fortunately, those drivers are fairly thin, so they don't add a lot of overhead. > Is it possible to communicate with the device only by using libusb > library? > Is it possible? Theoretically, yes, but only if you have the time, the energy, and the expertise to reverse engineer the protocol from a running device. In practical terms, no. Just use the drivers from FTDI. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |