Exmbus.Parser.Tpl (Exmbus v0.3.0)

View Source

Module responsible for handling the transport layer. Primarily described in EN 13757-7:2018.

See also the Exmbus.Parser.CI module.

Summary

Functions

Parses a transport layer and adds it to the parse context. This function will return an error if the first byte is not a CI field describing a transport layer.

Decode a TPL long header.

Types

t()

@type t() :: %Exmbus.Parser.Tpl{
  frame_type: :format_frame | :full_frame | :compact_frame,
  header:
    Exmbus.Parser.Tpl.Header.None.t()
    | Exmbus.Parser.Tpl.Header.Short.t()
    | Exmbus.Parser.Tpl.Header.Long.t()
}

Functions

decrypt_bin(ctx)

See Exmbus.Parser.Tpl.Encryption.decrypt_bin/1.

parse(ctx)

Parses a transport layer and adds it to the parse context. This function will return an error if the first byte is not a CI field describing a transport layer.

parse_tpl_header_long(arg)

Decode a TPL long header.

iex> parse_tpl_header_long(<<0x78,0x56,0x34,0x12,0x93,0x15,0x33,0x03,0x2A,0x00,0x00,0x00,0xFF,0xFF>>) {:ok, %Exmbus.Parser.Tpl.Header.Long{

identification_no: "12345678",
manufacturer: "ELS",
version: 51,
device: %Exmbus.Parser.Tpl.Device{id: 0x03},
access_no: 42,
status: %Exmbus.Parser.Tpl.Status{},
configuration_field: %Exmbus.Parser.Tpl.ConfigurationField{},

}, <<0xFF, 0xFF>>}