BACnet.Protocol.Services.Ack.AtomicReadFileAck (bacstack v0.1.0-dev.1)

Copy Markdown View Source

The Atomic Read File Acknowledgment is the response to a successful Atomic Read File service request.

It can return either stream-based data (a contiguous block of octets from a file starting at a given position) or record-based data (a sequence of individual records). The stream_access flag and the presence of record_count distinguish between the two access methods.

The acknowledgment also indicates whether the end of the file has been reached (eof). This service is the basic building block for reading files stored in BACnet File objects.

Summary

Types

t()

The response to an Atomic Read File request, containing the read data and end-of-file flag.

Types

t()

@type t() :: %BACnet.Protocol.Services.Ack.AtomicReadFileAck{
  data: (stream_based :: binary()) | (record_based :: [binary()]),
  eof: boolean(),
  record_count: non_neg_integer() | nil,
  start_position: integer(),
  stream_access: boolean()
}

The response to an Atomic Read File request, containing the read data and end-of-file flag.

If stream_access is nil, then record access is used and record_count is not nil.

Functions

from_apdu(ack)

@spec from_apdu(BACnet.Protocol.APDU.ComplexACK.t()) :: {:ok, t()} | {:error, term()}

Converts a received BACnet.Protocol.APDU.ComplexACK APDU into a struct.

to_apdu(ack, invoke_id \\ 0)

@spec to_apdu(t(), 0..255) ::
  {:ok, BACnet.Protocol.APDU.ComplexACK.t()} | {:error, term()}

Constructs a BACnet.Protocol.APDU.ComplexACK APDU from a BACnet.Protocol.Services.Ack.AtomicReadFileAck struct.

Used by a server when responding to an Atomic Read File request.