Feature/makefile add apps library (#218)

* add BACnet stack library at apps/lib

* convert apps to use apps/lib for smaller binary

* fix -DBACDL_ALL=1 build

* fix piface build

* datalink MAX_MPDU and MAX_HEADER cleanup

* add bip6 to git workflow

* fix system library dependency of BACnet library

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2022-01-29 15:55:40 -06:00
committed by GitHub
parent 9c72572692
commit 295f127c2b
79 changed files with 917 additions and 1104 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ int dlmstp_send_pdu(BACNET_ADDRESS *dest, /* destination address */
MSTP_Port.TxDestination = MSTP_BROADCAST_ADDRESS;
}
dlmstp_get_my_address(&src);
if ((MAX_HEADER + pdu_len) > MAX_MPDU) {
if ((DLMSTP_HEADER_MAX + pdu_len) > DLMSTP_MPDU_MAX) {
return -4;
}
bytes_sent = MSTP_Create_Frame((uint8_t *)&MSTP_Port.TxBuffer[0],
+3 -3
View File
@@ -42,15 +42,15 @@
#include "bacnet/npdu.h"
/* defines specific to MS/TP */
#define MAX_HEADER (2+1+1+1+2+1)
#define MAX_MPDU (MAX_HEADER+MAX_PDU)
#define DLMSTP_HEADER_MAX (2+1+1+1+2+1)
#define DLMSTP_MPDU_MAX (DLMSTP_HEADER_MAX+MAX_PDU)
typedef struct dlmstp_packet {
bool ready; /* true if ready to be sent or received */
BACNET_ADDRESS address; /* source address */
uint8_t frame_type; /* type of message */
unsigned pdu_len; /* packet length */
uint8_t pdu[MAX_MPDU]; /* packet */
uint8_t pdu[DLMSTP_MPDU_MAX]; /* packet */
} DLMSTP_PACKET;
/* number of MS/TP tx/rx packets */
+2 -2
View File
@@ -222,7 +222,7 @@ void MSTP_Create_And_Send_Frame(
uint8_t *data, /* any data to be sent - may be null */
unsigned data_len)
{ /* number of bytes of data (up to 501) */
uint8_t buffer[MAX_MPDU] = { 0 }; /* buffer for sending */
uint8_t buffer[DLMSTP_MPDU_MAX] = { 0 }; /* buffer for sending */
uint16_t len = 0; /* number of bytes to send */
len = (uint16_t)MSTP_Create_Frame(&buffer[0], /* where frame is loaded */
@@ -435,7 +435,7 @@ void MSTP_Receive_Frame_FSM(volatile struct mstp_port_struct_t *mstp_port)
(mstp_port->DestinationAddress ==
MSTP_BROADCAST_ADDRESS)) {
/* FrameTooLong */
if (mstp_port->DataLength > MAX_MPDU) {
if (mstp_port->DataLength > DLMSTP_MPDU_MAX) {
/* indicate that a frame with an illegal or */
/* unacceptable data length has been received */
mstp_port->ReceivedInvalidFrame = true;