Added h_npdu to demo lib and example projects.

This commit is contained in:
skarg
2008-09-07 04:23:44 +00:00
parent 4b2839c3c2
commit 3a0f109d66
9 changed files with 32 additions and 27 deletions
+5
View File
@@ -42,6 +42,11 @@ extern "C" {
BACNET_ADDRESS * dest, BACNET_ADDRESS * dest,
BACNET_CONFIRMED_SERVICE_DATA * service_data); 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( void handler_who_is(
uint8_t * service_request, uint8_t * service_request,
uint16_t service_len, uint16_t service_len,
-5
View File
@@ -91,11 +91,6 @@ extern "C" {
BACNET_ADDRESS * src, BACNET_ADDRESS * src,
BACNET_NPDU_DATA * npdu_data); 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 #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
+3
View File
@@ -88,6 +88,9 @@
<Unit filename="..\demo\handler\h_whois.c"> <Unit filename="..\demo\handler\h_whois.c">
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
<Unit filename="..\demo\handler\h_npdu.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\demo\handler\h_wp.c"> <Unit filename="..\demo\handler\h_wp.c">
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
+3 -2
View File
@@ -22,8 +22,8 @@ BACNET_FLAGS += -DCRC_USE_TABLE
BACNET_CORE = ../../src BACNET_CORE = ../../src
BACNET_DEMO = ../../demo BACNET_DEMO = ../../demo
BACNET_INCLUDE = ../../include BACNET_INCLUDE = ../../include
INCLUDES = -I. INCLUDES = -I.
INCLUDES += -I$(BACNET_INCLUDE) INCLUDES += -I$(BACNET_INCLUDE)
#OPTIMIZATION = -O0 #OPTIMIZATION = -O0
OPTIMIZATION = -Os OPTIMIZATION = -Os
CFLAGS = -fno-common $(INCLUDES) $(BACNET_FLAGS) -Wall -g CFLAGS = -fno-common $(INCLUDES) $(BACNET_FLAGS) -Wall -g
@@ -59,6 +59,7 @@ DEMOSRC = ai.c \
h_wp.c \ h_wp.c \
device.c \ device.c \
$(BACNET_DEMO)/handler/txbuf.c \ $(BACNET_DEMO)/handler/txbuf.c \
$(BACNET_DEMO)/handler/h_npdu.c \
$(BACNET_DEMO)/handler/h_whois.c \ $(BACNET_DEMO)/handler/h_whois.c \
$(BACNET_DEMO)/handler/h_rd.c \ $(BACNET_DEMO)/handler/h_rd.c \
$(BACNET_DEMO)/handler/h_dcc.c $(BACNET_DEMO)/handler/h_dcc.c
+4 -3
View File
@@ -32,6 +32,7 @@ DEMOSRC = h_rp.c \
av.c \ av.c \
bv.c \ bv.c \
$(BACNET_DEMO)/handler/txbuf.c \ $(BACNET_DEMO)/handler/txbuf.c \
$(BACNET_DEMO)/handler/h_npdu.c \
$(BACNET_DEMO)/handler/noserv.c \ $(BACNET_DEMO)/handler/noserv.c \
h_whois.c \ h_whois.c \
h_wp.c h_wp.c
@@ -87,7 +88,7 @@ LIBRARY = lib$(TARGET).a
## Options common to compile, link and assembly rules ## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU) COMMON = -mmcu=$(MCU)
OPTIMIZE_FLAGS = -mcall-prologues OPTIMIZE_FLAGS = -mcall-prologues
#OPTIMIZE_FLAGS += -finline-functions #OPTIMIZE_FLAGS += -finline-functions
OPTIMIZE_FLAGS += -finline-functions-called-once OPTIMIZE_FLAGS += -finline-functions-called-once
#OPTIMIZATION = -O0 #OPTIMIZATION = -O0
@@ -112,7 +113,7 @@ BFLAGS += -DMAX_BINARY_VALUES=10
CFLAGS = $(COMMON) CFLAGS = $(COMMON)
# dead code removal # dead code removal
CFLAGS += -ffunction-sections -fdata-sections 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 CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags ## Assembly specific flags
@@ -124,7 +125,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
LDFLAGS = $(COMMON) LDFLAGS = $(COMMON)
#dead code removal #dead code removal
#LDFLAGS += -Wl,-nostartfiles,-nostdlib #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,-L=.,-l$(TARGET)
#LDFLAGS += -Wl,-Map=$(TARGET).map #LDFLAGS += -Wl,-Map=$(TARGET).map
+3 -2
View File
@@ -30,6 +30,7 @@ DEMOSRC = h_rp.c \
bv.c \ bv.c \
$(BACNET_DEMO)/handler/txbuf.c \ $(BACNET_DEMO)/handler/txbuf.c \
$(BACNET_DEMO)/handler/noserv.c \ $(BACNET_DEMO)/handler/noserv.c \
$(BACNET_DEMO)/handler/h_npdu.c \
$(BACNET_DEMO)/handler/h_whois.c \ $(BACNET_DEMO)/handler/h_whois.c \
h_wp.c h_wp.c
@@ -94,7 +95,7 @@ BFLAGS += -DBACAPP_REAL
CFLAGS = $(COMMON) CFLAGS = $(COMMON)
# dead code removal # dead code removal
CFLAGS += -ffunction-sections -fdata-sections CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -Wall $(BFLAGS) $(OPTIMIZATION) CFLAGS += -Wall $(BFLAGS) $(OPTIMIZATION)
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags ## Assembly specific flags
@@ -105,7 +106,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags ## Linker flags
LDFLAGS = $(COMMON) LDFLAGS = $(COMMON)
#dead code removal #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,-L=.,-l$(TARGET)
#LDFLAGS += -Wl,-Map=$(TARGET).map #LDFLAGS += -Wl,-Map=$(TARGET).map
+3 -2
View File
@@ -37,6 +37,7 @@ SRCS = main.c \
..\..\mstp.c \ ..\..\mstp.c \
..\..\crc.c \ ..\..\crc.c \
..\..\demo\handler\h_iam.c \ ..\..\demo\handler\h_iam.c \
..\..\demo\handler\h_npdu.c \
..\..\demo\handler\h_whois.c \ ..\..\demo\handler\h_whois.c \
..\..\demo\handler\h_wp.c \ ..\..\demo\handler\h_wp.c \
..\..\demo\handler\h_rp.c \ ..\..\demo\handler\h_rp.c \
@@ -178,8 +179,8 @@ install : $(PRODUCT)
# Compiler configuration file # Compiler configuration file
bcc32.cfg : bcc32.cfg :
Copy &&| Copy &&|
$(CFLAGS) $(CFLAGS)
-c -c
#-g2 #stop after gN warnings #-g2 #stop after gN warnings
-y #include line numbers in OBJ's -y #include line numbers in OBJ's
-v #include debug info -v #include debug info
+11 -7
View File
@@ -7,19 +7,19 @@
CFG=bacnet - Win32 Debug CFG=bacnet - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "bacnet.mak". !MESSAGE NMAKE /f "bacnet.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "bacnet.mak" CFG="bacnet - Win32 Debug" !MESSAGE NMAKE /f "bacnet.mak" CFG="bacnet - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "bacnet - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "bacnet - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "bacnet - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "bacnet - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
# PROP AllowPerConfigDependencies 0 # 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 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 # 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 # Begin Target
@@ -233,6 +233,10 @@ SOURCE=..\..\..\demo\handler\h_whois.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\demo\handler\h_npdu.c
# End Source File
# Begin Source File
SOURCE=..\..\..\demo\handler\h_wp.c SOURCE=..\..\..\demo\handler\h_wp.c
# End Source File # End Source File
# Begin Source File # Begin Source File
-6
View File
@@ -40,12 +40,6 @@
#include "bits.h" #include "bits.h"
#include "npdu.h" #include "npdu.h"
#include "apdu.h" #include "apdu.h"
#define DEBUG_ENABLED 0
#include "debug.h"
#if PRINT_ENABLED
#include <stdio.h>
#endif
void npdu_copy_data( void npdu_copy_data(
BACNET_NPDU_DATA * dest, BACNET_NPDU_DATA * dest,