Replies: 1 comment 2 replies
-
BACnet includes CreateObject and DeleteObject services - both optional - and having dynamic objects enables those services to be used for those devices that want that feature. However, even for embedded microcontrollers, the ability to create zero, one or more (unlimited) objects according to the needs (object model) of the device simplifies software development and maintenance. It also shifts the RAM usage to HEAP. The basic objects (demo, examples) started as fixed size array of objects to be examples for the apps/server (or in the ports for microcontrollers) to showcase the BACnet objects. In several products I developed, I used the keylist library in the BACnet object code to create dynamic BACnet objects - typically at startup - and I have a collection of those library objects that I had planned to bring into the bacnet/basic/object library. Using dynamically creatable objects that can be used both microcontrollers and large devices makes the software maintenance of the example objects easier as I can slim down the number of duplicate example objects in the library. I'm also in the process of refactoring the device object into the service handlers (bacnet/basic/services/h_device.c) to remove the library dependency on the device.c/device.h files. |
Beta Was this translation helpful? Give feedback.
-
Hey,
I have a question related to the way different objects are generated in the library, or more specifically why it differs.
If you take the analog inputs for example, when the init function is called, we automatically create as many objects as specified by
MAX_ANALOG_INPUTS
, whereas with analog outputs we only create a keylist usingKeylist_Create()
and are then able to create a (seemingly) arbitrary number of objects dynamically.Is this somehow required by the standard or is there any other reason?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions