I am experimenting with creating a virtualised transparent mode over API 2
Frame data is created from queues within Stream classes - essentially creating virtual Serial drivers that know how to manipulate the API packets and character queue buffers.
I have a basic version working with an Arduino sketch and sub classed stream library, and a nodejs gateway.
However, problems seem to crop up on the Arduino side with regard to buffer overflows and corruption when data rates get too fast.
I have tried adding delays, reducing packet sizes, waiting for acks - but am still getting errors.
A clue appears to be in the packet options flag - 0xC1 indicates a healthy packet. Whereas a range of other values (i.e. 0x2F or 0x80) indicate a problem.
Any tips on how to optimise this, and perhaps check for buffer overflows before sending, removing acks perhaps, would be appreciated.