Skip to content
Version 6.1.0
Contact Us

BACnetStack_SetBACnetStackSetting

bool BACnetStack_SetBACnetStackSetting(
const uint32_t deviceInstance,
const uint32_t setting,
const uint32_t value);

Generic setter for the stack tunables enumerated in BACnetStackSetting.

This one function intentionally covers all of those settings instead of a dedicated Set<Name> export per setting: it keeps the public ABI small and stable (new settings are appended to the enum without adding new exports). It only fits settings whose value is a single uint32_t; a setting that needs a richer argument would need its own dedicated function and would not be part of this enum.

SCOPE. Settings are per device, in two layers:

  • deviceInstance == BACNET_STACK_SETTING_ALL_DEVICES (4194303) writes the PROCESS DEFAULT - the value used by any device that has not set its own, including devices added later.
  • any other deviceInstance must name a device already added with BACnetStack_AddDevice(), and writes an override for that device alone.

An explicit per-device value always wins over the default, whatever it is - a device may deliberately set BACNET_STACK_SETTING_DISABLED to opt out of a cap the default enables. Writing the default never disturbs a device that has set its own value.

ONE-WAY: there is currently no way to REMOVE a per-device value once set, i.e. to return a device to following the process default. Setting it to the same value the default happens to hold is not the same thing - the device keeps its own copy and stops tracking later changes to the default. If you need a device to follow the default, do not give it an explicit value.

Parameter Direction Description
deviceInstance in The device to configure, or BACNET_STACK_SETTING_ALL_DEVICES for the process default. See the migration note on that constant if you are moving from the two-argument form.
setting in One of the BACnetStackSetting identifiers.
value in The new value; the meaning is documented per setting on the enum. Some settings accept BACNET_STACK_SETTING_DISABLED to mean “no limit / disabled”.

True if the setting was applied; false if the setting id is unknown, or if deviceInstance is neither BACNET_STACK_SETTING_ALL_DEVICES nor a device that has been added. No per-setting VALUE range is actually enforced for any of the settings currently defined - none of them have a documented numeric bound to enforce. A future setting that does need one should add its own check and this doc should note it specifically.

Topic: Version, information and settings. Declared in CASBACnetStackDLL.h.