|
rusEFI
The most advanced open source ECU
|
#include <isotp.h>


Public Member Functions | |
| CanStreamerState (ICanTransmitter *p_txTransport, ICanReceiver *p_rxTransport, size_t p_busIndex, uint32_t p_rxFrameId, uint32_t p_txFrameId) | |
| void | reset () |
| int | sendFrame (const IsoTpFrameHeader &header, const uint8_t *data, int num, can_sysinterval_t timeout) |
| int | receiveFrame (const CANRxFrame &rxmsg, uint8_t *buf, int num, can_sysinterval_t timeout) |
| int | getDataFromFifo (uint8_t *rxbuf, size_t &numBytes) |
| int | sendDataTimeout (const uint8_t *txbuf, int numBytes, can_sysinterval_t timeout) |
| can_msg_t | streamAddToTxTimeout (size_t *np, const uint8_t *txbuf, can_sysinterval_t timeout) |
| can_msg_t | streamFlushTx (can_sysinterval_t timeout) |
| can_msg_t | streamReceiveTimeout (size_t *np, uint8_t *rxbuf, can_sysinterval_t timeout) |
Public Member Functions inherited from IsoTpBase | |
| IsoTpBase (ICanTransmitter *p_txTransport, size_t p_busIndex, uint32_t p_rxFrameId, uint32_t p_txFrameId) | |
| int | sendFrame (const IsoTpFrameHeader &header, const uint8_t *data, int num, can_sysinterval_t timeout) |
| can_msg_t | transmit (CanTxMessage &ctfp, can_sysinterval_t timeout) |
Data Fields | |
| fifo_buffer< uint8_t, CAN_FIFO_BUF_SIZE > | rxFifoBuf |
| fifo_buffer< uint8_t, CAN_FIFO_BUF_SIZE > | txFifoBuf |
| int | waitingForNumBytes = 0 |
| int | waitingForFrameIndex = 0 |
| ICanReceiver * | rxTransport |
| bool | isComplete {} |
Data Fields inherited from IsoTpBase | |
| size_t | isoHeaderByteIndex = 0 |
| ICanTransmitter * | txTransport |
| size_t | busIndex |
| uint32_t | rxFrameId |
| uint32_t | txFrameId |
|
inline |
Definition at line 152 of file isotp.h.
| int CanStreamerState::getDataFromFifo | ( | uint8_t * | rxbuf, |
| size_t & | numBytes | ||
| ) |
Definition at line 253 of file isotp.cpp.
Referenced by streamReceiveTimeout().

| int CanStreamerState::receiveFrame | ( | const CANRxFrame & | rxmsg, |
| uint8_t * | buf, | ||
| int | num, | ||
| can_sysinterval_t | timeout | ||
| ) |
performance optimization specific to TS over CAN tunnelling TODO: refactor into child class if we ever choose to revive this logic #if defined(TS_CAN_DEVICE_SHORT_PACKETS_IN_ONE_FRAME) if (frameType == ISO_TP_FRAME_SINGLE) { restore the CRC on the whole packet uint32_t crc = crc32((void *) srcBuf, numBytesAvailable); we need a separate buffer for crc because srcBuf may not be word-aligned for direct copy uint8_t crcBuffer[sizeof(uint32_t)]; (uint32_t *) (crcBuffer) = SWAP_UINT32(crc);
now set the packet size (uint16_t *) shortCrcPacketStagingArea = SWAP_UINT16(numBytesAvailable); copy the data if (numBytesAvailable > 0) memcpy(shortCrcPacketStagingArea + sizeof(uint16_t), srcBuf, numBytesAvailable); copy the crc to the end memcpy(shortCrcPacketStagingArea + sizeof(uint16_t) + numBytesAvailable, crcBuffer, sizeof(crcBuffer));
use the reconstructed tmp buffer as a source buffer srcBuf = shortCrcPacketStagingArea; we added the 16-bit size & 32-bit crc bytes numBytesAvailable += sizeof(uint16_t) + sizeof(crcBuffer); } #endif
Definition at line 64 of file isotp.cpp.
Referenced by sendDataTimeout(), and streamReceiveTimeout().


| void CanStreamerState::reset | ( | ) |
| int CanStreamerState::sendDataTimeout | ( | const uint8_t * | txbuf, |
| int | numBytes, | ||
| can_sysinterval_t | timeout | ||
| ) |
Definition at line 167 of file isotp.cpp.
Referenced by streamAddToTxTimeout(), and streamFlushTx().


| int CanStreamerState::sendFrame | ( | const IsoTpFrameHeader & | header, |
| const uint8_t * | data, | ||
| int | num, | ||
| can_sysinterval_t | timeout | ||
| ) |
| can_msg_t CanStreamerState::streamAddToTxTimeout | ( | size_t * | np, |
| const uint8_t * | txbuf, | ||
| can_sysinterval_t | timeout | ||
| ) |
Definition at line 266 of file isotp.cpp.
Referenced by canStreamAddToTxTimeout().


| can_msg_t CanStreamerState::streamFlushTx | ( | can_sysinterval_t | timeout | ) |
Definition at line 306 of file isotp.cpp.

| can_msg_t CanStreamerState::streamReceiveTimeout | ( | size_t * | np, |
| uint8_t * | rxbuf, | ||
| can_sysinterval_t | timeout | ||
| ) |
Definition at line 316 of file isotp.cpp.

| bool CanStreamerState::isComplete {} |
| fifo_buffer<uint8_t, CAN_FIFO_BUF_SIZE> CanStreamerState::rxFifoBuf |
Definition at line 136 of file isotp.h.
Referenced by getDataFromFifo(), and receiveFrame().
| ICanReceiver* CanStreamerState::rxTransport |
Definition at line 149 of file isotp.h.
Referenced by receiveFrame(), sendDataTimeout(), and streamReceiveTimeout().
| fifo_buffer<uint8_t, CAN_FIFO_BUF_SIZE> CanStreamerState::txFifoBuf |
Definition at line 137 of file isotp.h.
Referenced by streamAddToTxTimeout(), and streamFlushTx().
| int CanStreamerState::waitingForFrameIndex = 0 |
Definition at line 147 of file isotp.h.
Referenced by receiveFrame(), and reset().
| int CanStreamerState::waitingForNumBytes = 0 |
Definition at line 146 of file isotp.h.
Referenced by receiveFrame(), and reset().