diff --git a/bacnet-stack/config.h b/bacnet-stack/config.h index cc742d75..e42cfb48 100644 --- a/bacnet-stack/config.h +++ b/bacnet-stack/config.h @@ -37,6 +37,7 @@ #define MAX_APDU 480 /* #define MAX_APDU 1476 */ #endif + /* for confirmed messages, this is the number of transactions */ /* that we hold in a queue waiting for timeout. */ /* Configure to zero if you don't want any confirmed messages */ diff --git a/bacnet-stack/demo/dcc/Makefile b/bacnet-stack/demo/dcc/Makefile index e8472f08..424d91c6 100644 --- a/bacnet-stack/demo/dcc/Makefile +++ b/bacnet-stack/demo/dcc/Makefile @@ -7,10 +7,10 @@ BASEDIR = . # Note: you can strip out symbols using the strip command # to get an idea of how big the compile really is. -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=1 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DBACFILE -DPRINT_ENABLED=1 #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 -BACDL_DEFINE=-DBACDL_BIP=1 +BACDL_DEFINE=-DBACDL_BIP DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) BACNET_PORT = ../../ports/linux diff --git a/bacnet-stack/demo/dcc/makefile.b32 b/bacnet-stack/demo/dcc/makefile.b32 index e54e7079..d5742699 100644 --- a/bacnet-stack/demo/dcc/makefile.b32 +++ b/bacnet-stack/demo/dcc/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacdcc PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;USE_INADDR=1;BIP_DEBUG;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;USE_INADDR=1;BIP_DEBUG;PRINT_ENABLED=1 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ diff --git a/bacnet-stack/demo/epics/Makefile b/bacnet-stack/demo/epics/Makefile index 4ba40671..65810edb 100644 --- a/bacnet-stack/demo/epics/Makefile +++ b/bacnet-stack/demo/epics/Makefile @@ -7,7 +7,7 @@ BASEDIR = . # Note: you can strip out symbols using the strip command # to get an idea of how big the compile really is. -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=1 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES= -DPRINT_ENABLED=1 #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 diff --git a/bacnet-stack/demo/epics/makefile.b32 b/bacnet-stack/demo/epics/makefile.b32 index 99e464c8..612f015c 100644 --- a/bacnet-stack/demo/epics/makefile.b32 +++ b/bacnet-stack/demo/epics/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacepics PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;BIG_ENDIAN=0;PRINT_ENABLED=1;BIP_DEBUG=0 +DEFINES = -DBACDL_BIP=1;PRINT_ENABLED=1;BIP_DEBUG=0 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ diff --git a/bacnet-stack/demo/object/bacfile.c b/bacnet-stack/demo/object/bacfile.c index 948dd672..96d793b3 100644 --- a/bacnet-stack/demo/object/bacfile.c +++ b/bacnet-stack/demo/object/bacfile.c @@ -337,7 +337,7 @@ uint32_t bacfile_instance(char *filename) return instance; } -#if TSM_ENABLED +#if MAX_TSM_TRANSACTIONS /* this is one way to match up the invoke ID with */ /* the file ID from the AtomicReadFile request. */ /* Another way would be to store the */ diff --git a/bacnet-stack/demo/readfile/Makefile b/bacnet-stack/demo/readfile/Makefile index 8574eb5b..5542e538 100644 --- a/bacnet-stack/demo/readfile/Makefile +++ b/bacnet-stack/demo/readfile/Makefile @@ -7,7 +7,7 @@ BASEDIR = . # Note: you can strip out symbols using the strip command # to get an idea of how big the compile really is. -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=1 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DPRINT_ENABLED=1 #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 diff --git a/bacnet-stack/demo/readfile/makefile.b32 b/bacnet-stack/demo/readfile/makefile.b32 index 1d8e21c7..731f0a11 100644 --- a/bacnet-stack/demo/readfile/makefile.b32 +++ b/bacnet-stack/demo/readfile/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacarf PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;PRINT_ENABLED=1 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ diff --git a/bacnet-stack/demo/readprop/Makefile b/bacnet-stack/demo/readprop/Makefile index 3d9b3ae7..d7e882f5 100644 --- a/bacnet-stack/demo/readprop/Makefile +++ b/bacnet-stack/demo/readprop/Makefile @@ -7,7 +7,7 @@ BASEDIR = . # Note: you can strip out symbols using the strip command # to get an idea of how big the compile really is. -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=1 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DPRINT_ENABLED=1 #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 diff --git a/bacnet-stack/demo/readprop/bacrp.cbp b/bacnet-stack/demo/readprop/bacrp.cbp index 570a5ad0..ab77e519 100644 --- a/bacnet-stack/demo/readprop/bacrp.cbp +++ b/bacnet-stack/demo/readprop/bacrp.cbp @@ -1,369 +1,221 @@ - - + - + - diff --git a/bacnet-stack/demo/readprop/main.c b/bacnet-stack/demo/readprop/main.c index cd71dfbe..d44f4fe4 100644 --- a/bacnet-stack/demo/readprop/main.c +++ b/bacnet-stack/demo/readprop/main.c @@ -28,15 +28,19 @@ #include #include #include -#include /* for time */ #include +#include /* for time */ + +#define PRINT_ENABLED 1 + +#include "bacdef.h" +#include "config.h" #include "bactext.h" +#include "bacerror.h" #include "iam.h" #include "arf.h" #include "tsm.h" #include "address.h" -#include "config.h" -#include "bacdef.h" #include "npdu.h" #include "apdu.h" #include "device.h" @@ -70,8 +74,8 @@ static void MyErrorHandler(BACNET_ADDRESS * src, (void) src; (void) invoke_id; printf("BACnet Error: %s: %s\r\n", - bactext_error_class_name(error_class), - bactext_error_code_name(error_code)); + bactext_error_class_name((int)error_class), + bactext_error_code_name((int)error_code)); Error_Detected = true; } @@ -83,7 +87,7 @@ void MyAbortHandler(BACNET_ADDRESS * src, (void) invoke_id; (void) server; printf("BACnet Abort: %s\r\n", - bactext_abort_reason_name(abort_reason)); + bactext_abort_reason_name((int)abort_reason)); Error_Detected = true; } @@ -94,7 +98,7 @@ void MyRejectHandler(BACNET_ADDRESS * src, (void) src; (void) invoke_id; printf("BACnet Reject: %s\r\n", - bactext_reject_reason_name(reject_reason)); + bactext_reject_reason_name((int)reject_reason)); Error_Detected = true; } diff --git a/bacnet-stack/demo/readprop/makefile.b32 b/bacnet-stack/demo/readprop/makefile.b32 index 0373896b..e7640961 100644 --- a/bacnet-stack/demo/readprop/makefile.b32 +++ b/bacnet-stack/demo/readprop/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacrp PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;PRINT_ENABLED=1 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ diff --git a/bacnet-stack/demo/reinit/Makefile b/bacnet-stack/demo/reinit/Makefile index 0fe701bf..2115ed70 100644 --- a/bacnet-stack/demo/reinit/Makefile +++ b/bacnet-stack/demo/reinit/Makefile @@ -7,7 +7,7 @@ BASEDIR = . # Note: you can strip out symbols using the strip command # to get an idea of how big the compile really is. -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=1 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DPRINT_ENABLED=1 #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 diff --git a/bacnet-stack/demo/reinit/makefile.b32 b/bacnet-stack/demo/reinit/makefile.b32 index 87546ff3..4aab68c4 100644 --- a/bacnet-stack/demo/reinit/makefile.b32 +++ b/bacnet-stack/demo/reinit/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacrd PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;USE_INADDR=1;BIP_DEBUG;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;USE_INADDR=1;BIP_DEBUG;PRINT_ENABLED=1 SRCS = main.c \ ..\..\rd.c \ diff --git a/bacnet-stack/demo/server/bacserv.cbp b/bacnet-stack/demo/server/bacserv.cbp index f47d8c4c..96864c63 100644 --- a/bacnet-stack/demo/server/bacserv.cbp +++ b/bacnet-stack/demo/server/bacserv.cbp @@ -2,12 +2,12 @@ - diff --git a/bacnet-stack/demo/timesync/Makefile b/bacnet-stack/demo/timesync/Makefile index 2150aaac..c0a795ad 100644 --- a/bacnet-stack/demo/timesync/Makefile +++ b/bacnet-stack/demo/timesync/Makefile @@ -11,7 +11,7 @@ BASEDIR = . #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=0 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DPRINT_ENABLED=1 DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) BACNET_PORT = ../../ports/linux diff --git a/bacnet-stack/demo/timesync/makefile.b32 b/bacnet-stack/demo/timesync/makefile.b32 index a25fcd77..2f0e3377 100644 --- a/bacnet-stack/demo/timesync/makefile.b32 +++ b/bacnet-stack/demo/timesync/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacts PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=0;USE_INADDR=0;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;MAX_TSM_TRANSACTIONS=0;USE_INADDR=0;PRINT_ENABLED=1 # Directories BACNET_PORT = ..\..\ports\win32 BACNET_OBJECT = ..\object diff --git a/bacnet-stack/demo/ucov/Makefile b/bacnet-stack/demo/ucov/Makefile index 47844beb..d7f65001 100644 --- a/bacnet-stack/demo/ucov/Makefile +++ b/bacnet-stack/demo/ucov/Makefile @@ -11,7 +11,7 @@ BASEDIR = . #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=0 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DMAX_TSM_TRANSACTIONS=0 -DPRINT_ENABLED=1 DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) BACNET_PORT = ../../ports/linux diff --git a/bacnet-stack/demo/ucov/makefile.b32 b/bacnet-stack/demo/ucov/makefile.b32 index 9f5def3c..e8ac1c6a 100644 --- a/bacnet-stack/demo/ucov/makefile.b32 +++ b/bacnet-stack/demo/ucov/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacucov PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=0;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;MAX_TSM_TRANSACTIONS=0;PRINT_ENABLED=1 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ diff --git a/bacnet-stack/demo/whohas/Makefile b/bacnet-stack/demo/whohas/Makefile index c36928f4..06edf987 100644 --- a/bacnet-stack/demo/whohas/Makefile +++ b/bacnet-stack/demo/whohas/Makefile @@ -7,7 +7,7 @@ BASEDIR = . # Note: you can strip out symbols using the strip command # to get an idea of how big the compile really is. -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=0 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DMAX_TSM_TRANSACTIONS=0 -DPRINT_ENABLED=1 #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 diff --git a/bacnet-stack/demo/whohas/makefile.b32 b/bacnet-stack/demo/whohas/makefile.b32 index 74c9cc2a..d86607ac 100644 --- a/bacnet-stack/demo/whohas/makefile.b32 +++ b/bacnet-stack/demo/whohas/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacwh PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=0;USE_INADDR=1;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;MAX_TSM_TRANSACTIONS=0;USE_INADDR=1;PRINT_ENABLED=1 SRCS = main.c \ ..\..\rd.c \ diff --git a/bacnet-stack/demo/whois/Makefile b/bacnet-stack/demo/whois/Makefile index 1aaf5045..3b6e239c 100644 --- a/bacnet-stack/demo/whois/Makefile +++ b/bacnet-stack/demo/whois/Makefile @@ -11,7 +11,7 @@ BASEDIR = . #BACDL_DEFINE = -DBACDL_ETHERNET=1 #BACDL_DEFINE = -DBACDL_ARCNET=1 BACDL_DEFINE = -DBACDL_BIP=1 -DUSE_INADDR=1 -BACNET_DEFINES = -DBACFILE=1 -DTSM_ENABLED=0 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES = -DMAX_TSM_TRANSACTIONS=0 -DPRINT_ENABLED=1 DEFINES=$(BACDL_DEFINE) $(BACNET_DEFINES) BACNET_PORT = ../../ports/linux diff --git a/bacnet-stack/demo/whois/makefile.b32 b/bacnet-stack/demo/whois/makefile.b32 index d2e5c65d..018a6285 100644 --- a/bacnet-stack/demo/whois/makefile.b32 +++ b/bacnet-stack/demo/whois/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacwi PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=0;USE_INADDR=1;BIG_ENDIAN=0;PRINT_ENABLED=1;BIP_DEBUG=1 +DEFINES = -DBACDL_BIP=1;MAX_TSM_TRANSACTIONS=0;USE_INADDR=1;PRINT_ENABLED=1;BIP_DEBUG=1 # Directories BACNET_PORT = ..\..\ports\win32 BACNET_OBJECT = ..\object diff --git a/bacnet-stack/demo/writefile/Makefile b/bacnet-stack/demo/writefile/Makefile index b97fe363..1592a840 100644 --- a/bacnet-stack/demo/writefile/Makefile +++ b/bacnet-stack/demo/writefile/Makefile @@ -11,7 +11,7 @@ BASEDIR = . #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=1 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DTSM_ENABLED=1 -DPRINT_ENABLED=1 DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) BACNET_PORT = ../../ports/linux diff --git a/bacnet-stack/demo/writefile/makefile.b32 b/bacnet-stack/demo/writefile/makefile.b32 index 4e6c3751..b2dc7dc3 100644 --- a/bacnet-stack/demo/writefile/makefile.b32 +++ b/bacnet-stack/demo/writefile/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacawf PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;PRINT_ENABLED=1 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ diff --git a/bacnet-stack/demo/writeprop/Makefile b/bacnet-stack/demo/writeprop/Makefile index 0f1570ea..bccdba6a 100644 --- a/bacnet-stack/demo/writeprop/Makefile +++ b/bacnet-stack/demo/writeprop/Makefile @@ -11,7 +11,7 @@ BASEDIR = . #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 BACDL_DEFINE=-DBACDL_BIP=1 -BACNET_DEFINES=-DBACFILE=1 -DTSM_ENABLED=1 -DBIG_ENDIAN=0 -DPRINT_ENABLED=1 +BACNET_DEFINES=-DPRINT_ENABLED=1 DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) BACNET_PORT = ../../ports/linux diff --git a/bacnet-stack/demo/writeprop/makefile.b32 b/bacnet-stack/demo/writeprop/makefile.b32 index dd12061f..9d29053a 100644 --- a/bacnet-stack/demo/writeprop/makefile.b32 +++ b/bacnet-stack/demo/writeprop/makefile.b32 @@ -15,7 +15,7 @@ PRODUCT = bacwp PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable -DEFINES = -DBACDL_BIP=1;TSM_ENABLED=1;BIG_ENDIAN=0;PRINT_ENABLED=1 +DEFINES = -DBACDL_BIP=1;PRINT_ENABLED=1 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ diff --git a/bacnet-stack/tsm.h b/bacnet-stack/tsm.h index c6a4afb7..595400f9 100644 --- a/bacnet-stack/tsm.h +++ b/bacnet-stack/tsm.h @@ -42,10 +42,7 @@ /* note: TSM functionality is optional - only needed if we are doing client requests */ -#ifndef TSM_ENABLED - #define TSM_ENABLED 0 -#endif -#if (!TSM_ENABLED) +#if (!MAX_TSM_TRANSACTIONS) #define tsm_free_invoke_id(x) (void)x; #else typedef enum {