gauteh / defmt-serial

Log defmt messages over the serial port.
23 stars 6 forks source link

README suggests questionable socat options #12

Closed jamesmunns closed 4 months ago

jamesmunns commented 4 months ago

https://github.com/gauteh/defmt-serial?tab=readme-ov-file#parsing-logs suggests the "CRNL" option which according to docs:

`crnl’ causes explicit character conversions

You probably don't want to do characater conversions (I think it replaces CR with CRLF, or 0x0D to 0x0D 0x0A, but I'm not certain about that), as that will corrupt the binary stream.

I think after reading https://github.com/3ndG4me/socat/blob/3f33a20e3556558c459ece8582d8ef4a7e9f1fb2/socat.c#L1403-L1413, with the input as CRNL and the output as default (raw?), it will drop \r characters, basically dropping any bytes with the value 0x0D.

gauteh commented 4 months ago

Yes. I think you're right. I should also mention that it seems like socat on Mac is broken, and its better to use stty+cat.