Exmbus.Parser.Afl.MessageControlField (Exmbus v0.4.0)
View SourceAFL Message Control Field (MCL) as per EN 13757-7:2018
| Bit | Field Name | Description |
|---|---|---|
| 7 | RES | Reserved (0b0 by default) |
| 6 | MLMP | Message Length in Message Present *a |
| 5 | MCMP | Message counter in Message Present *a |
| 4 | KIMP | Key Information in Message Present *a |
| 3 | AT | |
| 2 | AT | Authentication-Type (see Table 6) |
| 1 | AT | |
| 0 | AT |
*a0 = field is not present; 1 = field is present
The bits 4 to 7 in the AFL.MCL field define the presence of additional fields in the message.
If the AFL.MCL field is used it always shall be present in the first fragment. It shall not be present in any following fragments of the same message.
That is, we can expect the MCL field in fragment_id == 0x01.
Summary
Functions
Returns the authentication type and it's length
Parses the Message Control Field (MCL) from the AFL.
Encodes the Message Control Field (MCL) to a binary.
Functions
Returns the authentication type and it's length
Parses the Message Control Field (MCL) from the AFL.
Examples
iex> decode(<<0b00000000>>)
{:ok, %Exmbus.Parser.Afl.MessageControlField{
message_length_present?: false,
message_counter_present?: false,
key_information_present?: false,
authentication_type: 0
}}
Encodes the Message Control Field (MCL) to a binary.
Examples
iex> encode(%Exmbus.Parser.Afl.MessageControlField{
...> message_length_present?: false,
...> message_counter_present?: false,
...> key_information_present?: false,
...> authentication_type: 0b0000
...> })
<<0b00000000>>
iex> encode(%Exmbus.Parser.Afl.MessageControlField{
...> message_length_present?: true,
...> message_counter_present?: true,
...> key_information_present?: true,
...> authentication_type: 0b0011
...> })
<<0b01110011>>
iex> encode(nil)
<<>>