rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions
TunerStudio Class Reference

#include <tunerstudio_impl.h>

Inheritance diagram for TunerStudio:
Inheritance graph
[legend]
Collaboration diagram for TunerStudio:
Collaboration graph
[legend]

Public Member Functions

int handleCrcCommand (TsChannelBase *tsChannel, char *data, int incomingPacketSize)
 
bool handlePlainCommand (TsChannelBase *tsChannel, uint8_t command)
 
void cmdOutputChannels (TsChannelBase *tsChannel, uint16_t offset, uint16_t count) override
 'Output' command sends out a snapshot of current values Gauges refresh
 
void handleQueryCommand (TsChannelBase *tsChannel, ts_response_format_e mode)
 
void handleExecuteCommand (TsChannelBase *tsChannel, char *data, int incomingPacketSize)
 
void handleWriteChunkCommand (TsChannelBase *tsChannel, uint16_t page, uint16_t offset, uint16_t count, void *content)
 
void handleCrc32Check (TsChannelBase *tsChannel, uint16_t page, uint16_t offset, uint16_t count)
 
void handlePageReadCommand (TsChannelBase *tsChannel, uint16_t page, uint16_t offset, uint16_t count)
 
void handleScatteredReadCommand (TsChannelBase *tsChannel)
 

Private Member Functions

void sendErrorCode (TsChannelBase *tsChannel, uint8_t code, const char *msg="")
 

Additional Inherited Members

Detailed Description

Definition at line 23 of file tunerstudio_impl.h.

Member Function Documentation

◆ cmdOutputChannels()

void TunerStudio::cmdOutputChannels ( TsChannelBase tsChannel,
uint16_t  offset,
uint16_t  count 
)
overridevirtual

'Output' command sends out a snapshot of current values Gauges refresh

collect data from all models

collect data from all models

Implements TunerStudioBase.

Definition at line 23 of file tunerstudio_commands.cpp.

23 {
24 if (offset + count > TS_TOTAL_OUTPUT_SIZE) {
25 efiPrintf("TS: Version Mismatch? Too much outputs requested offset=%d + count=%d/total=%d", offset, count,
26 TS_TOTAL_OUTPUT_SIZE);
27 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, "cmd_size");
28 return;
29 }
30
31 if (offset < BLOCKING_FACTOR) {
34 }
35
38 // this method is invoked too often to print any debug information
39 uint8_t * scratchBuffer = (uint8_t *)tsChannel->scratchBuffer;
40 /**
41 * collect data from all models
42 */
43 FragmentList list = getLiveDataFragments();
44
45 uint32_t crc = tsChannel->writePacketHeader(TS_RESPONSE_OK, count);
46
47 while (count) {
48 size_t chunkSize = minI(count, sizeof(tsChannel->scratchBuffer));
49 /**
50 * collect data from all models
51 */
52 size_t actualSize = copyRange(scratchBuffer, list, offset, chunkSize);
53 crc = tsChannel->writePacketBody(scratchBuffer, actualSize, crc);
54
55 count -= chunkSize;
56 offset += chunkSize;
57 }
58
59 tsChannel->writeCrcPacketTail(crc);
60}
TunerStudioOutputChannels outputChannels
Definition engine.h:113
char scratchBuffer[scratchBuffer_SIZE+30]
uint32_t writePacketHeader(const uint8_t responseCode, const size_t size)
uint32_t writePacketBody(const uint8_t *buf, const size_t size, uint32_t crc)
void writeCrcPacketTail(uint32_t crc)
void sendErrorCode(TsChannelBase *tsChannel, uint8_t code, const char *msg="")
static EngineAccessor engine
Definition engine.h:415
FragmentList getLiveDataFragments()
tunerstudio_counters_s tsState
void updateTunerStudioState()
uint16_t offset
Definition tunerstudio.h:0
uint16_t count
Definition tunerstudio.h:1
static Timer channelsRequestTimer

Referenced by handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleCrc32Check()

void TunerStudio::handleCrc32Check ( TsChannelBase tsChannel,
uint16_t  page,
uint16_t  offset,
uint16_t  count 
)

Definition at line 356 of file tunerstudio.cpp.

