Currently, gw_device.c only implements a few per-virtual-device specific properties through device.h DEVICE_OBJECT_DATA storage it relies on:
- object type (through inner COMMON_BAC_OBJECT)
- instance number (through inner COMMON_BAC_OBJECT)
- name (through inner COMMON_BAC_OBJECT)
- description
- database revision
- bacnet address
- optionally reinitialize and backup data
I was thinking about adding at least a few per-virtual-device specific properties for my need (location, model name, app sw version, maybe vendor id and name, as well as serial number)
Looking at current device and gw_device implementation I am seeing that device.c do not use a static DEVICE_OBJECT_DATA member for its instance but uses a set of per-property static members.
In the idea to add those few properties at least for my need, I am interested to know the wanted architecture direction about device.c and device.h since I can implement it in several ways and maybe one of them is much preferred upstream. Below are my ideas in mind. They are not ordered, numbers are only added to properly identify option in the discussion
-
Keep current spirit, that is add N members to DEVICE_OBJECT_DATA and N Routed_Device_... getter/setter functions, without touching device.c at all
-
Add a DEVICE_OBJECT_DATA static member to device.c, remove other redundant static members (name, description, etc), then move location, etc static members to this struct for them to become per-virtual-device
2.1 Do not create Routed_Device_Location, Routed_Device_Set_Location, etc but transform Device_Location and Device_Set_Location to conditionally use Device_Routed_Data (BAC_ROUTING condition), mimicing Device_Last_Restore_Time_Value for example, or likely creating a Device_Data() getter to peek proper DEVICE_OBJECT_DATA pointer (which conditionally call Device_Routed_Data or return static instance)
2.1.1 Keep gw_device Routed_Device_Set_Description and other existing getter/setter which became redundant with Device_Set_Description and other
2.1.2 Mark as deprecated gw_device Routed_Device_Set_Description and other existing getter/setter which became redundant with Device_Set_Description and other (using doxygen tag)
2.1.3 Remove gw_device Routed_Device_Set_Description and other existing getter/setter which became redundant with Device_Set_Description and other
2.2 Keep Device_Location and Device_Set_Location as is, create Routed_Device_Location and Routed_Device_Set_Location, and the like
Reactions are currently unavailable
Currently, gw_device.c only implements a few per-virtual-device specific properties through device.h DEVICE_OBJECT_DATA storage it relies on:
I was thinking about adding at least a few per-virtual-device specific properties for my need (location, model name, app sw version, maybe vendor id and name, as well as serial number)
Looking at current device and gw_device implementation I am seeing that device.c do not use a static DEVICE_OBJECT_DATA member for its instance but uses a set of per-property static members.
In the idea to add those few properties at least for my need, I am interested to know the wanted architecture direction about device.c and device.h since I can implement it in several ways and maybe one of them is much preferred upstream. Below are my ideas in mind. They are not ordered, numbers are only added to properly identify option in the discussion
Keep current spirit, that is add N members to DEVICE_OBJECT_DATA and N Routed_Device_... getter/setter functions, without touching device.c at all
Add a DEVICE_OBJECT_DATA static member to device.c, remove other redundant static members (name, description, etc), then move location, etc static members to this struct for them to become per-virtual-device
2.1 Do not create Routed_Device_Location, Routed_Device_Set_Location, etc but transform Device_Location and Device_Set_Location to conditionally use Device_Routed_Data (BAC_ROUTING condition), mimicing Device_Last_Restore_Time_Value for example, or likely creating a Device_Data() getter to peek proper DEVICE_OBJECT_DATA pointer (which conditionally call Device_Routed_Data or return static instance)
2.1.1 Keep gw_device Routed_Device_Set_Description and other existing getter/setter which became redundant with Device_Set_Description and other
2.1.2 Mark as deprecated gw_device Routed_Device_Set_Description and other existing getter/setter which became redundant with Device_Set_Description and other (using doxygen tag)
2.1.3 Remove gw_device Routed_Device_Set_Description and other existing getter/setter which became redundant with Device_Set_Description and other
2.2 Keep Device_Location and Device_Set_Location as is, create Routed_Device_Location and Routed_Device_Set_Location, and the like