rusEFI
The most advanced open source ECU
|
#include <tunerstudio_io.h>
Public Member Functions | |
TsChannelBase (const char *name) | |
virtual void | write (const uint8_t *buffer, size_t size, bool isEndOfPacket=false)=0 |
virtual size_t | readTimeout (uint8_t *buffer, size_t size, int timeout)=0 |
virtual void | flush () |
virtual bool | isConfigured () const |
virtual bool | isReady () const |
virtual void | stop () |
size_t | read (uint8_t *buffer, size_t size) |
virtual void | writeCrcPacket (uint8_t responseCode, const uint8_t *buf, size_t size, bool allowLongPackets=false) |
void | sendResponse (ts_response_format_e mode, const uint8_t *buffer, int size, bool allowLongPackets=false) |
void | assertPacketSize (size_t size, bool allowLongPackets) |
uint32_t | writePacketHeader (const uint8_t responseCode, const size_t size) |
void | crcAndWriteBuffer (const uint8_t responseCode, const size_t size) |
void | copyAndWriteSmallCrcPacket (uint8_t responseCode, const uint8_t *buf, size_t size) |
void | writeCrcResponse (uint8_t responseCode) |
Data Fields | |
int | bytesIn = 0 |
int | bytesOut = 0 |
char | scratchBuffer [scratchBuffer_SIZE+30] |
page1_s | page1 |
const char * | name |
bool | in_sync = false |
Private Member Functions | |
bool | isBigPacket (size_t size) |
void | writeCrcPacketLarge (uint8_t responseCode, const uint8_t *buf, size_t size) |
Definition at line 30 of file tunerstudio_io.h.
TsChannelBase::TsChannelBase | ( | const char * | name | ) |
Definition at line 91 of file tunerstudio_io.cpp.
Definition at line 95 of file tunerstudio_io.cpp.
Referenced by TunerStudio::cmdOutputChannels(), and writeCrcPacket().
void TsChannelBase::copyAndWriteSmallCrcPacket | ( | uint8_t | responseCode, |
const uint8_t * | buf, | ||
size_t | size | ||
) |
Definition at line 26 of file tunerstudio_io.cpp.
Referenced by writeCrcPacket().
void TsChannelBase::crcAndWriteBuffer | ( | const uint8_t | responseCode, |
const size_t | size | ||
) |
Definition at line 41 of file tunerstudio_io.cpp.
Referenced by TunerStudio::cmdOutputChannels(), and copyAndWriteSmallCrcPacket().
|
inlinevirtual |
Definition at line 38 of file tunerstudio_io.h.
Referenced by crcAndWriteBuffer(), TunerStudio::handlePlainCommand(), TunerStudio::handleScatteredReadCommand(), handleTestCommand(), sendResponse(), and writeCrcPacketLarge().
Definition at line 22 of file tunerstudio_io.cpp.
Referenced by assertPacketSize(), copyAndWriteSmallCrcPacket(), crcAndWriteBuffer(), and writeCrcPacket().
|
inlinevirtual |
Definition at line 39 of file tunerstudio_io.h.
|
inlinevirtual |
Definition at line 40 of file tunerstudio_io.h.
Referenced by tsProcessOne().
Definition at line 17 of file tunerstudio_io.cpp.
|
pure virtual |
Implemented in SerialTsChannel, UartTsChannel, and UartDmaTsChannel.
Referenced by bluetoothSoftwareDisconnectNotify(), btReadLine(), read(), and tsProcessOne().
void TsChannelBase::sendResponse | ( | ts_response_format_e | mode, |
const uint8_t * | buffer, | ||
int | size, | ||
bool | allowLongPackets = false |
||
) |
Definition at line 121 of file tunerstudio_io.cpp.
Referenced by TunerStudio::handleCrc32Check(), TunerStudio::handleCrcCommand(), handleGetConfigErorr(), handleGetVersion(), TunerStudio::handlePageReadCommand(), TunerStudio::handleQueryCommand(), and sendOkResponse().
|
inlinevirtual |
Reimplemented in SerialTsChannel, and UartTsChannel.
Definition at line 41 of file tunerstudio_io.h.
Referenced by findBaudIndex(), and runCommands().
|
pure virtual |
Implemented in SerialTsChannel, and UartTsChannel.
Referenced by btWrite(), crcAndWriteBuffer(), TunerStudio::handlePlainCommand(), TunerStudio::handleScatteredReadCommand(), handleTestCommand(), sendResponse(), writeCrcPacketLarge(), and writePacketHeader().
|
virtual |
Adds size to the beginning of a packet and a crc32 at the end. Then send the packet.
Definition at line 104 of file tunerstudio_io.cpp.
Referenced by handleGetText(), and sendResponse().
|
private |
Definition at line 72 of file tunerstudio_io.cpp.
Referenced by writeCrcPacket(), and writeCrcResponse().
|
inline |
Definition at line 76 of file tunerstudio_io.h.
Referenced by handleBurnCommand(), TunerStudio::handleExecuteCommand(), and sendErrorCode().
uint32_t TsChannelBase::writePacketHeader | ( | const uint8_t | responseCode, |
const size_t | size | ||
) |
Definition at line 61 of file tunerstudio_io.cpp.
Referenced by TunerStudio::handleScatteredReadCommand(), and writeCrcPacketLarge().
int TsChannelBase::bytesIn = 0 |
Definition at line 46 of file tunerstudio_io.h.
Referenced by SerialTsChannel::readTimeout(), UartTsChannel::readTimeout(), and UartDmaTsChannel::readTimeout().
int TsChannelBase::bytesOut = 0 |
Definition at line 47 of file tunerstudio_io.h.
Referenced by SerialTsChannel::write(), and UartTsChannel::write().
bool TsChannelBase::in_sync = false |
Definition at line 90 of file tunerstudio_io.h.
Referenced by tsProcessOne().
const char* TsChannelBase::name |
Definition at line 68 of file tunerstudio_io.h.
Referenced by TsChannelBase(), tsProcessOne(), and tunerStudioDebug().
page1_s TsChannelBase::page1 |
Definition at line 66 of file tunerstudio_io.h.
Referenced by getWorkingPageAddr(), and TunerStudio::handleScatteredReadCommand().
char TsChannelBase::scratchBuffer[scratchBuffer_SIZE+30] |
See 'blockingFactor' in rusefi.ini
Definition at line 64 of file tunerstudio_io.h.
Referenced by TunerStudio::cmdOutputChannels(), copyAndWriteSmallCrcPacket(), crcAndWriteBuffer(), TunerStudio::handlePageReadCommand(), isBigPacket(), and tsProcessOne().