356 {
358
359 // Ensure we are reading from in bounds
361 tunerStudioError(tsChannel, "ERROR: CRC out of range");
362 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE);
363 return;
364 }
365
366 const uint8_t* start = getWorkingPageAddr(tsChannel, page, offset);
367 if (start == nullptr) {
368 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, "ERROR: CRC invalid page");
369 return;
370 }
371
372 uint32_t crc = SWAP_UINT32(crc32(start, count));
373 tsChannel->sendResponse(TS_CRC, (const uint8_t *) &crc, 4);
374 // todo: rename to onConfigCrc?
376}
static void onConfigOnStartUpOrBurn(bool isRunningOnBurn)
void sendResponse(ts_response_format_e mode, const uint8_t *buffer, int size, bool allowLongPackets=false)
uint32_t SWAP_UINT32(uint32_t x)
Definition efilib.h:27
static bool validateOffsetCount(size_t page, size_t offset, size_t count)
static uint8_t * getWorkingPageAddr(TsChannelBase *tsChannel, size_t page, size_t offset)
void tunerStudioError(TsChannelBase *tsChannel, const char *msg)
uint16_t page
Definition tunerstudio.h:0
@ TS_CRC

Referenced by handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleCrcCommand()

int TunerStudio::handleCrcCommand ( TsChannelBase tsChannel,
char data,
int  incomingPacketSize 
)

Definition at line 814 of file tunerstudio.cpp.

