Exmbus.Parser.IdentificationNo (Exmbus v0.3.0)
View SourceDecode/Encode identification number (BCD) to/from binary representation.
The identification number is a 4-byte binary representation of a BCD number.
It can optionally contain F
representing a wildcard digit.
iex> decode(<<0x78, 0x56, 0x34, 0x12>>)
{:ok, "12345678"}
iex> decode(<<0x78, 0x56, 0x34, 0xF2>>)
{:ok, "F2345678"}
iex> encode("12345678")
{:ok, <<0x78, 0x56, 0x34, 0x12>>}
iex> encode(12345678)
{:ok, <<0x78, 0x56, 0x34, 0x12>>}
Summary
Functions
Decode from the binary representation of the identification number (BCD)
Encode the identification number to binary representation (BCD)