Represents a file composed of one or more binary sections for IEC 60870-5-101/104 File Transfer
(CS101_IFileProvider / CS101_TransparentFile in cs101_file_service.h).
Summary
Functions
Extracts a segment binary from section_index (0-based) starting at offset with size.
Creates a new TransparentFile with (nof, data).
Creates a new TransparentFile with (nof, name, data) or (nof, data, opts).
Creates a new TransparentFile with (nof, name, data, opts).
Creates a new TransparentFile from a single binary or a list of section binaries.
Returns the byte size of section section_index (0-based), or 0 if out of range.
Concatenates all sections into a single binary.
Types
@type t() :: %IEC60870.FileService.TransparentFile{ ca: non_neg_integer(), created_at: IEC60870.Types.CPTime.CP56Time2a.t(), data: binary() | nil, ioa: non_neg_integer(), name: String.t() | nil, nof: non_neg_integer(), on_complete: (boolean() -> any()) | nil, sections: [binary()], sof: non_neg_integer() }
Functions
@spec file_size(t()) :: non_neg_integer()
@spec get_segment_data(t(), non_neg_integer(), non_neg_integer(), non_neg_integer()) :: {:ok, binary()} | :error
Extracts a segment binary from section_index (0-based) starting at offset with size.
@spec new(non_neg_integer(), binary()) :: t()
Creates a new TransparentFile with (nof, data).
Creates a new TransparentFile with (nof, name, data) or (nof, data, opts).
@spec new(non_neg_integer(), String.t(), binary(), keyword()) :: t()
Creates a new TransparentFile with (nof, name, data, opts).
@spec new( non_neg_integer(), non_neg_integer(), non_neg_integer(), binary() | [binary()], keyword() ) :: t()
Creates a new TransparentFile from a single binary or a list of section binaries.
@spec section_size(t(), non_neg_integer()) :: non_neg_integer()
Returns the byte size of section section_index (0-based), or 0 if out of range.
Concatenates all sections into a single binary.