diff --git a/src/bacnet/basic/object/device.c b/src/bacnet/basic/object/device.c index 7920c8de..17ea30e3 100644 --- a/src/bacnet/basic/object/device.c +++ b/src/bacnet/basic/object/device.c @@ -84,6 +84,31 @@ Routed_Device_Write_Property_Local(BACNET_WRITE_PROPERTY_DATA *wp_data); /* may be overridden by outside table */ static object_functions_t *Object_Table; +#if defined(BACNET_GATEWAY_EXTERNAL_OBJECT_TABLE) +static object_functions_t My_Object_Table[] = { + { MAX_BACNET_OBJECT_TYPE, + NULL /* Init */, + NULL /* Count */, + NULL /* Index_To_Instance */, + NULL /* Valid_Instance */, + NULL /* Object_Name */, + NULL /* Read_Property */, + NULL /* Write_Property */, + NULL /* Property_Lists */, + NULL /* ReadRangeInfo */, + NULL /* Iterator */, + NULL /* Value_Lists */, + NULL /* COV */, + NULL /* COV Clear */, + NULL /* Intrinsic Reporting */, + NULL /* Add_List_Element */, + NULL /* Remove_List_Element */, + NULL /* Create */, + NULL /* Delete */, + NULL /* Timer */, + NULL /* Writable_Property_List */ } +}; +#else static object_functions_t My_Object_Table[] = { { OBJECT_DEVICE, NULL /* Init - don't init Device or it will recourse! */, @@ -1047,6 +1072,7 @@ static object_functions_t My_Object_Table[] = { NULL /* Timer */, NULL /* Writable_Property_List */ } }; +#endif /* Proprietary property callback functions to enable proprietary properties while reusing the basic objects as-is. */ @@ -4272,14 +4298,16 @@ void Device_Init(object_functions_t *object_table) } pObject++; } -#if (BACNET_PROTOCOL_REVISION >= 14) +#if (BACNET_PROTOCOL_REVISION >= 14) && !defined(BACNET_GATEWAY_EXTERNAL_OBJECT_TABLE) /* link WriteProperty to Channel object for members */ Channel_Write_Property_Internal_Callback_Set(Device_Write_Property); #endif +#if !defined(BACNET_GATEWAY_EXTERNAL_OBJECT_TABLE) /* link ReadProperty and WriteProperty to Loop object for references */ Loop_Read_Property_Internal_Callback_Set(Device_Read_Property); Loop_Write_Property_Internal_Callback_Set(Device_Write_Property); -#if (BACNET_PROTOCOL_REVISION >= 17) +#endif +#if (BACNET_PROTOCOL_REVISION >= 17) && !defined(BACNET_GATEWAY_EXTERNAL_OBJECT_TABLE) /* link WriteProperty to Timer object for references */ Timer_Write_Property_Internal_Callback_Set(Device_Write_Property); #endif