in reply to Re^2: Writing to serial port with a delay between each character
in thread Writing to serial port with a delay between each character

You can get a count of how many characters (under Linux at least) with the TIOCOUTQ function. Search the module's docs for that. You may be able to keep from flooding the device by keeping your own buffer (which it seems you already do) and only writing when the Device::SerialPort buffer is empty.

You might also want to look into setting the mode to 'raw', but I'm not sure if that actually bypasses buffers or not. You could also look into the write_drain method which seems to go ahead and flush the transmit buffer. You could try calling that after every character you write.

I've only done rudimentary work with the module, and I've never had to deal with such a limited device on the other end. YMMV, but I hope some of this babbling helps.

  • Comment on Re^3: Writing to serial port with a delay between each character