Computer Interfacing
Discussions about interfacing and electronics

USB/RS232 adapter hangs

USB/RS232 adapter hangs on xOff forever


       Computer Interfacing Forum Index -> USB universal serial bus
Author Message

Dec 03, 2009 12:40 pm

n application is transmitting data out of the Com (RS232) port.
It receives xOff so stops transmitting and waits for xOn

If the remote device does not send xOn - for example it is disconnected and goes away the application never receives xOn so the com port is blocked waiting for xOn forever.

When the Com port is a physical com port then the application can simply time out, close the port, reopen it and it's ready to go - no problem.

But if the Com port is a USB/RS232 adapter then the block seems to be lower down in the USB driver and closing the virtual com driver does not clear the port. It remains blocked. Calling API functions such as ClearCom, PurgeCom, Cancelio and even CloseHandle doesn't clear it. When you open the port it's still blocked. Closing and restarting the application appears to work 'sometimes'.

The only guaranteed way to clear the blockage is to unplug the USB cable and plug it back in again.

Does anyone know of an API call that could reset the USB driver ? Or maybe somebody has had this problem and knows of a fix ?


       Computer Interfacing Forum Index -> USB universal serial bus
Page 1 of 1

Running on php BB © 2001, 2009 php BB Group
   Lammert Bies     Interfacing     Sitemap     Forum