AdvancedSerial icon indicating copy to clipboard operation
AdvancedSerial copied to clipboard

What happens when <CRLN> is sent as logging data?

Open sebaJoSt opened this issue 6 years ago • 3 comments

for example first value = 0x0D (decimal 13) and second valule =0x0A (10 decimal). Is the data stream the cut off at this location?

Thanks for the useful lib Sebastian

sebaJoSt avatar Aug 07 '18 20:08 sebaJoSt

All data is read into a buffer until CRLF is found.
Line 62 of the code is what is looking for carriage return line feed.

if ((buffer[ReadBuffPos] == '\n')&&(buffer[ReadBuffPos-1] == '\r'))

This is looking for specifically Carriage Return '\r' (0x0d) followed by Line Feed '\n' (0x0a). After this sequence is detected, it will process the buffer and read the messages. Any following messages will go into the buffer until another subsequent CRLF. Does that answer your question?

Nick1787 avatar Aug 13 '18 02:08 Nick1787

Thanks Nick, but what happens when the logging data itself contains this CLFR data (same bytes) ? Is the asi stream then cutoff at this position?

sebaJoSt avatar Aug 17 '18 08:08 sebaJoSt

Ahh I see your question. Yes I believe that Would happen. I built this to be compatible with arduinos aerial terminal which I believe is terminated by crlf characters.

I don’t see any reason this can’t be an enhancement of the tool to allow this to be configurable though. I don’t think at something I would work on in short term though unfortunately.

Nick1787 avatar Aug 17 '18 10:08 Nick1787