814 {
816
817 char command = data[0];
818 data++;
819
820 const uint16_t* data16 = reinterpret_cast<uint16_t*>(data);
821
822 // only few command have page argument, default page is 0
823 uint16_t page = 0;
824 uint16_t offset = 0;
825 uint16_t count = 0;
826
827 // command may not have offset field - keep safe default value
828 // not used by .ini at the moment TODO actually use that version of the command in the .ini
829 if (incomingPacketSize >= 3) {
830 offset = data16[0];
831 }
832 // command may not have count/size filed - keep safe default value
833 if (incomingPacketSize >= 5) {
834 count = data16[1];
835 }
836
837 switch(command)
838 {
839 case TS_OUTPUT_COMMAND:
840 if (incomingPacketSize == 1) {
841 // Read command with no offset and size - read whole livedata
842 count = TS_TOTAL_OUTPUT_SIZE;
843 }
844 cmdOutputChannels(tsChannel, offset, count);
845 break;
846 case TS_OUTPUT_ALL_COMMAND:
847 offset = 0;
848 count = TS_TOTAL_OUTPUT_SIZE;
849 // TS will not use this command until ochBlockSize is bigger than blockingFactor and prefer ochGetCommand :(
850 cmdOutputChannels(tsChannel, offset, count);
851 break;
852 case TS_GET_SCATTERED_GET_COMMAND:
853#if EFI_TS_SCATTER
855#else
856 criticalError("Slow/wireless mode not supported");
857#endif // EFI_TS_SCATTER
858 break;
859 case TS_HELLO_COMMAND:
860 handleQueryCommand(tsChannel, TS_CRC);
861 break;
862 case TS_GET_FIRMWARE_VERSION:
863 handleGetVersion(tsChannel);
864 break;
865#if EFI_TEXT_LOGGING
866 case TS_GET_TEXT:
867 handleGetText(tsChannel);
868 break;
869#endif // EFI_TEXT_LOGGING
870 case TS_EXECUTE:
871 handleExecuteCommand(tsChannel, data, incomingPacketSize - 1);
872 break;
873 case TS_CHUNK_WRITE_COMMAND:
874 /* command with page argument */
875 page = data16[0];
876 offset = data16[1];
877 count = data16[2];
879 break;
880 case TS_CRC_CHECK_COMMAND:
881 /* command with page argument */
882 page = data16[0];
883 offset = data16[1];
884 count = data16[2];
885 handleCrc32Check(tsChannel, page, offset, count);
886 break;
887 case TS_BURN_COMMAND:
888 /* command with page argument */
889 page = data16[0];
890 handleBurnCommand(tsChannel, page);
891 break;
892 case TS_READ_COMMAND:
893 /* command with page argument */
894 page = data16[0];
895 offset = data16[1];
896 count = data16[2];
898 break;
899 case TS_TEST_COMMAND:
900 [[fallthrough]];
901 case 'T':
902 handleTestCommand(tsChannel);
903 break;
904 case TS_GET_CONFIG_ERROR:
905 handleGetConfigErorr(tsChannel);
906 break;
907#if EFI_SIMULATOR
908 case TS_SIMULATE_CAN:
909 void handleWrapCan(TsChannelBase* tsChannel, char *data, int incomingPacketSize);
910 handleWrapCan(tsChannel, data, incomingPacketSize - 1);
911 break;
912#endif // EFI_SIMULATOR
913 case TS_IO_TEST_COMMAND:
914#if EFI_SIMULATOR || EFI_PROD_CODE
915 //TODO: Why did we process `TS_IO_TEST_COMMAND` only in prod code? I've just turned it on for simulator as well, because
916 // I need test this functionality with simulator as well. We need to review the cases when we really need to turn off
917 // `TS_IO_TEST_COMMAND` processing. Do we really need guards below?
918 {
919 uint16_t subsystem = SWAP_UINT16(data16[0]);
920 uint16_t index = SWAP_UINT16(data16[1]);
921
922 executeTSCommand(subsystem, index);
923 }
924#endif /* EFI_SIMULATOR || EFI_PROD_CODE */
925 sendOkResponse(tsChannel);
926 break;
927#if EFI_TOOTH_LOGGER
928 case TS_SET_LOGGER_SWITCH:
929 switch(data[0]) {
930 case TS_COMPOSITE_ENABLE:
932 break;
933 case TS_COMPOSITE_DISABLE:
935 break;
936 case TS_COMPOSITE_READ:
937 {
938 auto toothBuffer = GetToothLoggerBufferNonblocking();
939
940 if (toothBuffer) {
941 tsChannel->sendResponse(TS_CRC, reinterpret_cast<const uint8_t*>(toothBuffer->buffer), toothBuffer->nextIdx * sizeof(composite_logger_s), true);
942
943 ReturnToothLoggerBuffer(toothBuffer);
944 } else {
945 // TS asked for a tooth logger buffer, but we don't have one to give it.
946 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, DO_NOT_LOG);
947 }
948 }
949 break;
950#ifdef TRIGGER_SCOPE
951 case TS_TRIGGER_SCOPE_ENABLE:
953 break;
954 case TS_TRIGGER_SCOPE_DISABLE:
956 break;
957 case TS_TRIGGER_SCOPE_READ:
958 {
959 const auto& buffer = triggerScopeGetBuffer();
960
961 if (buffer) {
962 tsChannel->sendResponse(TS_CRC, buffer.get<uint8_t>(), buffer.size(), true);
963 } else {
964 // TS asked for a tooth logger buffer, but we don't have one to give it.
965 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, DO_NOT_LOG);
966 }
967 }
968 break;
969#endif // TRIGGER_SCOPE
970 default:
971 // dunno what that was, send NAK
972 return false;
973 }
974
975 sendOkResponse(tsChannel);
976
977 break;
978 case TS_GET_COMPOSITE_BUFFER_DONE_DIFFERENTLY:
979 {
981
982 auto toothBuffer = GetToothLoggerBufferNonblocking();
983
984 if (toothBuffer) {
985 tsChannel->sendResponse(TS_CRC, reinterpret_cast<const uint8_t*>(toothBuffer->buffer), toothBuffer->nextIdx * sizeof(composite_logger_s), true);
986
987 ReturnToothLoggerBuffer(toothBuffer);
988 } else {
989 // TS asked for a tooth logger buffer, but we don't have one to give it.
990 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, DO_NOT_LOG);
991 }
992 }
993
994 break;
995#else // EFI_TOOTH_LOGGER
996 case TS_GET_COMPOSITE_BUFFER_DONE_DIFFERENTLY:
997 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, DO_NOT_LOG);
998 break;
999#endif /* EFI_TOOTH_LOGGER */
1000#if ENABLE_PERF_TRACE
1001 case TS_PERF_TRACE_BEGIN:
1003 sendOkResponse(tsChannel);
1004 break;
1005 case TS_PERF_TRACE_GET_BUFFER:
1006 {
1007 auto trace = perfTraceGetBuffer();
1008 tsChannel->sendResponse(TS_CRC, trace.get<uint8_t>(), trace.size(), true);
1009 }
1010
1011 break;
1012#else
1013 case TS_PERF_TRACE_BEGIN:
1014 criticalError("TS_PERF_TRACE not supported");
1015 break;
1016 case TS_PERF_TRACE_GET_BUFFER:
1017 criticalError("TS_PERF_TRACE_GET_BUFFER not supported");
1018 break;
1019#endif /* ENABLE_PERF_TRACE */
1020 case TS_QUERY_BOOTLOADER: {
1021 uint8_t bldata = TS_QUERY_BOOTLOADER_NONE;
1022#if EFI_USE_OPENBLT
1023 bldata = TS_QUERY_BOOTLOADER_OPENBLT;
1024#endif
1025
1026 tsChannel->sendResponse(TS_CRC, &bldata, 1, false);
1027 break;
1028 }
1029 default:
1030 sendErrorCode(tsChannel, TS_RESPONSE_UNRECOGNIZED_COMMAND, "unknown_command");
1031static char tsErrorBuff[80];
1032 chsnprintf(tsErrorBuff, sizeof(tsErrorBuff), "ERROR: ignoring unexpected command %d [%c]", command, command);
1033 tunerStudioError(tsChannel, tsErrorBuff);
1034 return false;
1035 }
1036
1037 return true;
1038}
void executeTSCommand(uint16_t subsystem, uint16_t index)
size_t size() const
Definition big_buffer.h:43
const TBuffer * get() const
Definition big_buffer.h:34
void handleScatteredReadCommand(TsChannelBase *tsChannel)
void handleCrc32Check(TsChannelBase *tsChannel, uint16_t page, uint16_t offset, uint16_t count)
void handleQueryCommand(TsChannelBase *tsChannel, ts_response_format_e mode)
void cmdOutputChannels(TsChannelBase *tsChannel, uint16_t offset, uint16_t count) override
'Output' command sends out a snapshot of current values Gauges refresh
void handlePageReadCommand(TsChannelBase *tsChannel, uint16_t page, uint16_t offset, uint16_t count)
void handleWriteChunkCommand(TsChannelBase *tsChannel, uint16_t page, uint16_t offset, uint16_t count, void *content)
void handleExecuteCommand(TsChannelBase *tsChannel, char *data, int incomingPacketSize)
uint16_t SWAP_UINT16(uint16_t x)
Definition efilib.h:22
const BigBufferHandle perfTraceGetBuffer()
void perfTraceEnable()
@ TunerStudioHandleCrcCommand
void DisableToothLogger()
void EnableToothLogger()
CompositeBuffer * GetToothLoggerBufferNonblocking()
void ReturnToothLoggerBuffer(CompositeBuffer *buffer)
void EnableToothLoggerIfNotEnabled()
composite_logger_s
void triggerScopeEnable()
const BigBufferHandle & triggerScopeGetBuffer()
static BigBufferHandle buffer
void triggerScopeDisable()
static void handleGetVersion(TsChannelBase *tsChannel)
static void handleGetConfigErorr(TsChannelBase *tsChannel)
static void handleGetText(TsChannelBase *tsChannel)
static void sendOkResponse(TsChannelBase *tsChannel)
static void handleTestCommand(TsChannelBase *tsChannel)
static void handleBurnCommand(TsChannelBase *tsChannel, uint16_t page)

