BACnetStack_AddBDTEntry
bool BACnetStack_AddBDTEntry( const uint32_t networkPortInstance, const uint8_t * ipAddress, const uint8_t ipAddressLength, const uint8_t * subnetMask, const uint8_t subnetMaskLength);Adds - or REPLACES - an entry in this device’s broadcast distribution table.
The lengths must be exactly 6 (address) and 4 (mask): any other length is refused and this function returns false without adding anything, the same check BACnetStack_GetBDTEntry() makes.
The table is a set, not a list: adding an entry whose address AND mask both match an existing entry overwrites it in place rather than appending a duplicate.
ORDERING: BACnetStack_SetBBMD() looks up THIS device’s own address in this table and fails if it is absent. Add the device’s own entry with this function FIRST, then call BACnetStack_SetBBMD(). That lookup matches on address only, not address plus mask.
BACnet reference: ANSI/ASHRAE 135-2024 Annex J: J.4.3.2 (Broadcast Distribution Table format).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
networkPortInstance |
in | The IPv4 Network Port object instance whose broadcast distribution table is being added to. |
ipAddress |
in | 6 bytes: the 4-octet IPv4 address followed by the 2-octet UDP port in BIG-endian order. NULL is rejected. |
ipAddressLength |
in | Exactly 6; any other length is refused. |
subnetMask |
in | 4 bytes. NULL is rejected. |
subnetMaskLength |
in | Exactly 4; any other length is refused. |
Returns
Section titled “Returns”True if an entry was added or replaced. False if 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.