diff --git a/bacnet-stack/include/handlers.h b/bacnet-stack/include/handlers.h index 23f4bd0b..fc7cccf3 100644 --- a/bacnet-stack/include/handlers.h +++ b/bacnet-stack/include/handlers.h @@ -42,6 +42,11 @@ extern "C" { BACNET_ADDRESS * dest, BACNET_CONFIRMED_SERVICE_DATA * service_data); + void npdu_handler( + BACNET_ADDRESS * src, /* source address */ + uint8_t * pdu, /* PDU data */ + uint16_t pdu_len); /* length PDU */ + void handler_who_is( uint8_t * service_request, uint16_t service_len, diff --git a/bacnet-stack/include/npdu.h b/bacnet-stack/include/npdu.h index 8b4b2826..22e8649e 100644 --- a/bacnet-stack/include/npdu.h +++ b/bacnet-stack/include/npdu.h @@ -91,11 +91,6 @@ extern "C" { BACNET_ADDRESS * src, BACNET_NPDU_DATA * npdu_data); - void npdu_handler( - BACNET_ADDRESS * src, /* source address */ - uint8_t * pdu, /* PDU data */ - uint16_t pdu_len); /* length PDU */ - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/bacnet-stack/lib/bacnet.cbp b/bacnet-stack/lib/bacnet.cbp index dfebd80b..a272ba1f 100644 --- a/bacnet-stack/lib/bacnet.cbp +++ b/bacnet-stack/lib/bacnet.cbp @@ -88,6 +88,9 @@ + + diff --git a/bacnet-stack/ports/at91sam7s/makefile b/bacnet-stack/ports/at91sam7s/makefile index 8cf2581f..58363753 100644 --- a/bacnet-stack/ports/at91sam7s/makefile +++ b/bacnet-stack/ports/at91sam7s/makefile @@ -22,8 +22,8 @@ BACNET_FLAGS += -DCRC_USE_TABLE BACNET_CORE = ../../src BACNET_DEMO = ../../demo BACNET_INCLUDE = ../../include -INCLUDES = -I. -INCLUDES += -I$(BACNET_INCLUDE) +INCLUDES = -I. +INCLUDES += -I$(BACNET_INCLUDE) #OPTIMIZATION = -O0 OPTIMIZATION = -Os CFLAGS = -fno-common $(INCLUDES) $(BACNET_FLAGS) -Wall -g @@ -59,6 +59,7 @@ DEMOSRC = ai.c \ h_wp.c \ device.c \ $(BACNET_DEMO)/handler/txbuf.c \ + $(BACNET_DEMO)/handler/h_npdu.c \ $(BACNET_DEMO)/handler/h_whois.c \ $(BACNET_DEMO)/handler/h_rd.c \ $(BACNET_DEMO)/handler/h_dcc.c diff --git a/bacnet-stack/ports/atmega168/Makefile b/bacnet-stack/ports/atmega168/Makefile index 898e3c93..42c79bd8 100644 --- a/bacnet-stack/ports/atmega168/Makefile +++ b/bacnet-stack/ports/atmega168/Makefile @@ -32,6 +32,7 @@ DEMOSRC = h_rp.c \ av.c \ bv.c \ $(BACNET_DEMO)/handler/txbuf.c \ + $(BACNET_DEMO)/handler/h_npdu.c \ $(BACNET_DEMO)/handler/noserv.c \ h_whois.c \ h_wp.c @@ -87,7 +88,7 @@ LIBRARY = lib$(TARGET).a ## Options common to compile, link and assembly rules COMMON = -mmcu=$(MCU) -OPTIMIZE_FLAGS = -mcall-prologues +OPTIMIZE_FLAGS = -mcall-prologues #OPTIMIZE_FLAGS += -finline-functions OPTIMIZE_FLAGS += -finline-functions-called-once #OPTIMIZATION = -O0 @@ -112,7 +113,7 @@ BFLAGS += -DMAX_BINARY_VALUES=10 CFLAGS = $(COMMON) # dead code removal CFLAGS += -ffunction-sections -fdata-sections -CFLAGS += -Wall -gdwarf-2 $(BFLAGS) $(OPTIMIZATION) -fsigned-char +CFLAGS += -Wall -gdwarf-2 $(BFLAGS) $(OPTIMIZATION) -fsigned-char CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d ## Assembly specific flags @@ -124,7 +125,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2 LDFLAGS = $(COMMON) #dead code removal #LDFLAGS += -Wl,-nostartfiles,-nostdlib -LDFLAGS += -Wl,--gc-sections,-static +LDFLAGS += -Wl,--gc-sections,-static LDFLAGS += -Wl,-Map=$(TARGET).map,-L=.,-l$(TARGET) #LDFLAGS += -Wl,-Map=$(TARGET).map diff --git a/bacnet-stack/ports/pic18f6720/Makefile b/bacnet-stack/ports/pic18f6720/Makefile index 7225751b..f767ad19 100644 --- a/bacnet-stack/ports/pic18f6720/Makefile +++ b/bacnet-stack/ports/pic18f6720/Makefile @@ -30,6 +30,7 @@ DEMOSRC = h_rp.c \ bv.c \ $(BACNET_DEMO)/handler/txbuf.c \ $(BACNET_DEMO)/handler/noserv.c \ + $(BACNET_DEMO)/handler/h_npdu.c \ $(BACNET_DEMO)/handler/h_whois.c \ h_wp.c @@ -94,7 +95,7 @@ BFLAGS += -DBACAPP_REAL CFLAGS = $(COMMON) # dead code removal CFLAGS += -ffunction-sections -fdata-sections -CFLAGS += -Wall $(BFLAGS) $(OPTIMIZATION) +CFLAGS += -Wall $(BFLAGS) $(OPTIMIZATION) CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d ## Assembly specific flags @@ -105,7 +106,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2 ## Linker flags LDFLAGS = $(COMMON) #dead code removal -LDFLAGS += -Wl,--gc-sections,-static +LDFLAGS += -Wl,--gc-sections,-static LDFLAGS += -Wl,-Map=$(TARGET).map,-L=.,-l$(TARGET) #LDFLAGS += -Wl,-Map=$(TARGET).map diff --git a/bacnet-stack/ports/rtos32/makefile.mak b/bacnet-stack/ports/rtos32/makefile.mak index 505fda05..9f43a6e1 100644 --- a/bacnet-stack/ports/rtos32/makefile.mak +++ b/bacnet-stack/ports/rtos32/makefile.mak @@ -37,6 +37,7 @@ SRCS = main.c \ ..\..\mstp.c \ ..\..\crc.c \ ..\..\demo\handler\h_iam.c \ + ..\..\demo\handler\h_npdu.c \ ..\..\demo\handler\h_whois.c \ ..\..\demo\handler\h_wp.c \ ..\..\demo\handler\h_rp.c \ @@ -178,8 +179,8 @@ install : $(PRODUCT) # Compiler configuration file bcc32.cfg : Copy &&| -$(CFLAGS) --c +$(CFLAGS) +-c #-g2 #stop after gN warnings -y #include line numbers in OBJ's -v #include debug info diff --git a/bacnet-stack/ports/win32/bacnet/bacnet.dsp b/bacnet-stack/ports/win32/bacnet/bacnet.dsp index ddb1c3bb..a7b617cf 100644 --- a/bacnet-stack/ports/win32/bacnet/bacnet.dsp +++ b/bacnet-stack/ports/win32/bacnet/bacnet.dsp @@ -7,19 +7,19 @@ CFG=bacnet - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "bacnet.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "bacnet.mak" CFG="bacnet - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "bacnet - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "bacnet - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -78,7 +78,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -!ENDIF +!ENDIF # Begin Target @@ -233,6 +233,10 @@ SOURCE=..\..\..\demo\handler\h_whois.c # End Source File # Begin Source File +SOURCE=..\..\..\demo\handler\h_npdu.c +# End Source File +# Begin Source File + SOURCE=..\..\..\demo\handler\h_wp.c # End Source File # Begin Source File diff --git a/bacnet-stack/src/npdu.c b/bacnet-stack/src/npdu.c index ad12120a..7eae520a 100644 --- a/bacnet-stack/src/npdu.c +++ b/bacnet-stack/src/npdu.c @@ -40,12 +40,6 @@ #include "bits.h" #include "npdu.h" #include "apdu.h" -#define DEBUG_ENABLED 0 -#include "debug.h" - -#if PRINT_ENABLED -#include -#endif void npdu_copy_data( BACNET_NPDU_DATA * dest,