Feature/mstp extended frames (#529)

* added MSTP extended frames to bacnet/datalink/mstp.c module. Thank you, Simon!

* auto-size some FIFO buffers for MSTP

* add COBS library to MSTP builds

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2023-11-08 15:54:18 -06:00
committed by GitHub
parent 2536d5a350
commit 1372e52aa7
22 changed files with 109 additions and 32 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ OPTIMIZE_FLAGS += -DNDEBUG
BACNET_FLAGS = -DBACDL_MSTP=1
BACNET_FLAGS += -DBACAPP_ALL
BACNET_FLAGS += -DMAX_APDU=480
BACNET_FLAGS += -DMAX_APDU=1476
BACNET_FLAGS += -DBIG_ENDIAN=0
BACNET_FLAGS += -DMAX_TSM_TRANSACTIONS=0
BACNET_FLAGS += -DMAX_CHARACTER_STRING_BYTES=64
+1 -1
View File
@@ -224,7 +224,7 @@
<state>USE_STDPERIPH_DRIVER</state>
<state>STM32F4XX</state>
<state>BACDL_MSTP</state>
<state>MAX_APDU=480</state>
<state>MAX_APDU=1476</state>
<state>BIG_ENDIAN=0</state>
<state>MAX_TSM_TRANSACTIONS=1</state>
</option>
+5 -4
View File
@@ -33,17 +33,18 @@
#include "bacnet/basic/sys/mstimer.h"
#include "bacnet/bits.h"
#include "bacnet/basic/sys/fifo.h"
#include "bacnet/datalink/dlmstp.h"
#include "bacnet/datalink/mstpdef.h"
#include "rs485.h"
/* buffer for storing received bytes - size must be power of two */
/* BACnet DLMSTP_MPDU_MAX for MS/TP is 501 bytes */
static uint8_t Receive_Queue_Data[512];
/* BACnet DLMSTP_MPDU_MAX for MS/TP is 1501 bytes */
static uint8_t Receive_Queue_Data[NEXT_POWER_OF_2(DLMSTP_MPDU_MAX)];
static FIFO_BUFFER Receive_Queue;
/* buffer for storing bytes to transmit */
/* BACnet DLMSTP_MPDU_MAX for MS/TP is 501 bytes */
static uint8_t Transmit_Queue_Data[512];
/* BACnet DLMSTP_MPDU_MAX for MS/TP is 1501 bytes */
static uint8_t Transmit_Queue_Data[NEXT_POWER_OF_2(DLMSTP_MPDU_MAX)];
static FIFO_BUFFER Transmit_Queue;
/* baud rate of the UART interface */