Hi. I've written a program (using Borland C++ Builder), to read in some data from the serial port (COM1)and to be able to send data back out through the port. I use the API CreatFile() to open the port and
CloseHandle(handle) to close the port. I've been using another program on a second computer to send data to my application (running on the first computer) and to receive data from my application. When I open COM1
in my application, the program on the second computer reports as follows:
CTS: ON, DSR: ON, RLSD(CD): ON , which is all fine. The problem seems to be when I close the port.
The report is then... CTS: OFF, DSR: OFF, RLSD(CD): OFF , this is also fine, but then immediately following that, it reports... CTS: ON
I'm not sure if this is correct, but by this report, it appears that the lines are being turned OFF, but then, for some reason, CTS is being switched ON again. I'm a little confused by this, as I would have thought that CloseHandle(handle) would closed everything and freed up the port. Could you tell me what the problem is here please? Many thanks, I.Price
Start Free Trial