Converted to standard indent style.
This commit is contained in:
@@ -66,7 +66,7 @@ int dlmstp_send_pdu(BACNET_ADDRESS * dest, /* destination address */
|
||||
int bytes_sent = 0;
|
||||
uint8_t frame_type = 0;
|
||||
uint8_t destination = 0; /* destination address */
|
||||
BACNET_ADDRESS src;
|
||||
BACNET_ADDRESS src;
|
||||
unsigned mtu_len = 0;
|
||||
|
||||
if (MSTP_Port.TxReady == false) {
|
||||
@@ -84,23 +84,22 @@ int dlmstp_send_pdu(BACNET_ADDRESS * dest, /* destination address */
|
||||
fprintf(stderr, "mstp: invalid destination MAC address!\n");
|
||||
#endif
|
||||
return -2;
|
||||
}
|
||||
/* header len */
|
||||
}
|
||||
/* header len */
|
||||
mtu_len = 8;
|
||||
if ((mtu_len + pdu_len) > MAX_MPDU) {
|
||||
if ((mtu_len + pdu_len) > MAX_MPDU) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr, "mstp: PDU is too big to send!\n");
|
||||
#endif
|
||||
return -4;
|
||||
}
|
||||
memmove(&PDU_Buffer[mtu_len], pdu, pdu_len);
|
||||
}
|
||||
memmove(&PDU_Buffer[mtu_len], pdu, pdu_len);
|
||||
mtu_len += pdu_len;
|
||||
bytes_sent = MSTP_Create_Frame(
|
||||
(uint8_t *) & MSTP_Port.TxBuffer[0],
|
||||
sizeof(MSTP_Port.TxBuffer),
|
||||
MSTP_Port.TxFrameType,
|
||||
destination,
|
||||
MSTP_Port.This_Station, &PDU_Buffer[0], mtu_len);
|
||||
destination, MSTP_Port.This_Station, &PDU_Buffer[0], mtu_len);
|
||||
MSTP_Port.TxLength = bytes_sent;
|
||||
MSTP_Port.TxReady = true;
|
||||
}
|
||||
@@ -123,7 +122,7 @@ uint16_t dlmstp_receive(BACNET_ADDRESS * src, /* source address */
|
||||
{
|
||||
uint16_t pdu_len = 0;
|
||||
|
||||
(void) timeout;
|
||||
(void) timeout;
|
||||
/* only do receive state machine while we don't have a frame */
|
||||
if ((MSTP_Port.ReceivedValidFrame == false) &&
|
||||
(MSTP_Port.ReceivedInvalidFrame == false)) {
|
||||
@@ -132,7 +131,8 @@ uint16_t dlmstp_receive(BACNET_ADDRESS * src, /* source address */
|
||||
}
|
||||
/* only do master state machine while rx is idle */
|
||||
if (MSTP_Port.receive_state == MSTP_RECEIVE_STATE_IDLE) {
|
||||
while (MSTP_Master_Node_FSM(&MSTP_Port)) {};
|
||||
while (MSTP_Master_Node_FSM(&MSTP_Port)) {
|
||||
};
|
||||
}
|
||||
/* see if there is a packet available */
|
||||
if (Receive_Buffer.ready) {
|
||||
|
||||
Reference in New Issue
Block a user