# `Circuits.UART.Framing.Line`
[🔗](https://github.com/elixir-circuits/circuits_uart/blob/v1.5.5/lib/uart/framing/line.ex#L9)

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:

1. 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.
2. The separation character varies depending on the target device. See
   "Separator" section to see how to specify this.
3. It may be desirable to set a `:rx_framing_timeout` to prevent
   characters received in error from collecting during idle times. When the
   receive timer expires, `{:partial, data}` is reported.
4. 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.]

## Separator

Some devices require `"\r\n"` sequences. If you are using one of these
devices, a LTE modem for example, you can specify the separator like so:

```elixir
Circuits.UART.open(uart, tty_name, framing: {Circuits.UART.Framing.Line, separator: "\r\n"})
```

By default the separator is `"\n"`. Currently only one or two character
separators are supported.

# `add_framing`

# `buffer_empty?`

# `flush`

# `frame_timeout`

# `init`

# `remove_framing`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
