TS commands reuse

This commit is contained in:
rusefi 2020-05-25 18:49:35 -04:00
parent 9a2c014fbb
commit 30c4682b16
7 changed files with 41 additions and 16 deletions

View File

@ -1270,8 +1270,14 @@
#define triggerSimulatorPins1_offset 736
#define triggerSimulatorPins2_offset 737
#define triggerSimulatorPins3_offset 738
#define TS_CRC_CHECK_COMMAND 'k'
#define TS_FILE_VERSION 20200310
#define TS_GET_LOGGER_GET_BUFFER 'L'
#define TS_HELLO_COMMAND 'S'
#define TS_OUTPUT_COMMAND 'O'
#define TS_OUTPUT_SIZE 244
#define TS_READ_COMMAND 'R'
#define TS_SET_LOGGER_SWITCH 'l'
#define ts_show_analog_divider true
#define ts_show_auxserial_pins true
#define ts_show_can_pins true

View File

@ -61,18 +61,14 @@ typedef struct {
#define TS_EXECUTE 'E' // 0x45
#define TS_GET_STRUCT '9' // 0x39
// These commands are used by TunerStudio and the rusEfi console
#define TS_HELLO_COMMAND 'S' // 0x53 queryCommand
#define TS_OUTPUT_COMMAND 'O' // 0x4F ochGetCommand
#define TS_READ_COMMAND 'R' // 0x52
// many commands are now defined in rusefi_config.txt see TS_* constants
// this way we reuse between firmware and java code
#define TS_PAGE_COMMAND 'P' // 0x50
#define TS_COMMAND_F 'F' // 0x46
#define TS_GET_FIRMWARE_VERSION 'V' // versionInfo
#define TS_GET_CONFIG_ERROR 'e' // returns getFirmwareError(), works together with ind_hasFatalError
// High speed logger commands
#define TS_SET_LOGGER_SWITCH 'l'
#define TS_GET_LOGGER_GET_BUFFER 'L'
// Performance tracing
#define TS_PERF_TRACE_BEGIN 'r'
@ -83,7 +79,6 @@ typedef struct {
#define TS_BURN_COMMAND 'B' // 0x42 burnCommand
#define TS_IO_TEST_COMMAND 'w' // 0x77
#define TS_CRC_CHECK_COMMAND 'k' // 0x6B
#define CRC_VALUE_SIZE 4
// todo: double-check this

View File

@ -1270,8 +1270,14 @@
#define triggerSimulatorPins1_offset 736
#define triggerSimulatorPins2_offset 737
#define triggerSimulatorPins3_offset 738
#define TS_CRC_CHECK_COMMAND 'k'
#define TS_FILE_VERSION 20200310
#define TS_GET_LOGGER_GET_BUFFER 'L'
#define TS_HELLO_COMMAND 'S'
#define TS_OUTPUT_COMMAND 'O'
#define TS_OUTPUT_SIZE 244
#define TS_READ_COMMAND 'R'
#define TS_SET_LOGGER_SWITCH 'l'
#define ts_show_analog_divider true
#define ts_show_auxserial_pins true
#define ts_show_can_pins true

View File

@ -1563,6 +1563,19 @@ end_struct
#define PROTOCOL_WA_CHANNEL_4 "input4"
// These commands are used by TunerStudio and the rusEfi console
// 0x4F ochGetCommand
#define TS_OUTPUT_COMMAND 'O'
// 0x53 queryCommand
#define TS_HELLO_COMMAND 'S'
// 0x6B
#define TS_CRC_CHECK_COMMAND 'k'
// 0x52
#define TS_READ_COMMAND 'R'
// High speed logger commands
#define TS_SET_LOGGER_SWITCH 'l'
#define TS_GET_LOGGER_GET_BUFFER 'L'
#define PROTOCOL_COIL1_SHORT_NAME "c1"
#define PROTOCOL_INJ1_SHORT_NAME "i1"

View File

@ -288,7 +288,7 @@ public class BinaryProtocol implements BinaryProtocolCommands {
System.out.printf("Local cache CRC %x\n", crcOfLocallyCachedConfiguration);
byte packet[] = new byte[7];
packet[0] = COMMAND_CRC32;
packet[0] = COMMAND_CRC_CHECK_COMMAND;
byte[] response = executeCommand(packet, "get CRC32", false);
if (checkResponseCode(response, RESPONSE_OK) && response.length == 5) {

View File

@ -12,14 +12,13 @@ public interface BinaryProtocolCommands {
byte RESPONSE_OK = 0;
byte RESPONSE_BURN_OK = 0x04;
byte RESPONSE_COMMAND_OK = 0x07;
char COMMAND_OUTPUTS = 'O'; // ochGetCommand
char COMMAND_HELLO = 'S'; // queryCommand
char COMMAND_OUTPUTS = Fields.TS_OUTPUT_COMMAND;
char COMMAND_HELLO = Fields.TS_HELLO_COMMAND;
char COMMAND_PROTOCOL = 'F';
char COMMAND_CRC_CHECK_COMMAND = 'k';
// todo: make crc32CheckCommand shorted one day later - no need in 6 empty bytes
char COMMAND_CRC_CHECK_COMMAND = Fields.TS_CRC_CHECK_COMMAND;
char COMMAND_PAGE = 'P';
char COMMAND_READ = 'R'; // 082 decimal
// todo: make crc32CheckCommand shorted one day later
char COMMAND_CRC32 = 'k';
char COMMAND_READ = Fields.TS_READ_COMMAND;
char COMMAND_CHUNK_WRITE = 'C'; // pageChunkWrite
char COMMAND_BURN = 'B'; // burnCommand
char COMMAND_GET_STRUCT = '9'; // TS_GET_STRUCT

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun May 24 13:55:11 EDT 2020
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon May 25 18:48:06 EDT 2020
// by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*;
@ -1251,8 +1251,14 @@ public class Fields {
public static final int triggerSimulatorPins1_offset = 736;
public static final int triggerSimulatorPins2_offset = 737;
public static final int triggerSimulatorPins3_offset = 738;
public static final char TS_CRC_CHECK_COMMAND = 'k';
public static final int TS_FILE_VERSION = 20200310;
public static final char TS_GET_LOGGER_GET_BUFFER = 'L';
public static final char TS_HELLO_COMMAND = 'S';
public static final char TS_OUTPUT_COMMAND = 'O';
public static final int TS_OUTPUT_SIZE = 244;
public static final char TS_READ_COMMAND = 'R';
public static final char TS_SET_LOGGER_SWITCH = 'l';
public static final String TS_SIGNATURE = "rusEFI v1.2020.4";
public static final int tunerStudioSerialSpeed_offset = 728;
public static final int twoWireBatchIgnition_offset = 1476;