Skip to content

Add sentinel value to terminate the SUPPORTED_OBJECT_TABLE #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivanhercaz
Copy link

@ivanhercaz ivanhercaz commented Apr 18, 2025

Because of how the bacnet-stack works, it is recommended to terminate the SUPPORTED_OBJECT_TABLE with a sentinel value that indicates the end.

Steve Karg's usual way is to set the last value of the list to a value completely null with the exception of the type in which is set MAX_BACNET_OBJECT_TYPE. See bacnet-stack device.c as an example of this. There the other values are set to NULL, but the only value required because it is normally the first one to be checked is the type.

This change is to make your BACnet application more robust, because depending of the system and the compilation, it can causes issues, like segmentation faults (@BACnetEd, fix me if I am wrong or something additional to comment).

Note: as it is a small change, we prefer to keep it simple and clean. This commit is done in a branch with the latest of your main branch.

Because of how the bacnet-stack works, it is recommended to terminate the `SUPPORTED_OBJECT_TABLE` with a sentinel value that indicates the end.

Steve Karg's usual way is to set the last value of the list to a value completely null with the exception of the type in which is set `MAX_BACNET_OBJECT_TYPE`.

Co-authored-by: Ed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant