BacnetDeviceBackups extension

Backup and restore of devices (ASHRAE 135 clause 19.1): the content of their configuration files, read and written with ReinitializeDevice START_BACKUP/END_BACKUP and START_RESTORE/END_RESTORE around the file transfers.

final backup = await client.backupDevice(1234, password: 'secret');
// ... replace the controller ...
await client.restoreDevice(1234, backup, password: 'secret');
on

Methods

backupDevice(int deviceId, {String? password, Duration preparationTimeout = const Duration(minutes: 2), BacnetFileProgress? onProgress, Duration? timeout}) → Future<BacnetDeviceBackup>

Available on BacnetClient, provided by the BacnetDeviceBackups extension

Backs up deviceId: starts the backup, waits until the device is ready (Backup_And_Restore_State, at most preparationTimeout), reads the files of Configuration_Files and ends the backup (also when it fails). onProgress reports the files read.
restoreDevice(int deviceId, BacnetDeviceBackup backup, {String? password, Duration preparationTimeout = const Duration(minutes: 2), Duration completionTimeout = const Duration(minutes: 2), BacnetFileProgress? onProgress, Duration? timeout}) → Future<void>

Available on BacnetClient, provided by the BacnetDeviceBackups extension

Restores backup to deviceId: starts the restore, waits until the device is ready, writes the files (and their size where the device allows it) and ends the restore; aborts it when a step fails. Waits up to completionTimeout for the device to apply the files and throws a BacnetException when it reports a restore failure.