fix server app doesn't work with BAC_ROUTING (#783)
This commit is contained in:
+20
-4
@@ -802,8 +802,12 @@ if(BACNET_STACK_BUILD_APPS)
|
|||||||
add_executable(error apps/error/main.c)
|
add_executable(error apps/error/main.c)
|
||||||
target_link_libraries(error PRIVATE ${PROJECT_NAME})
|
target_link_libraries(error PRIVATE ${PROJECT_NAME})
|
||||||
|
|
||||||
# add_executable(gateway apps/gateway/main.c apps/gateway/gateway.h)
|
add_executable(gateway apps/gateway/main.c apps/gateway/gateway.h)
|
||||||
# target_link_libraries(gateway PRIVATE ${PROJECT_NAME})
|
target_link_libraries(gateway PRIVATE ${PROJECT_NAME})
|
||||||
|
target_compile_options(gateway PRIVATE
|
||||||
|
# Unreachable code because we have endless loop.
|
||||||
|
$<$<C_COMPILER_ID:MSVC>:/wd4702>
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(getevent apps/getevent/main.c)
|
add_executable(getevent apps/getevent/main.c)
|
||||||
target_link_libraries(getevent PRIVATE ${PROJECT_NAME})
|
target_link_libraries(getevent PRIVATE ${PROJECT_NAME})
|
||||||
@@ -933,8 +937,20 @@ if(BACNET_STACK_BUILD_APPS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BACDL_BIP AND BACDL_BIP6)
|
if(BACDL_BIP AND BACDL_BIP6)
|
||||||
add_executable(router-ipv6 apps/router-ipv6/main.c)
|
add_executable(
|
||||||
target_link_libraries(router-ipv6 PRIVATE ${PROJECT_NAME})
|
router-ipv6
|
||||||
|
apps/router-ipv6/router-ipv6.h
|
||||||
|
apps/router-ipv6/main.c)
|
||||||
|
target_link_libraries(
|
||||||
|
router-ipv6
|
||||||
|
PRIVATE ${PROJECT_NAME})
|
||||||
|
target_compile_options(router-ipv6 PRIVATE
|
||||||
|
# These make this example not totally C90 compatible but it is ok.
|
||||||
|
|
||||||
|
-Wno-declaration-after-statement
|
||||||
|
-Wno-overlength-strings
|
||||||
|
-Wno-variadic-macros
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(scov apps/scov/main.c)
|
add_executable(scov apps/scov/main.c)
|
||||||
|
|||||||
@@ -627,6 +627,10 @@ static BACNET_REINITIALIZED_STATE Reinitialize_State = BACNET_REINIT_IDLE;
|
|||||||
static const char *Reinit_Password = "filister";
|
static const char *Reinit_Password = "filister";
|
||||||
static write_property_function Device_Write_Property_Store_Callback;
|
static write_property_function Device_Write_Property_Store_Callback;
|
||||||
|
|
||||||
|
#ifdef BAC_ROUTING
|
||||||
|
static bool Device_Router_Mode = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the ReinitializeDevice password
|
* @brief Sets the ReinitializeDevice password
|
||||||
*
|
*
|
||||||
@@ -750,7 +754,11 @@ uint32_t Device_Index_To_Instance(unsigned index)
|
|||||||
uint32_t Device_Object_Instance_Number(void)
|
uint32_t Device_Object_Instance_Number(void)
|
||||||
{
|
{
|
||||||
#ifdef BAC_ROUTING
|
#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
|
#else
|
||||||
return Object_Instance_Number;
|
return Object_Instance_Number;
|
||||||
#endif
|
#endif
|
||||||
@@ -2445,6 +2453,7 @@ void Device_Timer(uint16_t milliseconds)
|
|||||||
void Routing_Device_Init(uint32_t first_object_instance)
|
void Routing_Device_Init(uint32_t first_object_instance)
|
||||||
{
|
{
|
||||||
struct object_functions *pDevObject = NULL;
|
struct object_functions *pDevObject = NULL;
|
||||||
|
Device_Router_Mode = true;
|
||||||
|
|
||||||
/* Initialize with our preset strings */
|
/* Initialize with our preset strings */
|
||||||
Add_Routed_Device(first_object_instance, &My_Object_Name, Description);
|
Add_Routed_Device(first_object_instance, &My_Object_Name, Description);
|
||||||
|
|||||||
Reference in New Issue
Block a user