To build the Routing demo define BAC_ROUTING in the top Makefile. The value is not important - the symbol has to be defined.
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
|
||||
# configuration
|
||||
BACNET_DEFINES = -DPRINT_ENABLED=1 -DBACAPP_ALL -DBACFILE
|
||||
# for now 1 and 0 are used to build or not to build the routing demo
|
||||
BACNET_DEFINES += -DBAC_ROUTING=1
|
||||
# un-comment the next line to build the routing demo application
|
||||
#BACNET_DEFINES += -DBAC_ROUTING
|
||||
|
||||
#BACDL_DEFINE=-DBACDL_ETHERNET=1
|
||||
#BACDL_DEFINE=-DBACDL_ARCNET=1
|
||||
|
||||
@@ -36,7 +36,7 @@ LFLAGS = -Wl,$(LIBRARIES)
|
||||
SUBDIRS = readprop writeprop readfile writefile reinit server dcc \
|
||||
whohas whois ucov timesync epics readpropm mstpcap
|
||||
|
||||
ifneq (,$(findstring BAC_ROUTING=1,$(BACNET_DEFINES)))
|
||||
ifneq (,$(findstring -DBAC_ROUTING,$(BACNET_DEFINES)))
|
||||
SUBDIRS += whoisrouter iamrouter initrouter gateway
|
||||
endif
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void handler_who_has(
|
||||
if (len > 0) {
|
||||
if ((data.low_limit == -1) || (data.high_limit == -1))
|
||||
directed_to_me = true;
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
else if ((Routed_Device_Object_Instance_Number() >= (uint32_t) data.low_limit)
|
||||
&& (Routed_Device_Object_Instance_Number() <= (uint32_t) data.high_limit))
|
||||
#else
|
||||
|
||||
@@ -63,7 +63,7 @@ void handler_who_is(
|
||||
Send_I_Am(&Handler_Transmit_Buffer[0]);
|
||||
else if (len != -1) {
|
||||
/* is my device id within the limits? */
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
if (((Routed_Device_Object_Instance_Number() >= (uint32_t) low_limit) &&
|
||||
(Routed_Device_Object_Instance_Number() <= (uint32_t) high_limit))
|
||||
||
|
||||
@@ -107,7 +107,7 @@ void handler_who_is_unicast(
|
||||
Send_I_Am_Unicast(&Handler_Transmit_Buffer[0], src);
|
||||
else if (len != -1) {
|
||||
/* is my device id within the limits? */
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
if (((Routed_Device_Object_Instance_Number() >= (uint32_t) low_limit) &&
|
||||
(Routed_Device_Object_Instance_Number() <= (uint32_t) high_limit))
|
||||
||
|
||||
|
||||
@@ -353,7 +353,7 @@ uint32_t Device_Index_To_Instance(
|
||||
uint32_t Device_Object_Instance_Number(
|
||||
void)
|
||||
{
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
return Routed_Device_Object_Instance_Number();
|
||||
#else
|
||||
return Object_Instance_Number;
|
||||
@@ -1380,7 +1380,7 @@ bool DeviceGetRRInfo(
|
||||
}
|
||||
|
||||
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
/****************************************************************************
|
||||
************* BACnet Routing Functionality (Optional) **********************
|
||||
****************************************************************************
|
||||
|
||||
@@ -78,7 +78,7 @@ bool Routed_Device_Write_Property_Local(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
|
||||
#if !BAC_ROUTING
|
||||
#if !defined(BAC_ROUTING)
|
||||
#warning This file should not be included in the build unless BAC_ROUTING is enabled.
|
||||
#endif
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
/* Enable the Gateway (Routing) functionality here, if desired. */
|
||||
#if !defined(MAX_NUM_DEVICES)
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
#define MAX_NUM_DEVICES 3 /* Eg, Gateway + two remote devices */
|
||||
#else
|
||||
#define MAX_NUM_DEVICES 1 /* Just the one normal BACnet Device Object */
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
#endif
|
||||
#define datalink_cleanup bip_cleanup
|
||||
#define datalink_get_broadcast_address bip_get_broadcast_address
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
#define datalink_get_my_address routed_get_my_address
|
||||
#else
|
||||
#define datalink_get_my_address bip_get_my_address
|
||||
|
||||
@@ -161,7 +161,7 @@ PORT_SRC = ${PORT_ALL_SRC}
|
||||
endif
|
||||
|
||||
|
||||
ifneq (,$(findstring BAC_ROUTING=1,$(BACNET_DEFINES)))
|
||||
ifneq (,$(findstring -DBAC_ROUTING,$(BACNET_DEFINES)))
|
||||
ROUTING_SRC = \
|
||||
$(BACNET_HANDLER)/h_routed_npdu.c \
|
||||
$(BACNET_HANDLER)/s_router.c \
|
||||
|
||||
Reference in New Issue
Block a user