Skip to content
Version 6.1.0
Contact Us

BACnetStack_SendAtomicReadFile

bool BACnetStack_SendAtomicReadFile(
uint8_t * sentInvokeId,
const uint32_t fileInstance,
const uint8_t fileAccessMethod,
const int32_t fileStart,
const uint32_t requestedCount,
const uint8_t * connectionString,
const uint8_t connectionStringLength,
const uint32_t networkPortInstance,
const uint16_t destinationNetwork,
const uint8_t * destinationAddress,
const uint8_t destinationAddressLength);

Sends a confirmed AtomicReadFile request to read a range of data from a remote File object.

See also: Client response hooks

BACnet reference: ANSI/ASHRAE 135-2024 clause 14.1 (AtomicReadFile Service).

Parameter Direction Description
sentInvokeId out The invoke-id of the sent request, valid only if this function returns true.
fileInstance in The instance of the remote File object to read.
fileAccessMethod in The access-method CHOICE tag of the AtomicReadFile service request: 0 = Stream Access, 1 = Record Access (ASHRAE 135-2024 cl. 21, AtomicReadFile-Request: “access-method CHOICE { stream-access [0] …, record-access [1] … }”). GOTCHA: these values are the INVERSE of the BACnetFileAccessMethod ENUMERATED used by the File object’s File_Access_Method PROPERTY, which is { record-access (0), stream-access (1) }. Two different enumerations, same concept, opposite numbering - both are correct per spec. This parameter is the SERVICE tag, not the property value.
fileStart in The starting octet (Stream Access) or record (Record Access) to read from. Signed per cl. 21.2.2 (fileStart-position/fileStart-record are both INTEGER), matching BACnetStack_SendAtomicWriteFile()’s fileStart parameter.
requestedCount in The number of octets (Stream Access) or records (Record Access) requested.
connectionString, connectionStringLength in The datalink address to send TO (the destination) - not the local address to send from. For IPv4 this is 6 bytes: 4 octets of IPv4 address followed by 2 octets of port, big-endian (e.g. 0xC0,0xA8,0x01,0x05,0xBA,0xC0 = 192.168.1.5:47808; see BACnetStack_SendRegisterForeignDevice() for a worked example); on BACnet/IPv4 the stack refuses to send to a connection string of any other length, except that a broadcast from a device registered as a foreign device goes to its BBMD and does not use the connection string. MS/TP and BACnet/SC use a different connection-string shape; see their respective Set/Send exports.
networkPortInstance in The Network Port object instance to send the message on, or BACNET_NETWORK_PORT_DEFAULT (4194303) for the default/single port.
destinationNetwork, destinationAddress, destinationAddressLength in The destination to send the request to.

True if the request was sent, otherwise false.

Topic: Client requests. Declared in CASBACnetStackDLL.h.