Check which serial port a device is on

I have a glucose device that I am using to get readings from. I have been looking online for weeks now for a way to check what device is connected to which port. I am able to write commands to a port and read a port and get the glucose reading from the device. But with one problem, the user has to know the port that the device is connected to. This is not very user friendly. I would like to be able to call something that can return what devices are connected to what ports. I don't no much about usb but I think devices have some way of telling the OS what it is so that the drivers can be loaded, correct? If so is there a way of checking in C++ or C what port my device is on.
Your best bet is to poll each available port until you get the response from your device that identifies itself.

e.g sending AT to a modem will return OK.
Topic archived. No new replies allowed.