BACnetStack_SetCOVSettings
bool BACnetStack_SetCOVSettings( const uint32_t deviceInstance, const uint32_t maxNumberOfSubscriptions, const uint32_t maxSupportedCOVLifetime);Sets the COV subscription-table capacity and the maximum supported COV lifetime for subscriptions received by this device.
maxNumberOfSubscriptions is applied as BACnetStack_SetMaxActiveCOVSubscriptions() applies it: to the SubscribeCOV / SubscribeCOVProperty table AND, in a build with SubscribeCOVPropertyMultiple, to the SubscribeCOVPropertyMultiple table. Call BACnetStack_SetCOVMultipleSettings() AFTER this function to give the SubscribeCOVPropertyMultiple table a different capacity.
The lifetime is a single device-wide bound shared by SubscribeCOV, SubscribeCOVProperty and SubscribeCOVPropertyMultiple.
ENFORCEMENT IS REJECT, NOT CLAMP. A subscription request asking for a lifetime longer than maxSupportedCOVLifetime is answered with Error(services, valueOutOfRange); it is not silently shortened to the maximum.
THE DEVICE DEFAULT IS 28800 SECONDS (8 hours) - MAX_SUPPORTED_COV_LIFETIME in BACnetStackConstants.h, the minimum the BACnet spec requires a device to support. Every device starts at that value, so it is what the stack enforced before this setter was called.
PASS 0 FOR “USE THE DEVICE DEFAULT”. 0 is accepted as a sentinel and substitutes 28800, so a caller does not need to know the number. Passing 28800 explicitly is identical.
maxNumberOfSubscriptions = 0 means NO LIMIT.
THIS FUNCTION IS NOT ATOMIC. It applies maxNumberOfSubscriptions first, then maxSupportedCOVLifetime; if the second application fails, the first has ALREADY taken effect and this still returns false - the caller cannot tell a total failure from a half-applied one. The two settings are independent, so prefer the single-purpose BACnetStack_SetMaxActiveCOVSubscriptions() and BACnetStack_SetMaxSupportedCOVLifetime() below, each of which is unambiguous about what it changed. This function is kept for compatibility with its existing partial-application behaviour.
BACnet reference: ANSI/ASHRAE 135-2024 clause 13.1 (Change of Value Reporting).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The instance of the device to set the maximum supported COV lifetime. |
maxNumberOfSubscriptions |
in | The maximum number of active COV subscriptions to support. If set to zero, no limit. |
maxSupportedCOVLifetime |
in | The maximum supported COV lifetime in seconds. Valid range is 0 .. MAX_UINT32 - 1; exactly MAX_UINT32 is rejected. Pass 28800 for the device default. See the note above before passing 0. |
Returns
Section titled “Returns”True if successful, false if failed.
Topic: Device and services. Declared in CASBACnetStackDLL.h.