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:
@@ -54,8 +54,8 @@ static DLMSTP_PACKET Transmit_Packet;
|
||||
/* local MS/TP port data - shared with RS-485 */
|
||||
volatile struct mstp_port_struct_t MSTP_Port;
|
||||
/* buffers needed by mstp port struct */
|
||||
static uint8_t TxBuffer[MAX_MPDU];
|
||||
static uint8_t RxBuffer[MAX_MPDU];
|
||||
static uint8_t TxBuffer[DLMSTP_MPDU_MAX];
|
||||
static uint8_t RxBuffer[DLMSTP_MPDU_MAX];
|
||||
/* Timer that indicates line silence - and functions */
|
||||
static uint32_t SilenceStartTime;
|
||||
static uint32_t TimeBeginPeriod;
|
||||
@@ -282,7 +282,7 @@ uint16_t MSTP_Get_Send(
|
||||
} else {
|
||||
destination = MSTP_BROADCAST_ADDRESS;
|
||||
}
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
|
||||
return 0;
|
||||
}
|
||||
/* convert the PDU into the MSTP Frame */
|
||||
@@ -421,7 +421,7 @@ uint16_t MSTP_Get_Reply(
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
|
||||
return 0;
|
||||
}
|
||||
/* is this the reply to the DER? */
|
||||
|
||||
@@ -53,8 +53,8 @@ static DLMSTP_PACKET Transmit_Packet;
|
||||
/* local MS/TP port data - shared with RS-485 */
|
||||
volatile struct mstp_port_struct_t MSTP_Port;
|
||||
/* buffers needed by mstp port struct */
|
||||
static uint8_t TxBuffer[MAX_MPDU];
|
||||
static uint8_t RxBuffer[MAX_MPDU];
|
||||
static uint8_t TxBuffer[DLMSTP_MPDU_MAX];
|
||||
static uint8_t RxBuffer[DLMSTP_MPDU_MAX];
|
||||
/* The minimum time without a DataAvailable or ReceiveError event */
|
||||
/* that a node must wait for a station to begin replying to a */
|
||||
/* confirmed request: 255 milliseconds. (Implementations may use */
|
||||
@@ -267,7 +267,7 @@ uint16_t MSTP_Get_Send(
|
||||
} else {
|
||||
destination = MSTP_BROADCAST_ADDRESS;
|
||||
}
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
|
||||
return 0;
|
||||
}
|
||||
/* convert the PDU into the MSTP Frame */
|
||||
@@ -407,7 +407,7 @@ uint16_t MSTP_Get_Reply(
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > MAX_MPDU) {
|
||||
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
|
||||
return 0;
|
||||
}
|
||||
/* is this the reply to the DER? */
|
||||
|
||||
@@ -193,7 +193,7 @@ bool ethernet_init(char *if_name)
|
||||
*/
|
||||
/* Open the output device */
|
||||
pcap_eth802_fp = pcap_open(if_name, /* name of the device */
|
||||
MAX_MPDU, /* portion of the packet to capture */
|
||||
ETHERNET_MPDU_MAX, /* portion of the packet to capture */
|
||||
PCAP_OPENFLAG_PROMISCUOUS, /* promiscuous mode */
|
||||
eth_timeout, /* read timeout */
|
||||
NULL, /* authentication on the remote machine */
|
||||
@@ -226,7 +226,7 @@ int ethernet_send(BACNET_ADDRESS *dest, /* destination address */
|
||||
)
|
||||
{
|
||||
int bytes = 0;
|
||||
uint8_t mtu[MAX_MPDU] = { 0 };
|
||||
uint8_t mtu[ETHERNET_MPDU_MAX] = { 0 };
|
||||
int mtu_len = 0;
|
||||
int i = 0;
|
||||
|
||||
@@ -256,7 +256,7 @@ int ethernet_send(BACNET_ADDRESS *dest, /* destination address */
|
||||
LogError("ethernet.c: invalid source MAC address!\n");
|
||||
return -3;
|
||||
}
|
||||
if ((14 + 3 + pdu_len) > MAX_MPDU) {
|
||||
if ((14 + 3 + pdu_len) > ETHERNET_MPDU_MAX) {
|
||||
LogError("ethernet.c: PDU is too big to send!\n");
|
||||
return -4;
|
||||
}
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ static void RS485_Configure_Status(void)
|
||||
RS485_Print_Error();
|
||||
}
|
||||
/* Set the Comm buffer size */
|
||||
SetupComm(RS485_Handle, MAX_MPDU, MAX_MPDU);
|
||||
SetupComm(RS485_Handle, DLMSTP_MPDU_MAX, DLMSTP_MPDU_MAX);
|
||||
/* raise DTR */
|
||||
if (!EscapeCommFunction(RS485_Handle, SETDTR)) {
|
||||
fprintf(stderr, "Unable to set DTR on %s\n", RS485_Port_Name);
|
||||
|
||||
@@ -78,8 +78,8 @@ typedef struct pcaprec_hdr_s {
|
||||
|
||||
/* local port data - shared with RS-485 */
|
||||
volatile struct mstp_port_struct_t MSTP_Port;
|
||||
static uint8_t RxBuffer[MAX_MPDU];
|
||||
static uint8_t TxBuffer[MAX_MPDU];
|
||||
static uint8_t RxBuffer[DLMSTP_MPDU_MAX];
|
||||
static uint8_t TxBuffer[DLMSTP_MPDU_MAX];
|
||||
static uint16_t SilenceTime;
|
||||
#define INCREMENT_AND_LIMIT_UINT16(x) \
|
||||
{ \
|
||||
|
||||
Reference in New Issue
Block a user