parent
3396aa865a
commit
1899ef3506
|
@ -177,9 +177,9 @@ int CanStreamerState::receiveFrame(CANRxFrame *rxmsg, uint8_t *buf, int num, can
|
|||
int CanStreamerState::sendDataTimeout(const uint8_t *txbuf, int numBytes, can_sysinterval_t timeout) {
|
||||
int offset = 0;
|
||||
|
||||
#ifdef SERIAL_CAN_DEBUG
|
||||
PRINT("*** INFO: sendDataTimeout %d" PRINT_EOL, numBytes);
|
||||
#endif /* SERIAL_CAN_DEBUG */
|
||||
if (engineConfiguration->verboseIsoTp) {
|
||||
PRINT("*** INFO: sendDataTimeout %d" PRINT_EOL, numBytes);
|
||||
}
|
||||
|
||||
if (numBytes < 1)
|
||||
return 0;
|
||||
|
@ -277,9 +277,9 @@ can_msg_t CanStreamerState::streamAddToTxTimeout(size_t *np, const uint8_t *txbu
|
|||
int numBytes = *np;
|
||||
int offset = 0;
|
||||
|
||||
#ifdef SERIAL_CAN_DEBUG
|
||||
PRINT("*** INFO: streamAddToTxTimeout adding %d, in buffer %d" PRINT_EOL, numBytes, txFifoBuf.getCount());
|
||||
#endif /* SERIAL_CAN_DEBUG */
|
||||
if (engineConfiguration->verboseIsoTp) {
|
||||
PRINT("*** INFO: streamAddToTxTimeout adding %d, in buffer %d" PRINT_EOL, numBytes, txFifoBuf.getCount());
|
||||
}
|
||||
|
||||
// we send here only if the TX FIFO buffer is getting overflowed
|
||||
while (numBytes >= txFifoBuf.getSize() - txFifoBuf.getCount()) {
|
||||
|
@ -287,9 +287,9 @@ can_msg_t CanStreamerState::streamAddToTxTimeout(size_t *np, const uint8_t *txbu
|
|||
txFifoBuf.put(txbuf + offset, numBytesToAdd);
|
||||
int numSent = sendDataTimeout((const uint8_t *)txFifoBuf.getElements(), txFifoBuf.getCount(), timeout);
|
||||
|
||||
#ifdef SERIAL_CAN_DEBUG
|
||||
PRINT("*** INFO: streamAddToTxTimeout numBytesToAdd %d / numSent %d / numBytes %d" PRINT_EOL, numBytesToAdd, numSent, numBytes);
|
||||
#endif /* SERIAL_CAN_DEBUG */
|
||||
if (engineConfiguration->verboseIsoTp) {
|
||||
PRINT("*** INFO: streamAddToTxTimeout numBytesToAdd %d / numSent %d / numBytes %d" PRINT_EOL, numBytesToAdd, numSent, numBytes);
|
||||
}
|
||||
|
||||
if (numSent < 1)
|
||||
break;
|
||||
|
@ -298,17 +298,17 @@ can_msg_t CanStreamerState::streamAddToTxTimeout(size_t *np, const uint8_t *txbu
|
|||
numBytes -= numBytesToAdd;
|
||||
}
|
||||
|
||||
#ifdef SERIAL_CAN_DEBUG
|
||||
PRINT("*** INFO: streamAddToTxTimeout remaining goes to buffer %d" PRINT_EOL, numBytes);
|
||||
#endif /* SERIAL_CAN_DEBUG */
|
||||
if (engineConfiguration->verboseIsoTp) {
|
||||
PRINT("*** INFO: streamAddToTxTimeout remaining goes to buffer %d" PRINT_EOL, numBytes);
|
||||
}
|
||||
|
||||
// now we put the rest on hold
|
||||
txFifoBuf.put(txbuf + offset, numBytes);
|
||||
|
||||
|
||||
#ifdef SERIAL_CAN_DEBUG
|
||||
PRINT("*** INFO: in buffer %d" PRINT_EOL, txFifoBuf.getCount());
|
||||
#endif /* SERIAL_CAN_DEBUG */
|
||||
if (engineConfiguration->verboseIsoTp) {
|
||||
PRINT("*** INFO: in buffer %d" PRINT_EOL, txFifoBuf.getCount());
|
||||
}
|
||||
|
||||
return CAN_MSG_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue