Nerves.UART v0.1.0 Nerves.UART.Framing.Line
Each message is one line. This framer appends and removes newline sequences as part of the framing. Buffering is performed internally, so users can get the complete messages under normal circumstances. Attention should be paid to the following:
- Lines must have a fixed max length so that a misbehaving sender can’t
cause unbounded buffer expansion. When the max length is passed, a
{:partial, data}
is reported. The application can decide what to do with this. - The separation character varies depending on the target device. Some devices require “ “ sequences, so be sure to specify this. Currently only one or two character separators are supported.
- It may be desirable to set a
:rx_framer_timeout
to prevent characters received in error from collecting during idle times. When the receive timer expires,{:partial, data}
is reported. - Line separators must be ASCII characters (0-127) or be valid UTF-8 sequences. If the device only sends ASCII, high characters (128-255) should work as well. [Note: please report if using extended characters.]