amperka / serial-projector

A simple Chrome Application that shows last line of text got from serial port with a big font.
MIT License
40 stars 18 forks source link

Displayed line lags behind serial stream #6

Open stg opened 4 years ago

stg commented 4 years ago

Under some circumstances the displayed line lags behind, is not the latest. This is easily reproduced by having a device send multiple lines in one shot. It also happens when connecting to a USB serial port that has multiple lines buffered, all of which are received at once.

The problem (I believe) is in connection.js _onReceive. The function seems to only look for the first line break in "buffer". If buffer contains more than one line break, the last line will not be displayed and the display will not progress to the next line until more data is received. If that data contains additional line breaks, the problem will persist.