Getting information on a particular serial port.
#include <stdio.h>
int main(int argc, char **argv)
{
if (argc != 2) {
printf("Usage: %s <port name>\n", argv[0]);
return -1;
}
char *port_name = argv[1];
printf("Looking for port %s.\n", port_name);
printf("sp_get_port_by_name() failed!\n");
return -1;
}
printf("Type: Native\n");
printf("Type: USB\n");
int usb_vid, usb_pid;
printf("VID: %04X PID: %04X\n", usb_vid, usb_pid);
int usb_bus, usb_address;
printf("Bus: %d Address: %d\n", usb_bus, usb_address);
printf("Type: Bluetooth\n");
}
printf("Freeing port.\n");
return 0;
}