diff --git a/bacnet-stack/demo/gateway/main.c b/bacnet-stack/demo/gateway/main.c index 8e97c566..8be99ebf 100644 --- a/bacnet-stack/demo/gateway/main.c +++ b/bacnet-stack/demo/gateway/main.c @@ -328,7 +328,7 @@ int main( dlenv_maintenance_timer(elapsed_seconds); Load_Control_State_Machine_Handler(); elapsed_milliseconds = elapsed_seconds * 1000; - handler_cov_task(elapsed_seconds); + handler_cov_task(); tsm_timer_milliseconds(elapsed_milliseconds); } /* output */ diff --git a/bacnet-stack/demo/handler/h_routed_npdu.c b/bacnet-stack/demo/handler/h_routed_npdu.c index a805764c..1f298a74 100644 --- a/bacnet-stack/demo/handler/h_routed_npdu.c +++ b/bacnet-stack/demo/handler/h_routed_npdu.c @@ -43,6 +43,10 @@ #if PRINT_ENABLED #include #endif +#if defined(BACDL_BIP) +#include "bvlc.h" +#endif + /** @file h_routed_npdu.c Handles messages at the NPDU level of the BACnet stack, * including routing and network control messages. */ diff --git a/bacnet-stack/src/bip.c b/bacnet-stack/src/bip.c index dec51e8f..71e468c3 100644 --- a/bacnet-stack/src/bip.c +++ b/bacnet-stack/src/bip.c @@ -170,6 +170,7 @@ int bip_send_pdu( /* addr and port in host format */ struct in_addr address; uint16_t port = 0; + BACNET_BVLC_FUNCTION function; (void) npdu_data; @@ -179,7 +180,10 @@ int bip_send_pdu( mtu[0] = BVLL_TYPE_BACNET_IP; bip_dest.sin_family = AF_INET; - if (dest->net == BACNET_BROADCAST_NETWORK) { + function = bvlc_get_function_code(); /* What type of BVLC was it? */ + if ( (dest->net == BACNET_BROADCAST_NETWORK) || + (function == BVLC_FORWARDED_NPDU) || + (function == BVLC_ORIGINAL_BROADCAST_NPDU) ) { /* broadcast */ address.s_addr = BIP_Broadcast_Address.s_addr; port = BIP_Port;