Referenced by tsProcessOne().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleExecuteCommand()

void TunerStudio::handleExecuteCommand ( TsChannelBase tsChannel,
char data,
int  incomingPacketSize 
)

Definition at line 803 of file tunerstudio.cpp.

803 {
804 data[incomingPacketSize] = 0;
805 char *trimmed = efiTrim(data);
806#if EFI_SIMULATOR
807 logMsg("execute [%s]\r\n", trimmed);
808#endif // EFI_SIMULATOR
809 (console_line_callback)(trimmed);
810
811 tsChannel->writeCrcResponse(TS_RESPONSE_OK);
812}
void writeCrcResponse(uint8_t responseCode)
char * efiTrim(char *param)
Definition efilib.cpp:40
CommandHandler console_line_callback

Referenced by handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handlePageReadCommand()

void TunerStudio::handlePageReadCommand ( TsChannelBase tsChannel,
uint16_t  page,
uint16_t  offset,
uint16_t  count 
)

Definition at line 425 of file tunerstudio.cpp.

425 {
427
429 tunerStudioError(tsChannel, "ERROR: RD out of range");
430 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE);
431 return;
432 }
433
434 uint8_t* addr = getWorkingPageAddr(tsChannel, page, offset);
435 if (page == TS_PAGE_SETTINGS) {
436 if (isLockedFromUser()) {
437 // to have rusEFI console happy just send all zeros within a valid packet
438 addr = (uint8_t*)&tsChannel->scratchBuffer + TS_PACKET_HEADER_SIZE;
439 memset(addr, 0, count);
440 }
441 }
442
443 if (addr == nullptr) {
444 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, "ERROR: RD invalid page");
445 return;
446 }
447
448 tsChannel->sendResponse(TS_CRC, addr, count);
449#if EFI_TUNER_STUDIO_VERBOSE
450// efiPrintf("Sending %d done", count);
451#endif
452}
constexpr uint8_t addr
Definition ads1015.cpp:14
bool isLockedFromUser()
Definition engine2.cpp:311

