Unified dispatcher and helper functions for all IEC 60870-5-101/104 Information Objects.
Summary
Functions
Decodes an Information Object payload for a known type_atom and ioa.
Encodes an Information Object into binary.
If include_ioa? is true, prepends the encoded IOA (1..3 bytes per params).
For sequence elements (SQ=1, element index > 0), include_ioa? is false.
Returns the Information Object Address (ioa) of any Information Object struct.
Infers the TypeID atom for any Information Object struct based on its type and timestamp.
Types
@type t() :: struct()
Functions
@spec decode_payload(IEC60870.Types.TypeID.t(), non_neg_integer(), binary()) :: {:ok, t(), binary()} | {:error, term()}
Decodes an Information Object payload for a known type_atom and ioa.
@spec encode(t(), IEC60870.AppLayerParameters.t(), boolean()) :: binary()
Encodes an Information Object into binary.
If include_ioa? is true, prepends the encoded IOA (1..3 bytes per params).
For sequence elements (SQ=1, element index > 0), include_ioa? is false.
@spec ioa(t()) :: non_neg_integer()
Returns the Information Object Address (ioa) of any Information Object struct.
@spec type_id(t()) :: IEC60870.Types.TypeID.name() | IEC60870.Types.TypeID.code()
Infers the TypeID atom for any Information Object struct based on its type and timestamp.