BACnetStack_GetMSTPCounters
bool BACnetStack_GetMSTPCounters( const uint32_t networkPortInstance, uint32_t * counters, const uint8_t countersLength);Reads the counters of an MS/TP port’s stack-owned engine into an array, one entry per BACnetMSTPCounter value.
Fills the first min(countersLength, BACnetMSTPCounter_Count) entries and leaves the rest alone, so an array sized for an older version of the list still works. The counts are not cleared when byte mode ends, and the cumulative ones add up across restarts of the engine on the same port; BACnetMSTPCounter_InTokenRing and the BACnetMSTPCounter_LastFrame* entries describe the current run. Safe to call from any thread.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
networkPortInstance |
in | The instance of the MS/TP Network Port object (BACnetStack_AddNetworkPortObject()), or BACNET_NETWORK_PORT_DEFAULT for the default port. |
counters |
out | The array to fill. Must hold countersLength entries. |
countersLength |
in | The number of entries in counters. |
Returns
Section titled “Returns”true when the array was filled; false for a NULL array, an unknown port, a port that never had byte callbacks registered (no stack-owned engine), or a build without MS/TP.
Topic: Data link and system callbacks. Declared in CASBACnetStackDLL.h.