I'm working on adding support for a binary-protocol plotter that has only a single byte RX FIFO and no flow control - it works reliably if a 1 millisecond delay is added between transmitted bytes. I've got the protocol sketched out, and added 1ms delays, but when I try to have inkcut run it, it fails. I replaced the plotter with a null-modem cable with a hex-terminal on the other side, it seems twisted/serial buffers up the data and writes it to the serial port in blocks, which skips past the delays.
I need to learn how to use reactor. I tried using reactor.callFromThread() to send the data, but that seems to just pend execution again until later, where it's again buffered and sent.
Is there a way to make the protocol-write wait for the underlying transport/connection finish writing? Is there a better way to approach this?