Skip to main content

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 IDline_codec
Selected byapp_codec = "line_codec"
PlatformsLinux, Windows, Android
LicenseFree

Decode based on line separator (LF or CRLF)

SettingKeyTypeDefaultNotes
Line Endingline_codec_line_endingText choice"lf"Required

Setting details​

Line Ending​

Allowed values:

ValueLabel
"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"
}
}