rusEFI
The most advanced open source ECU
|
Binary protocol implementation.
This implementation would not happen without the documentation provided by Jon Zeeff (jon@z.nosp@m.eeff.nosp@m..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) |
bool | wasPresetJustApplied () |
void | onApplyPreset () |
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 () |
Variables | |
TunerStudio | tsInstance |
tunerstudio_counters_s | tsState |
CommandHandler | console_line_callback |
uint8_t * getWorkingPageAddr | ( | ) |
Definition at line 153 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrc32Check(), TunerStudio::handlePageReadCommand(), and TunerStudio::handleWriteChunkCommand().
|
static |
'Burn' command is a command to commit the changes
Definition at line 363 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand().
|
static |
Definition at line 659 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand().
|
static |
Definition at line 652 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 408 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand(), and TunerStudio::handlePlainCommand().
Definition at line 383 of file tunerstudio.cpp.
Referenced by tsProcessOne().
void onApplyPreset | ( | ) |
Definition at line 200 of file tunerstudio.cpp.
Referenced by applyPreset().
|
static |
Definition at line 92 of file tunerstudio.cpp.
Referenced by printTsStats(), and tunerStudioError().
|
static |
Definition at line 103 of file tunerstudio.cpp.
Referenced by printTsStats().
|
static |
Definition at line 127 of file tunerstudio.cpp.
Referenced by setTsSpeed(), and startTunerStudioConnectivity().
void requestBurn | ( | ) |
Definition at line 348 of file tunerstudio.cpp.
Referenced by configureRusefiLuaHooks(), handleBurnCommand(), initFlash(), and unlockEcu().
|
static |
Definition at line 123 of file tunerstudio.cpp.
Referenced by startTunerStudioConnectivity().
void sendErrorCode | ( | TsChannelBase * | tsChannel, |
uint8_t | code, | ||
const char * | msg | ||
) |
Definition at line 161 of file tunerstudio.cpp.
Referenced by tsProcessOne(), and validateOffsetCount().
|
static |
Definition at line 157 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand(), and TunerStudio::handleWriteChunkCommand().
|
static |
Definition at line 142 of file tunerstudio.cpp.
Referenced by startTunerStudioConnectivity().
void startTunerStudioConnectivity | ( | ) |
Definition at line 910 of file tunerstudio.cpp.
Referenced by runRusEfi().
|
static |
Definition at line 487 of file tunerstudio.cpp.
Referenced by TunerstudioThread::ThreadTask().
void tunerStudioDebug | ( | TsChannelBase * | tsChannel, |
const char * | msg | ||
) |
Definition at line 147 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrcCommand(), TunerStudio::handlePlainCommand(), handleTestCommand(), and tunerStudioError().
void tunerStudioError | ( | TsChannelBase * | tsChannel, |
const char * | msg | ||
) |
Definition at line 640 of file tunerstudio.cpp.
Referenced by TunerStudio::handleCrc32Check(), TunerStudio::handleCrcCommand(), TunerStudio::handlePageReadCommand(), TunerStudio::handleWriteChunkCommand(), 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(), and TunerStudio::handleWriteChunkCommand().
bool wasPresetJustApplied | ( | ) |
Definition at line 196 of file tunerstudio.cpp.
Referenced by handleBurnCommand(), TunerStudio::handleWriteChunkCommand(), and updateTunerStudioState().
|
extern |
Definition at line 53 of file console_io.cpp.
Referenced by TunerStudio::handleExecuteCommand(), and startConsole().
TunerStudio tsInstance |
Definition at line 485 of file tunerstudio.cpp.
Referenced by tsProcessOne().
tunerstudio_counters_s tsState |
Definition at line 638 of file tunerstudio.cpp.
Referenced by TunerStudio::cmdOutputChannels(), handleBurnCommand(), TunerStudio::handleCrc32Check(), handleGetText(), TunerStudio::handlePageReadCommand(), TunerStudio::handleQueryCommand(), handleTestCommand(), TunerStudio::handleWriteChunkCommand(), printErrorCounters(), resetTs(), sendErrorCode(), startTunerStudioConnectivity(), tsProcessOne(), and tunerStudioError().