Referenced by handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handlePlainCommand()

bool TunerStudio::handlePlainCommand ( TsChannelBase tsChannel,
uint8_t  command 
)

handle non CRC wrapped command

Returns
true if legacy command was processed, false otherwise

http://www.msextra.com/forums/viewtopic.php?f=122&t=48327 Response from TS support: This is an optional command * "The F command is used to find what ini. file needs to be loaded in TunerStudio to match the controller. If you are able to just make your firmware ignore the command that would work. Currently on some firmware versions the F command is not used and is just ignored by the firmware as a unknown command."

Definition at line 580 of file tunerstudio.cpp.

580 {
581 // Bail fast if guaranteed not to be a plain command
582 if (command == 0) {
583 return false;
584 } else if (command == TS_HELLO_COMMAND || command == TS_QUERY_COMMAND) {
585 // We interpret 'Q' as TS_HELLO_COMMAND, since TS uses hardcoded 'Q' during ECU detection (scan all serial ports)
586 efiPrintf("Got naked Query command");
587 handleQueryCommand(tsChannel, TS_PLAIN);
588 return true;
589 } else if (command == TS_TEST_COMMAND || command == 'T') {
590 handleTestCommand(tsChannel);
591 return true;
592 } else if (command == TS_COMMAND_F) {
593 /**
594 * http://www.msextra.com/forums/viewtopic.php?f=122&t=48327
595 * Response from TS support: This is an optional command *
596 * "The F command is used to find what ini. file needs to be loaded in TunerStudio to match the controller.
597 * If you are able to just make your firmware ignore the command that would work.
598 * Currently on some firmware versions the F command is not used and is just ignored by the firmware as a unknown command."
599 */
600
601 tunerStudioDebug(tsChannel, "not ignoring F");
602 tsChannel->write((const uint8_t *)TS_PROTOCOL, strlen(TS_PROTOCOL));
603 tsChannel->flush();
604 return true;
605 } else {
606 // This wasn't a valid command
607 return false;
608 }
609}
virtual void flush()
virtual void write(const uint8_t *buffer, size_t size, bool isEndOfPacket=false)=0
void tunerStudioDebug(TsChannelBase *tsChannel, const char *msg)
@ TS_PLAIN

Referenced by tsProcessOne().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleQueryCommand()

void TunerStudio::handleQueryCommand ( TsChannelBase tsChannel,
ts_response_format_e  mode 
)

this command is part of protocol initialization

this command is part of protocol initialization

Query with CRC takes place while re-establishing connection Query without CRC takes place on TunerStudio startup

Definition at line 568 of file tunerstudio.cpp.

568 {
570 const char *signature = getTsSignature();
571
572 tsChannel->sendResponse(mode, (const uint8_t *)signature, strlen(signature) + 1);
573}
const char * getTsSignature()
Definition signature.cpp:31

Referenced by handleCrcCommand(), and handlePlainCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleScatteredReadCommand()

void TunerStudio::handleScatteredReadCommand ( TsChannelBase tsChannel)

Definition at line 379 of file tunerstudio.cpp.

