Exmbus.Parser.Tpl (Exmbus v0.3.0)
View SourceModule 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
@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
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.
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>>}