Exmbus.Parser.Apl.FormatFrame (Exmbus v0.6.1)

View Source

Parser for a format frame.

A FormatFrame contains headers. It can be used on combination with a CompactFrame to create a full frame.

Summary

Functions

Parse a FormatFrame from header bytes (no length or format signature)

Convert the format frame to bytes.

Types

t()

@type t() :: %Exmbus.Parser.Apl.FormatFrame{
  headers: [Exmbus.Parser.Apl.DataRecord.Header.t()]
}

Functions

format_signature(frame)

from_full_frame!(full_frame)

from_header_bytes(bytes)

@spec from_header_bytes(binary()) :: {:ok, t()} | {:error, [any()]}

Parse a FormatFrame from header bytes (no length or format signature)

This is usually required to get a FormatFrame from stored header bytes.

parse(ctx)

to_header_bytes(format_frame)

@spec to_header_bytes(t()) :: binary()

Convert the format frame to bytes.

This is useful for persisting the format frames or for calculating the format signature.