BACnetStack_ActivateNetworkPortPendingChanges
bool BACnetStack_ActivateNetworkPortPendingChanges( const uint32_t deviceInstance, const uint32_t networkPortInstance);Activates the pending changes of one Network Port object, or of every Network Port object of a device.
Activates the pending changes of one Network Port object, or of every Network Port object of a device, the way a received ReinitializeDevice ACTIVATE_CHANGES does - for the host itself, typically once its start-up configuration is done.
Several configuration calls stage their values as PENDING rather than applying them, so that a set of changes takes effect together (135-2024 cl. 12.56.15, Changes_Pending): BACnetStack_SetBACnetSCCertificateFileObjects(), for one, leaves the BACnet/SC port’s Changes_Pending TRUE, and a client’s WriteProperty of Network_Number does the same on any port type. Without this call the only way to activate them is a ReinitializeDevice from a BACnet client, so a device configured at start-up boots reporting Changes_Pending TRUE, and Current_Health describing the empty ACTIVE configuration, for changes nobody made over the network. Call this after the start-up configuration to make it active.
It runs the SAME admissibility check and activation path as ReinitializeDevice ACTIVATE_CHANGES: every selected pending value is checked first and nothing changes unless all of them are admissible; then the pending Network_Number and the other pending values the host serves are handed to the host through CallbackSetPropertyUnsignedInteger and the related Set callbacks (all or nothing - a value the host refuses hands back every value it accepted in the pass, and nothing is activated), and then the BACnet/SC ports’ pending certificate File bindings and settings become active. A BACnet/SC port whose operational certificate or issuer certificate File binding changed is restarted onto it.
Unlike ReinitializeDevice it does NOT call CallbackReinitializeDevice, so no password is checked: the caller is the local host, not a BACnet client. A ReinitializeDevice from the network still goes through the host’s password check. Nothing is sent on the network, and DeviceCommunicationControl is not changed.
Call it from the thread that calls BACnetStack_Tick(), as for every other configuration call, and not from inside a stack callback (for example CallbackSetPropertyUnsignedInteger during an activation): the stack is then part-way through a pass whose pending values are not yet cleared, so a nested call would check and hand them to the host a second time.
BACnet reference: ANSI/ASHRAE 135-2024 clause 12.56 (Network Port Object Type); clause 16.4 (ReinitializeDevice Service).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The instance of the device that owns the Network Port object(s). Must be a device added with BACnetStack_AddDevice(). |
networkPortInstance |
in | The instance of the Network Port object (BACnetStack_AddNetworkPortObject()) whose pending changes to activate, or 4194303 - the reserved “unknown instance” value, which no Network Port object can have - to activate the pending changes of every Network Port object of the device. With one port named, the pending changes of the other ports stay pending. Do not pass BACNET_NETWORK_PORT_DEFAULT here to mean “the default port”: it has the same value, and in this export 4194303 means every port. |
Returns
Section titled “Returns”True if every selected pending change the activation pass can take is now active, including when none was pending. One value can stay pending on a true return, as after a ReinitializeDevice: a pending BBMD_Accept_FD_Registrations whose port has no BACnet/IP data link, or in a build without BBMD support, is kept pending and that port’s Changes_Pending stays TRUE. False, with nothing activated, if:
- deviceInstance is not a device of this stack;
- networkPortInstance is neither 4194303 nor a Network Port object of that device;
- the stack was built without Network Port objects (STACK_OPTION_OBJECT_TYPE_NETWORK_PORT);
- a pending value is not admissible - the checks ReinitializeDevice answers with PROPERTY / INVALID_CONFIGURATION_DATA: for example a pending Network_Number a router port or virtual network cannot move to, or a pending value whose Set callback (CallbackSetPropertyUnsignedInteger, or the FD_BBMD_Address callbacks) is not registered; or
- the host’s Set callback refused a pending value at activation. Every pending value then stays pending and Changes_Pending stays TRUE. The one exception is shared with ReinitializeDevice: the BACnet/SC pass runs after the Network_Number pass and has no admissibility check to fail, so it fails only if the stack cannot build a BACnet/SC port’s SC_Current_Health (an internal failure no argument or pending value can cause); the values activated before that stay active.
Topic: Objects and properties. Declared in CASBACnetStackDLL.h.