Feature/create object initial value backup - #1223
Merged
Merged
Conversation
…and writable properties.
…ct-initial-value-backup
…ed in a backup file.
…ct and server example.
…e correct number of bytes written.
… object data during backup
…estore to bacnet_device.c
…Wireshark PCAP format command line app.
…sary offset calculations.
…Cnet library target
…detected by scanbuild in pipeline.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds initial support for Device Management Backup/Restore by exporting objects as CreateObject service requests with “List of Initial Values”, storing them in a BACfile, and providing a utility to convert the backup stream into a Wireshark PCAP.
Changes:
- Add
create_object_writable_properties_encode()to build aCreateObjectrequest including writable properties read from the local device. - Extend Device object property lists and handlers to include backup/restore-related properties and actions (plus an example BACfile setup in the server app).
- Add BACfile write-at-offset support and introduce the
dmbrcapconversion tool; wire new options/targets into Make/CMake.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bacnet/proplist.c | Doc updates for property list helper parameters. |
| src/bacnet/create_object.h | Exposes new encoder/decoder APIs and writable-properties encoder. |
| src/bacnet/create_object.c | Implements initial-value raw-data encoder and writable-properties CreateObject request encoder. |
| src/bacnet/basic/server/bacnet_device.c | Adds backup/restore Device properties, write handling, and backup/restore actions in server device implementation. |
| src/bacnet/basic/object/device.h | Exposes new Device backup/restore APIs. |
| src/bacnet/basic/object/device.c | Adds backup/restore properties/handlers and backup/restore actions in object device implementation. |
| src/bacnet/basic/object/bacfile.h | Adds bacfile_write_offset() API. |
| src/bacnet/basic/object/bacfile.c | Implements bacfile_write_offset() via existing stream callback. |
| ports/posix/bacfile-posix.c | Fixes fwrite() argument order to write correct byte counts. |
| apps/server/main.c | Creates a BACfile instance and configures it for backup/restore example usage. |
| apps/dmbrcap/main.c | New utility that converts a CreateObject-encoded backup stream into a PCAP. |
| apps/dmbrcap/dmbrcap.txt | Brief tool documentation stub. |
| apps/dmbrcap/Makefile | Build rules for the new dmbrcap app. |
| apps/Makefile | Enables BACNET_BACKUP_RESTORE in app builds and adds dmbrcap to SUBDIRS/targets. |
| Makefile | Adds top-level dmbrcap make target. |
| CMakeLists.txt | Adds BACFILE/BACNET_BACKUP_RESTORE options/defines and builds dmbrcap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.