BACnetStack_GetFDTEntry
uint32_t BACnetStack_GetFDTEntry( const uint32_t networkPortInstance, const uint16_t index, uint8_t * ipAddress, const uint8_t ipAddressLength, uint16_t * timeToLive, uint16_t * timeRemaining);Reads one entry of THIS device’s own foreign device table by index.
As with BACnetStack_GetBDTEntry() there is NO count export, so enumeration means reading from index 0 until this returns false, and that terminating probe LOGS AN ERROR. Indices SHIFT after any BACnetStack_DeleteFDTEntry() and after the BBMD purges an expired registration, so a read-then-delete loop skips entries unless it re-enumerates from 0 after every delete.
BACnet reference: ANSI/ASHRAE 135-2024 Annex J: J.5.2.1 (Foreign Device Table).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
networkPortInstance |
in | The IPv4 Network Port object instance whose foreign device 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. |
timeToLive |
out | Receives the time-to-live, in seconds, the foreign device registered with. Must not be NULL. |
timeRemaining |
out | Receives the time left, in seconds, before this entry expires. Must not be NULL. |
Returns
Section titled “Returns”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 - timeToLive and timeRemaining are fully written too. 0 if the index is out of range, any pointer is NULL, ipAddressLength is not 6, 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.