39 int main(
int argc,
char **argv)
43 struct ftdi_context ftdic;
48 struct ftdi_device_list *devlist;
49 if ((ret = ftdi_usb_find_all(&ftdic, &devlist, 0x0403, 0x6001)) >= 0) {
50 printf(
"Found %i FTDI devices\n", ret);
51 struct ftdi_device_list *curdev;
52 char manufacturer[128], description[128], serial[128];
54 for (curdev = devlist; curdev != NULL; i++) {
55 printf(
"Checking device: %d\n", i);
56 if ((ret = ftdi_usb_get_strings(&ftdic, curdev->dev, manufacturer, 128, description, 128, serial, 128)) < 0) {
57 printf(
"ftdi_usb_get_strings failed: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
60 printf(
"Manufacturer: %s, Description: %s, Serial: %s\n", manufacturer, description, serial);
61 curdev = curdev->next;
64 printf(
"ftdi_usb_find_all failed: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
66 ftdi_list_free(&devlist);
int main(int argc, char **argv)