From e99cf2d714891ece0db3e6dfd2ea0ae20e8019be Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Thu, 24 Aug 2017 19:55:46 +0200 Subject: [PATCH] [r3150] address_cache file was inadvertently disabled for command line demo tools. Fixed. Thank you, Martin Tremblay! Syncing with 0.8.x branch. --- src/address.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/address.c b/src/address.c index 4685afe..f895cfd 100644 --- a/src/address.c +++ b/src/address.c @@ -43,6 +43,13 @@ #include "bacdcode.h" #include "readrange.h" +/* we are likely compiling the demo command line tools if print enabled */ +#if !defined(BACNET_ADDRESS_CACHE_FILE) +#if PRINT_ENABLED +#define BACNET_ADDRESS_CACHE_FILE +#endif +#endif + /** @file address.c Handle address binding */ /* This module is used to handle the address binding that */ @@ -291,6 +298,7 @@ bool address_mac_from_ascii( return status; } +#ifdef BACNET_ADDRESS_CACHE_FILE /* File format: DeviceID MAC SNET SADR MAX-APDU 4194303 05 0 0 50 @@ -351,7 +359,7 @@ static void address_file_init( return; } - +#endif /**************************************************************************** * Clear down the cache and make sure the full complement of entries are * @@ -370,8 +378,9 @@ void address_init( pMatch->Flags = 0; pMatch++; } +#ifdef BACNET_ADDRESS_CACHE_FILE address_file_init(Address_Cache_Filename); - +#endif return; } @@ -402,7 +411,9 @@ void address_init_partial( pMatch++; } + #ifdef BACNET_ADDRESS_CACHE_FILE address_file_init(Address_Cache_Filename); +#endif return; }