From 27f2b9960a706e226cb5961597030bd731b5c8a9 Mon Sep 17 00:00:00 2001 From: skarg Date: Fri, 10 Aug 2007 00:21:27 +0000 Subject: [PATCH] Updated rx_fsm for Win32 port. Used for monitoring ms/tp stream from USB-RS485 dongle. --- bacnet-stack/ports/win32/rs485.c | 4 ++-- bacnet-stack/ports/win32/rx_fsm.c | 3 +++ bacnet-stack/ports/win32/rx_fsm.cbp | 19 +++++++++++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/bacnet-stack/ports/win32/rs485.c b/bacnet-stack/ports/win32/rs485.c index 80b50af7..13bf930c 100644 --- a/bacnet-stack/ports/win32/rs485.c +++ b/bacnet-stack/ports/win32/rs485.c @@ -277,12 +277,12 @@ void RS485_Send_Frame( uint8_t * buffer, /* frame to send (up to 501 bytes of data) */ uint16_t nbytes) /* number of bytes of data (up to 501) */ { - uint8_t turnaround_time; - uint32_t baud; DWORD dwWritten = 0; #if 0 if (mstp_port) { + uint32_t baud; + uint8_t turnaround_time; baud = RS485_Get_Baud_Rate(); /* wait about 40 bit times since reception */ if (baud == 9600) diff --git a/bacnet-stack/ports/win32/rx_fsm.c b/bacnet-stack/ports/win32/rx_fsm.c index 3a478ed3..7f71bdfe 100644 --- a/bacnet-stack/ports/win32/rx_fsm.c +++ b/bacnet-stack/ports/win32/rx_fsm.c @@ -46,6 +46,7 @@ #include "bytes.h" #include "rs485.h" #include "mstp.h" +#include "mstptext.h" #include "crc.h" #define INCREMENT_AND_LIMIT_UINT16(x) {if (x < 0xFFFF) x++;} @@ -122,6 +123,8 @@ static void print_received_packet( mstp_port->DataCRCActualMSB, mstp_port->DataCRCActualLSB); } + fprintf(stderr,"%s", + mstptext_frame_type(mstp_port->FrameType)); fprintf(stderr,"\n"); } diff --git a/bacnet-stack/ports/win32/rx_fsm.cbp b/bacnet-stack/ports/win32/rx_fsm.cbp index fe27914f..1094a23b 100644 --- a/bacnet-stack/ports/win32/rx_fsm.cbp +++ b/bacnet-stack/ports/win32/rx_fsm.cbp @@ -13,8 +13,6 @@