Skip to content
Version 6.1.0
Contact Us

BACnetStack_Reset

void BACnetStack_Reset();

Tears the whole stack down and returns it to its factory-default state.

This is the counterpart to the implicit start-up, not a partial reset - it clears ALL of the following:

  • every registered device, object and property;
  • every callback and hook held in the callback table - all must be registered again. EXCEPTION: the debug-message callback (BACnetStack_RegisterCallbackLogDebugMessage()) is stored separately and SURVIVES Reset;
  • all BACnetStackSetting values, back to the defaults documented on the BACnetStackSetting enum;
  • all BACnet/SC configuration (UUID, VMAC, hub connector, direct connect, certificate bindings);
  • the network and datalink layers, and the pending outbound Write-BDT client list;
  • all outstanding sent-confirmed-request state. In-flight invoke-ids are abandoned and no HookTimeout will fire for them.

What Reset does NOT clear, despite the name:

After this call the stack will neither send nor receive until the host re-registers at least CallbackSendMessageForPort and CallbackReceiveMessageForPort and re-adds its device and objects. This is not a complete return to first-run state - see the exceptions above.

Do NOT call this from inside a callback or hook - see the re-entrancy rule under “Callbacks” in the API conventions (in the manual: docs/manual/api-reference/conventions/).

Topic: Main loop and reset. Declared in CASBACnetStackDLL.h.