379 {
381
382 int totalResponseSize = 0;
383 for (size_t i = 0; i < TS_SCATTER_OFFSETS_COUNT; i++) {
384 uint16_t packed = tsChannel->page1.highSpeedOffsets[i];
385 uint16_t type = packed >> 13;
386
387 size_t size = type == 0 ? 0 : 1 << (type - 1);
388#if EFI_SIMULATOR
389// printf("handleScatteredReadCommand 0x%x %d %d\n", packed, size, offset);
390#endif /* EFI_SIMULATOR */
391 totalResponseSize += size;
392 }
393#if EFI_SIMULATOR
394// printf("totalResponseSize %d\n", totalResponseSize);
395#endif /* EFI_SIMULATOR */
396
397 // Command part of CRC
398 uint32_t crc = tsChannel->writePacketHeader(TS_RESPONSE_OK, totalResponseSize);
399
400 uint8_t dataBuffer[8];
401 for (size_t i = 0; i < TS_SCATTER_OFFSETS_COUNT; i++) {
402 uint16_t packed = tsChannel->page1.highSpeedOffsets[i];
403 uint16_t type = packed >> 13;
404 uint16_t offset = packed & 0x1FFF;
405
406 if (type == 0)
407 continue;
408 size_t size = 1 << (type - 1);
409
410 // write each data point and CRC incrementally
411 copyRange(dataBuffer, getLiveDataFragments(), offset, size);
412 tsChannel->write(dataBuffer, size, false);
413 crc = crc32inc((void*)dataBuffer, crc, size);
414 }
415#if EFI_SIMULATOR
416// printf("CRC %x\n", crc);
417#endif /* EFI_SIMULATOR */
418 // now write total CRC
419 *(uint32_t*)dataBuffer = SWAP_UINT32(crc);
420 tsChannel->write(dataBuffer, 4, true);
421 tsChannel->flush();
422}
uint16_t highSpeedOffsets[TS_SCATTER_OFFSETS_COUNT]
composite packet size

Referenced by handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleWriteChunkCommand()

void TunerStudio::handleWriteChunkCommand ( TsChannelBase tsChannel,
uint16_t  page,
uint16_t  offset,
uint16_t  count,
void *  content 
)

This command is needed to make the whole transfer a bit faster

Definition at line 305 of file tunerstudio.cpp.

306 {
308
309 efiPrintf("TS -> Page %d write chunk offset %d count %d (output_count=%d)",
311
312
314 tunerStudioError(tsChannel, "ERROR: WR out of range");
315 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE);
316 return;
317 }
318
319 uint8_t * addr = getWorkingPageAddr(tsChannel, page, offset);
320 if (addr == nullptr) {
321 sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, "ERROR: WR invalid page");
322 return;
323 }
324
326
327 // Special case
328 if (page == TS_PAGE_SETTINGS) {
329 if (isLockedFromUser()) {
330 sendErrorCode(tsChannel, TS_RESPONSE_UNRECOGNIZED_COMMAND, "locked");
331 return;
332 }
333
334 // Skip the write if a preset was just loaded - we don't want to overwrite it
335 // [tag:popular_vehicle]
336 if (!needToTriggerTsRefresh()) {
337 memcpy(addr, content, count);
338 } else {
339 efiPrintf("Ignoring TS -> Page %d write chunk offset %d count %d (output_count=%d)",
340 page,
341 offset,
342 count,
344 );
345 }
346 // Force any board configuration options that humans shouldn't be able to change
347 // huh, why is this NOT within above 'needToTriggerTsRefresh()' condition?
349 } else {
350 memcpy(addr, content, count);
351 }
352
353 sendOkResponse(tsChannel);
354}
static bool call_board_override(std::optional< FuncType > board_override, Args &&... args)
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
bool needToTriggerTsRefresh()
static void onCalibrationWrite(uint16_t page, uint16_t offset, uint16_t count)

Referenced by handleCrcCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendErrorCode()

void TunerStudio::sendErrorCode ( TsChannelBase tsChannel,
uint8_t  code,
const char msg = "" 
)
private

Definition at line 263 of file tunerstudio.cpp.

263 {
264 ::sendErrorCode(tsChannel, code, msg);
265}
uint8_t code
Definition bluetooth.cpp:40

Referenced by cmdOutputChannels(), handleCrc32Check(), handleCrcCommand(), handlePageReadCommand(), handleWriteChunkCommand(), and sendErrorCode().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: