Chromatix wrote:
Or, you could wait for input before switching back to console mode.
Maybe my post wasn't quite clear. From my Monitor code, I can receive packets from Serial perfectly fine, but then again, with Xmodem, the receiving end is what controls the transfer of packets, not the sender.
I noticed the problem after adding the function to Send data from my Monitor to Serial. As Serial is the receiving end, it controls the transfer of packets via standard Xmodem protocol. Once the transfer is completed (my Monitor sending an EOT and Serial responding with an ACK), Serial presents a dialogue box to enter the filename to save the received data to. During this time, Serial doesn't acknowledge or buffer any data received (from my Monitor) until the filename entry and save is completed. In other words, it just looses the data received.
As a result of this behavior, I can't actually code anything that will change it, other than adding the 15 seconds delay, after which my Monitor will send a Data Transfer Complete message. However, if I don't complete the entry and save of the filename within the 15 seconds, the final message data will be ignored by serial. It's an annoying bug within serial... and likely less of an issue for other users, as my Monitor uses the same serial port for console and Xmodem data transfers.
Hopefully this makes the issue more clear.