Skip to content
Version 6.1.0
Contact Us

BACnetStack_ReportMSTPReceiveError

bool BACnetStack_ReportMSTPReceiveError(const uint32_t networkPortInstance);

Reports a receive error (a UART framing, overrun or parity error) on an MS/TP port in byte mode.

This is an export, not a callback, because the byte-level callbacks carry no data back to the stack and the host learns of a UART error in its interrupt handler or receive loop, not inside the receive callback. It is safe to call from any thread and from an interrupt handler (it only increments an atomic counter). The engine takes the error at the start of the next BACnetStack_LoopMSTP() call, as the receive error of the first octet the receive callback hands over after the octets the engine already holds: report an error before the receive callback returns the octet it belongs to. Two reports made before that merge into one error (both are counted).

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.

true when the port exists and has a stack-owned engine; false for an unknown port, a port that never had byte callbacks registered, or a build without MS/TP.

Topic: Data link and system callbacks. Declared in CASBACnetStackDLL.h.