How can you tell when a SerialPort.Write completes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a device that transmits at a diffenent baud rate than it receives.
This means I need to send it a message, change the baud, wait for its reply,
change the baud back.
The problem is that if I change the baud before the query message has
completely written then the device will not understand it. If I wait too
long then I will not understand its reply.
In other words, I need to know when the last byte of the message I'm writing
has been sent. I'm in C# with MS2005 on a WM5.0 device.
I had hoped I could wait for SerialPort.BytesToWrite == 0, but it is always
0 so no joy.
Any help would be appreciated.
Jim
 
Back
Top