Line Codec
Splits incoming bytes into messages at each line ending (\n, or \r\n when Line Ending is CRLF). The
message payload is the line without its ending; text without an ending stays buffered until one arrives. When
sending, the line ending is appended if the payload does not already end with it.
Use it for line-based text: console logs, NMEA from GPS modules, simple command shells. For AT command modems the AT codec also understands responses, URCs and data prompts.
Configuration reference
| Config ID | line_codec |
| Selected by | app_codec = "line_codec" |
| Platforms | Linux, Windows, Android |
| License | Free |
Decode based on line separator (LF or CRLF)
| Setting | Key | Type | Default | Notes |
|---|---|---|---|---|
| Line Ending | line_codec_line_ending | Text choice | "lf" | Required |
Setting details
Line Ending
Allowed values:
| Value | Label |
|---|---|
"lf" | LF (\n) |
"crlf" | CRLF (\r\n) |
Example config
Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.
{
"app": {
"app_codec": "line_codec"
},
"line_codec": {
"line_codec_line_ending": "lf"
}
}