rusEFI
The most advanced open source ECU
|
Binary protocol implementation.
This implementation would not happen without the documentation provided by Jon Zeeff (jon@z) eeff .com
Integration with EFI Analytics Tuner Studio software
Tuner Studio has a really simple protocol, a minimal implementation capable of displaying current engine state on the gauges would require only two commands: queryCommand and ochGetCommand
queryCommand: Communication initialization command. TunerStudio sends a single byte H ECU response: One of the known ECU id strings.
ochGetCommand: Request for output channels state.TunerStudio sends a single byte O ECU response: A snapshot of output channels as described in [OutputChannels] section of the .ini file The length of this block is 'ochBlockSize' property of the .ini file
These two commands are enough to get working gauges. In order to start configuring the ECU using tuner studio, three more commands should be implemented:
This file is part of rusEfi - see http://rusefi.com
rusEfi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
This file is part of rusEfi - see http://rusefi.com
rusEfi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file tunerstudio.cpp.
Functions | |
static void | printErrorCounters () |
static void | printScatterList () |
static void | resetTs () |
static void | printTsStats (void) |
static void | setTsSpeed (int value) |
void | tunerStudioDebug (TsChannelBase *tsChannel, const char *msg) |
uint8_t * | getWorkingPageAddr () |
static void | sendOkResponse (TsChannelBase *tsChannel) |
void | sendErrorCode (TsChannelBase *tsChannel, uint8_t code, const char *msg) |
bool | validateOffsetCount (size_t offset, size_t count, TsChannelBase *tsChannel) |
void | requestBurn () |
static void | handleBurnCommand (TsChannelBase *tsChannel) |
static bool | isKnownCommand (char command) |
static void | handleTestCommand (TsChannelBase *tsChannel) |
static int | tsProcessOne (TsChannelBase *tsChannel) |
void | tunerStudioError (TsChannelBase *tsChannel, const char *msg) |
static void | handleGetVersion (TsChannelBase *tsChannel) |
static void | handleGetText (TsChannelBase *tsChannel) |
void | startTunerStudioConnectivity (void) |
Variables | |
bool | rebootForPresetPending |
TunerStudio | tsInstance |
tunerstudio_counters_s | tsState |
CommandHandler | console_line_callback |
uint8_t* getWorkingPageAddr | ( | ) |
Definition at line 154 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrc32Check(), TunerStudio::handlePageReadCommand(), TunerStudio::handleWriteChunkCommand(), and TunerStudio::handleWriteValueCommand().
|
static |
'Burn' command is a command to commit the changes
Definition at line 383 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand().
|
static |
Definition at line 683 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand().
|
static |
Definition at line 676 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand().
|
static |
rusEfi own test command
this is NOT a standard TunerStudio command, this is my own extension of the protocol to simplify troubleshooting
Definition at line 432 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand(), and TunerStudio::handlePlainCommand().
|
static |
Definition at line 403 of file tunerstudio.cpp.
Referenced by tsProcessOne().
|
static |
Definition at line 93 of file tunerstudio.cpp.
Referenced by printTsStats(), and tunerStudioError().
|
static |
Definition at line 104 of file tunerstudio.cpp.
Referenced by printTsStats().
|
static |
Definition at line 128 of file tunerstudio.cpp.
Referenced by setTsSpeed(), and startTunerStudioConnectivity().
void requestBurn | ( | ) |
Definition at line 368 of file tunerstudio.cpp.
Referenced by configureRusefiLuaHooks(), handleBurnCommand(), initFlash(), and unlockEcu().
|
static |
Definition at line 124 of file tunerstudio.cpp.
Referenced by startTunerStudioConnectivity().
void sendErrorCode | ( | TsChannelBase * | tsChannel, |
uint8_t | code, | ||
const char * | msg | ||
) |
Definition at line 162 of file tunerstudio.cpp.
Referenced by tsProcessOne(), and validateOffsetCount().
|
static |
Definition at line 158 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand(), TunerStudio::handlePageSelectCommand(), and TunerStudio::handleWriteChunkCommand().
|
static |
Definition at line 143 of file tunerstudio.cpp.
Referenced by startTunerStudioConnectivity().
void startTunerStudioConnectivity | ( | void | ) |
Definition at line 936 of file tunerstudio.cpp.
Referenced by runRusEfi().
|
static |
Definition at line 511 of file tunerstudio.cpp.
Referenced by TunerstudioThread::ThreadTask().
void tunerStudioDebug | ( | TsChannelBase * | tsChannel, |
const char * | msg | ||
) |
Definition at line 148 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand(), TunerStudio::handlePlainCommand(), handleTestCommand(), and tunerStudioError().
void tunerStudioError | ( | TsChannelBase * | tsChannel, |
const char * | msg | ||
) |
Definition at line 664 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand(), tsProcessOne(), and validateOffsetCount().
bool validateOffsetCount | ( | size_t | offset, |
size_t | count, | ||
TsChannelBase * | tsChannel | ||
) |
Definition at line 19 of file tunerstudio_commands.cpp.
Referenced by TunerStudio::handleCrc32Check(), TunerStudio::handlePageReadCommand(), TunerStudio::handleWriteChunkCommand(), and TunerStudio::handleWriteValueCommand().
|
extern |
Definition at line 53 of file console_io.cpp.
Referenced by TunerStudio::handleExecuteCommand(), and startConsole().
|
extern |
Definition at line 34 of file tunerstudio_commands.cpp.
Referenced by handleBurnCommand(), TunerStudio::handlePageReadCommand(), TunerStudio::handleWriteChunkCommand(), and TunerStudio::handleWriteValueCommand().
TunerStudio tsInstance |
Definition at line 509 of file tunerstudio.cpp.
Referenced by tsProcessOne().
tunerstudio_counters_s tsState |
Definition at line 662 of file tunerstudio.cpp.
Referenced by TunerStudio::cmdOutputChannels(), handleBurnCommand(), TunerStudio::handleCrc32Check(), handleGetText(), TunerStudio::handlePageReadCommand(), TunerStudio::handlePageSelectCommand(), TunerStudio::handleQueryCommand(), handleTestCommand(), TunerStudio::handleWriteChunkCommand(), TunerStudio::handleWriteValueCommand(), printErrorCounters(), resetTs(), sendErrorCode(), startTunerStudioConnectivity(), tsProcessOne(), and tunerStudioError().