Application layer parameters shared by IEC 60870-5-101 and IEC 60870-5-104.
Corresponds to sCS101_AppLayerParameters in lib60870-C.
Summary
Functions
Decodes an Information Object Address (IOA) according to size_of_ioa (little-endian).
Default parameters for IEC 60870-5-101 (COT=1 or 2, CA=1 or 2, IOA=2 or 3, maxASDU=253).
Match lib60870-C defaults (COT=2, CA=2, IOA=3, maxASDU=249) unless overridden.
Default parameters for IEC 60870-5-104 (COT=2, CA=2, IOA=3, maxASDU=249).
Encodes an Information Object Address (IOA) according to size_of_ioa (little-endian).
Returns the byte length of the ASDU header (TypeID + VSQ + COT(+OA) + CA).
Types
@type t() :: %IEC60870.AppLayerParameters{ max_size_of_asdu: pos_integer(), originator_address: 0..255, size_of_ca: 1 | 2, size_of_cot: 1 | 2, size_of_ioa: 1 | 2 | 3, size_of_type_id: 1, size_of_vsq: 1 }
Functions
@spec decode_ioa(t(), binary()) :: {:ok, non_neg_integer(), binary()} | {:error, :insufficient_data}
Decodes an Information Object Address (IOA) according to size_of_ioa (little-endian).
Default parameters for IEC 60870-5-101 (COT=1 or 2, CA=1 or 2, IOA=2 or 3, maxASDU=253).
Match lib60870-C defaults (COT=2, CA=2, IOA=3, maxASDU=249) unless overridden.
Default parameters for IEC 60870-5-104 (COT=2, CA=2, IOA=3, maxASDU=249).
@spec encode_ioa(t(), non_neg_integer()) :: binary()
Encodes an Information Object Address (IOA) according to size_of_ioa (little-endian).
@spec header_length(t()) :: pos_integer()
Returns the byte length of the ASDU header (TypeID + VSQ + COT(+OA) + CA).