IEC60870.InformationObject (ExIEC60870 v0.1.0)

Copy Markdown View Source

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

t()

@type t() :: struct()

Functions

decode_payload(type, ioa, bin)

@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.

encode(io, params, include_ioa? \\ true)

@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.

encode_payload(io)

@spec encode_payload(t()) :: binary()

ioa(map)

@spec ioa(t()) :: non_neg_integer()

Returns the Information Object Address (ioa) of any Information Object struct.

type_id(arg1)

Infers the TypeID atom for any Information Object struct based on its type and timestamp.