Skip to content
Version 6.1.0
Contact Us

BACnetStack_GetBDTEntry

uint32_t BACnetStack_GetBDTEntry(
const uint32_t networkPortInstance,
const uint16_t index,
uint8_t * ipAddress,
const uint8_t ipAddressLength,
uint8_t * subnetMask,
const uint8_t subnetMaskLength);

Reads one entry of THIS device’s own broadcast distribution table by index.

It does not read a peer’s table - use BACnetStack_SendReadBroadcastDistributionTable() for that.

There is NO export that reports the table’s size, so the only way to enumerate is to read from index 0 until this returns false - and that terminating probe LOGS AN ERROR (“Invalid index, index is out of range”) through the debug-message callback on every pass. Indices are positions that SHIFT after any BACnetStack_DeleteBDTEntry(), so re-enumerate from 0 after a delete rather than continuing an in-flight loop.

BACnet reference: ANSI/ASHRAE 135-2024 Annex J: J.4.3.2 (Broadcast Distribution Table format).

Parameter Direction Description
networkPortInstance in The IPv4 Network Port object instance whose broadcast distribution table is being read.
index in The zero-based table position to read. Out of range returns false and logs.
ipAddress out Receives 6 bytes: the 4-octet IPv4 address followed by the 2-octet UDP port in BIG-endian order. Must not be NULL.
ipAddressLength in EXACT, not a maximum. Must be exactly 6; any other value returns false.
subnetMask out Receives 4 bytes. Must not be NULL.
subnetMaskLength in EXACT, not a maximum. Must be exactly 4; any other value returns false.

The number of bytes written to ipAddress (always ipAddressLength, i.e. 6, on success) if an entry exists at the index and was copied out - subnetMask is fully written too. 0 if the index is out of range, either pointer is NULL, either length is wrong, networkPortInstance does not match any claimed IPv4 Network Port, or BBMD support was not compiled.

Topic: BACnet/IP: BBMD and foreign devices. Declared in CASBACnetStackDLL.h.