I'm not sure if this question is in the right stackexchange site because it's a mix of programming and hardware. Admin, feel free to move it to another stackexchange site.
Here is the problem:
I've programmed a small application (C++ MFC) that read the output of a GPS (Garmin that output NMEA) via a serial port (COM 1). Everything is working great so far but for field testing, we needed to use it on a laptop that didn't have a COM port.
So we purchased a SABRENT USB to serial cable for the testing phase. I installed the driver of the cable and everything was ok. But each time we unplug/replug the cable OR each time the computer is restarted, the GPS is detected as a serial mouse. When the GPS is detected as a serial mouse, the mouse start to move everywhere, clicking and double-clicking randomly causing a major problem.
This never happened using the physical COM port on my computer.
Here are the solution that I've read and tried that doesn't work:
- Only plug the USB cable after the boot of the computer is complete: It seems to work only if the user doesn't unplug and replug the USB cable. Since pluging and unpluging the GPS while troubleshooting is very common thing, this solution can not be used. Also, pluging after rebooting can not be a stable solution since this GPS will be permanently installed to a computer in a truck used by technician that know little about computers, I don't want them to mess with waiting the reboot of the computer before connecting GPS.
- Adding the key SkipEnumerations to the registry for the COM port causing the error: This can't be done because each time the USB is plugged, a virtual COM port is created and the number is pretty random (COM6, COM7, etc). Also, virtual COM port are not in the registry.
- Disable the detected serial mouse: This is impossible to do because when the mouse is detected, I can't control my normal mouse anymore and it's a total mayhem. As soon as I unplug the usb cable, the mouse dissapear from the device manager so it's too late.