|When the receiving side of this serial port is idle, this sending method works just fine...
public static void SendCommandOutTheSerialPort()
Length = TheCommandToTheBox.Length;
StartingPosition = 0;
TheBytesToSend = TheCommandToTheBox;
myPortPool.myPort.Write(TheBytesToSend, StartingPosition, Length);
In fact, the Serial port can (and will, and does) send anything just fine.
The moment the external box starts sending us data, this method apparently stops and goes into an eternal loop on the last line.
Stopping the app in debug produces not a yellow arrow on the instruction (i.e., the last one in this method) but a green one instead.
Hovering over that green arrow produces this message..
"This is the next statement to execute when this thread returns from the current function"
I do not understand what thread the debugger has in mind, because I didn't start a thread. The only thing I can think of that even strikes the thought of the word "thread" in my mind is the background event handler that is doing the receive.
Just for good measure, I've set some breakpoints in the event handler that responds to bytes received on that same serial port, and it is properly receiving the bytes from the external box.
In fact, that's how we determined that conflict that was causing this. (We made the external box go silent; never sending any data, so this app can send without any response back.)
If it makes any difference, the send method and the receive method are in different classes.
Thanks for any light on the mystery.