fix server app doesn't work with BAC_ROUTING (#783)

This commit is contained in:
Patrick Grimm
2024-10-04 20:47:52 +02:00
committed by GitHub
parent 90dcd9dca1
commit 712dda8bbe
2 changed files with 30 additions and 5 deletions
+10 -1
View File
@@ -627,6 +627,10 @@ static BACNET_REINITIALIZED_STATE Reinitialize_State = BACNET_REINIT_IDLE;
static const char *Reinit_Password = "filister";
static write_property_function Device_Write_Property_Store_Callback;
#ifdef BAC_ROUTING
static bool Device_Router_Mode = false;
#endif
/**
* @brief Sets the ReinitializeDevice password
*
@@ -750,7 +754,11 @@ uint32_t Device_Index_To_Instance(unsigned index)
uint32_t Device_Object_Instance_Number(void)
{
#ifdef BAC_ROUTING
return Routed_Device_Object_Instance_Number();
if (Device_Router_Mode) {
return Routed_Device_Object_Instance_Number();
} else {
return Object_Instance_Number;
}
#else
return Object_Instance_Number;
#endif
@@ -2445,6 +2453,7 @@ void Device_Timer(uint16_t milliseconds)
void Routing_Device_Init(uint32_t first_object_instance)
{
struct object_functions *pDevObject = NULL;
Device_Router_Mode = true;
/* Initialize with our preset strings */
Add_Routed_Device(first_object_instance, &My_Object_Name, Description);