Skip to content
Version 6.1.0
Contact Us

BACnetStack_RegisterCallbackPrepareBackup

void BACnetStack_RegisterCallbackPrepareBackup(
bool (*FPCallbackPrepareBackup)(const uint32_t deviceInstance));

Registers the callback the stack calls to create the backup files a BACnet client will then read, on a ReinitializeDevice with reinitializedStateOfDevice = startBackup.

Called from inside Tick().

THE CLIENT HAS ALREADY BEEN ACKNOWLEDGED. The stack sends the ReinitializeDevice SimpleAck BEFORE calling this. There is no errorCode out-parameter and no error can reach the client: returning false only moves the device into the backupFailure state and logs. The client learns of the failure by reading System_Status / Backup_And_Restore_State.

ALL FIVE CALLBACKS ARE REQUIRED TOGETHER. startBackup and startRestore are both refused with an Error (SERVICES, OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED), the Result(-) that 135-2024 cl. 19.1.2.2 and 19.1.3.2 give a device unable to perform the procedure, unless CallbackGetSystemTime, CallbackPrepareBackup, CallbackCompleteBackup, CallbackPrepareRestore AND CallbackCompleteRestore are all registered - registering only the backup pair does not enable backup.

Registering has no effect if backup and restore was not compiled (STACK_OPTION_DM_BR_BACKUP_AND_RESTORE).

See also: CASBACnetStack::FPCallbackPrepareBackup

BACnet reference: ANSI/ASHRAE 135-2024 clause 19.1 (Backup and Restore).

Parameter Direction Description
FPCallbackPrepareBackup in The function pointer for the CallbackPrepareBackup function. See CASBACnetStack::FPCallbackPrepareBackup for more info.

FPCallbackPrepareBackup

Topic: Service callbacks. Declared in CASBACnetStackDLL.h.