As a workaround I originally disabled the USB Selective Suspend setting in my power management plan, but after this worked and stopped the disconnections, I've ended up reenabling this, and changing the power management settings in the device manager for the USB Root Hub that the data cable is plugged into. I've set this so Windows will not "turn off this device to save power". As most computers these days seem to have just about one hub per port, this allows all the other USB devices to shutdown nicely, while not affecting the data cable.
I am using the SerialPort class, and no have not specified a timeout. I don't mind the waiting indefinately, although with the limits of the class, this means that unplugging the data cable and then plugging back in is not handled particularly well at this time. Will get around to fixing that one day.
Although the workaround sorts the problem out, I do think that the driver for the data cable, should not allow itself to be shutdown though when there is an active connection on it.
|