Esp32.SLIP (esp32 v0.2.0)

Copy Markdown View Source

SLIP framing for the ESP serial bootloader.

Frames are delimited by 0xC0; 0xC0 and 0xDB inside a frame are escaped as 0xDB 0xDC and 0xDB 0xDD. The module also implements Circuits.UART.Framing so that Circuits.UART.read/2 yields one decoded frame at a time.

Summary

Functions

Unescapes a frame body (the bytes between the delimiters).

Encodes data as one SLIP frame.

Functions

decode(body)

@spec decode(binary()) :: {:ok, binary()} | {:error, :invalid_escape}

Unescapes a frame body (the bytes between the delimiters).

encode(data)

@spec encode(binary()) :: binary()

Encodes data as one SLIP frame.