Hi,

I'm just in the process of finishing up firmware/sdk/documentation on a new product we've developed that uses the USB CDC-ACM class. The Product will be available in both USB & RS232 configurations, so using the CDC class saves headaches both device and host side.

We are providing an SDK for the device which wraps up the serial protocol into nice easy to use API calls, so far I have it running on Linux, OS X, Windows and Windows CE.

Under windows I've provided a call to easily open a USB device, it's fairly trivial to find a device by VID & PID and get the COM port number which can then be opened as normal, this does make the USB version completely plug and play (barring the fact that Microsofts class driver for CDC *requires* an .inf file).

I cannot seem to find a solution under linux though, I'm sure there's an easy solution, but I can't find the correct combination of VID/PID/USB/CDC/OPEN to pass to google to find the answer, hoping somebody here might have the solution or might be able to point me off in the right direction.

What I want to achieve is something along the lines of:

Code:

char *deviceName;
int fd;

deviceName = find_usb_device(0x1F1E, 0x0005);

if (!deviceName)
    return;

fd = open(deviceName, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK);
    
if (fd<0)
    return;

....



Thanks

Adrian