View Full Version : Serial plugin advice needed

December 31st, 2007, 10:07 PM
I own a NeoThings Berrego 8x4 matrix video switch that can be controlled via a serial interface.

The protocol is very simple, commands look like "[command]" and responses look like "[response]". The active character is "]". So it is very easy to create a lua based serial plugin for this device, using the "CB_TERMINATED" protocol.

I have a small problem though; some responses look like this "[[r1],[r2],[r3]]".

See the embedded terminator (i.e. "]") in the response?

Is there a recommended approach for these responses, or should I code it in C++, as a girder plugin?


December 31st, 2007, 10:17 PM
I believe I have an answer to my question: I think I will use CB_FIXEDLENGTH and set it to a large value, then rely on a time-out occurring to call ReceiveResponse. I can perform error handling in receive response.