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:
@@ -99,10 +99,11 @@ static DNET *Router_Table_Head;
|
||||
static uint16_t BIP_Net;
|
||||
static uint16_t BIP6_Net;
|
||||
/* buffer for receiving packets from the directly connected ports */
|
||||
static uint8_t BIP_Rx_Buffer[MAX_MPDU];
|
||||
static uint8_t BIP6_Rx_Buffer[MAX_MPDU];
|
||||
static uint8_t BIP_Rx_Buffer[BIP_MPDU_MAX];
|
||||
static uint8_t BIP6_Rx_Buffer[BIP6_MPDU_MAX];
|
||||
/* buffer for transmitting from any port */
|
||||
static uint8_t Tx_Buffer[MAX_MPDU];
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
static uint8_t Tx_Buffer[MAX(BIP_MPDU_MAX,BIP6_MPDU_MAX)];
|
||||
/* main loop exit control */
|
||||
static bool Exit_Requested;
|
||||
|
||||
@@ -1150,14 +1151,16 @@ int main(int argc, char *argv[])
|
||||
/* input */
|
||||
current_seconds = time(NULL);
|
||||
/* returns 0 bytes on timeout */
|
||||
pdu_len = bip_receive(&src, &BIP_Rx_Buffer[0], MAX_MPDU, 5);
|
||||
pdu_len = bip_receive(&src, &BIP_Rx_Buffer[0],
|
||||
sizeof(BIP_Rx_Buffer), 5);
|
||||
/* process */
|
||||
if (pdu_len) {
|
||||
debug_printf("BACnet/IP Received packet\n");
|
||||
my_routing_npdu_handler(BIP_Net, &src, &BIP_Rx_Buffer[0], pdu_len);
|
||||
}
|
||||
/* returns 0 bytes on timeout */
|
||||
pdu_len = bip6_receive(&src, &BIP6_Rx_Buffer[0], MAX_MPDU, 5);
|
||||
pdu_len = bip6_receive(&src, &BIP6_Rx_Buffer[0],
|
||||
sizeof(BIP6_Rx_Buffer), 5);
|
||||
/* process */
|
||||
if (pdu_len) {
|
||||
debug_printf("BACnet/IPv6 Received packet\n");
|
||||
|
||||
Reference in New Issue
Block a user