From ed6c26e924eaaee699149a47e8c42be5ea45d9f9 Mon Sep 17 00:00:00 2001 From: skarg Date: Sat, 14 Jul 2007 00:41:35 +0000 Subject: [PATCH] Modified the makefile for demo/server to work with BACnet MS/TP with a USB RS-485 from SerialGear. Still in testing, but it compiles, runs, and receives frames. Might be an issue with timing. --- bacnet-stack/demo/server/makefile.b32 | 6 ++++++ bacnet-stack/mstp.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bacnet-stack/demo/server/makefile.b32 b/bacnet-stack/demo/server/makefile.b32 index 26eb375f..134b6325 100644 --- a/bacnet-stack/demo/server/makefile.b32 +++ b/bacnet-stack/demo/server/makefile.b32 @@ -17,11 +17,17 @@ PRODUCT_EXE = $(PRODUCT).exe # Choose the Data Link Layer to Enable # Note: unless some other drivers are installed, BIP is the only # datalink layer that Win32 supports +#DEFINES = -DBACDL_MSTP=1;BIP_DEBUG=1;USE_INADDR=1;PRINT_ENABLED=1;BIG_ENDIAN=0 DEFINES = -DBACDL_BIP=1;BIP_DEBUG=1;USE_INADDR=1;PRINT_ENABLED=1;BIG_ENDIAN=0 SRCS = main.c \ ..\..\ports\win32\bip-init.c \ + ..\..\ports\win32\dlmstp.c \ + ..\..\ports\win32\rs485.c \ ..\..\bip.c \ + ..\..\crc.c \ + ..\..\mstp.c \ + ..\..\mstptext.c \ ..\..\demo\handler\txbuf.c \ ..\..\demo\handler\noserv.c \ ..\..\demo\handler\h_whois.c \ diff --git a/bacnet-stack/mstp.c b/bacnet-stack/mstp.c index 4b26f580..a0310fb9 100644 --- a/bacnet-stack/mstp.c +++ b/bacnet-stack/mstp.c @@ -59,7 +59,7 @@ /* debug print statements */ #if PRINT_ENABLED #define PRINT_ENABLED_RECEIVE 0 -#define PRINT_ENABLED_RECEIVE_DATA 1 +#define PRINT_ENABLED_RECEIVE_DATA 0 #define PRINT_ENABLED_RECEIVE_ERRORS 1 #define PRINT_ENABLED_MASTER 0 #else @@ -257,7 +257,7 @@ void MSTP_Receive_Frame_FSM(volatile struct mstp_port_struct_t *mstp_port) mstp_port->receive_state = MSTP_RECEIVE_STATE_IDLE; } else if (mstp_port->DataAvailable == true) { #if PRINT_ENABLED_RECEIVE_DATA -#if defined(_WIN32) +#if (defined(_WIN32) && defined(TEST_DLMSTP)) extern uint32_t timestamp_ms(void); fprintf(stderr, "MSTP Rx %03u: %02X ", (unsigned)timestamp_ms(),