This commit is contained in:
parent
b093c437ef
commit
fe90efd946
|
@ -409,6 +409,7 @@ void handleBurnCommand(ts_channel_s *tsChannel, ts_response_format_e mode, uint1
|
||||||
|
|
||||||
static TunerStudioReadRequest readRequest;
|
static TunerStudioReadRequest readRequest;
|
||||||
static TunerStudioWriteChunkRequest writeChunkRequest;
|
static TunerStudioWriteChunkRequest writeChunkRequest;
|
||||||
|
static TunerStudioOchRequest ochRequest;
|
||||||
static short int pageIn;
|
static short int pageIn;
|
||||||
|
|
||||||
static bool isKnownCommand(char command) {
|
static bool isKnownCommand(char command) {
|
||||||
|
@ -587,11 +588,20 @@ void handleQueryCommand(ts_channel_s *tsChannel, ts_response_format_e mode) {
|
||||||
/**
|
/**
|
||||||
* @brief 'Output' command sends out a snapshot of current values
|
* @brief 'Output' command sends out a snapshot of current values
|
||||||
*/
|
*/
|
||||||
void handleOutputChannelsCommand(ts_channel_s *tsChannel, ts_response_format_e mode) {
|
void handleOutputChannelsCommand(ts_channel_s *tsChannel, ts_response_format_e mode, uint16_t offset, uint16_t count) {
|
||||||
|
|
||||||
|
//
|
||||||
|
// if (size < offset + count) {
|
||||||
|
// scheduleMsg(&tsLogger, "invalid offset/count %d/%d", offset, count);
|
||||||
|
// sendErrorCode(tsChannel);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
tsState.outputChannelsCommandCounter++;
|
tsState.outputChannelsCommandCounter++;
|
||||||
prepareTunerStudioOutputs();
|
prepareTunerStudioOutputs();
|
||||||
// this method is invoked too often to print any debug information
|
// this method is invoked too often to print any debug information
|
||||||
sr5SendResponse(tsChannel, mode, (const uint8_t *) &tsOutputChannels, sizeof(TunerStudioOutputChannels));
|
sr5SendResponse(tsChannel, mode, ((const uint8_t *) &tsOutputChannels) + offset, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TEST_RESPONSE_TAG " ts_p_alive\r\n"
|
#define TEST_RESPONSE_TAG " ts_p_alive\r\n"
|
||||||
|
@ -706,8 +716,14 @@ bool handlePlainCommand(ts_channel_s *tsChannel, uint8_t command) {
|
||||||
handlePageReadCommand(tsChannel, TS_PLAIN, readRequest.page, readRequest.offset, readRequest.count);
|
handlePageReadCommand(tsChannel, TS_PLAIN, readRequest.page, readRequest.offset, readRequest.count);
|
||||||
return true;
|
return true;
|
||||||
} else if (command == TS_OUTPUT_COMMAND) {
|
} else if (command == TS_OUTPUT_COMMAND) {
|
||||||
|
int received = sr5ReadData(tsChannel, (uint8_t * )&ochRequest, sizeof(ochRequest));
|
||||||
|
if (received != sizeof(ochRequest)) {
|
||||||
|
tunerStudioError("Not enough for OutputChannelsCommand");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//scheduleMsg(logger, "Got naked Channels???");
|
//scheduleMsg(logger, "Got naked Channels???");
|
||||||
handleOutputChannelsCommand(tsChannel, TS_PLAIN);
|
handleOutputChannelsCommand(tsChannel, TS_PLAIN, ochRequest.offset, ochRequest.count);
|
||||||
return true;
|
return true;
|
||||||
} else if (command == TS_LEGACY_HELLO_COMMAND) {
|
} else if (command == TS_LEGACY_HELLO_COMMAND) {
|
||||||
tunerStudioDebug("ignoring LEGACY_HELLO_COMMAND");
|
tunerStudioDebug("ignoring LEGACY_HELLO_COMMAND");
|
||||||
|
@ -735,7 +751,9 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin
|
||||||
} else if (command == TS_EXECUTE) {
|
} else if (command == TS_EXECUTE) {
|
||||||
handleExecuteCommand(tsChannel, data, incomingPacketSize - 1);
|
handleExecuteCommand(tsChannel, data, incomingPacketSize - 1);
|
||||||
} else if (command == TS_OUTPUT_COMMAND) {
|
} else if (command == TS_OUTPUT_COMMAND) {
|
||||||
handleOutputChannelsCommand(tsChannel, TS_CRC);
|
uint16_t offset = *(uint16_t *) (data);
|
||||||
|
uint16_t count = *(uint16_t *) (data + 2);
|
||||||
|
handleOutputChannelsCommand(tsChannel, TS_CRC, offset, count);
|
||||||
} else if (command == TS_PAGE_COMMAND) {
|
} else if (command == TS_PAGE_COMMAND) {
|
||||||
uint16_t page = *(uint16_t *) data;
|
uint16_t page = *(uint16_t *) data;
|
||||||
handlePageSelectCommand(tsChannel, TS_CRC, page);
|
handlePageSelectCommand(tsChannel, TS_CRC, page);
|
||||||
|
|
|
@ -251,5 +251,5 @@ int getRusEfiVersion(void) {
|
||||||
return 123; // this is here to make the compiler happy about the unused array
|
return 123; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||||
return 3211; // this is here to make the compiler happy about the unused array
|
return 3211; // this is here to make the compiler happy about the unused array
|
||||||
return 20170525;
|
return 20170527;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ enable2ndByteCanID = false
|
||||||
; see TS_FILE_VERSION in firmware code
|
; see TS_FILE_VERSION in firmware code
|
||||||
fileVersion = { 20161225 }
|
fileVersion = { 20161225 }
|
||||||
|
|
||||||
ochGetCommand = "O"
|
ochGetCommand = "O%2o%2c"
|
||||||
|
|
||||||
; see TS_OUTPUT_SIZE in console source code
|
; see TS_OUTPUT_SIZE in console source code
|
||||||
ochBlockSize = 356
|
ochBlockSize = 356
|
||||||
|
|
|
@ -498,7 +498,13 @@ public class BinaryProtocol {
|
||||||
public boolean requestOutputChannels() {
|
public boolean requestOutputChannels() {
|
||||||
if (isClosed)
|
if (isClosed)
|
||||||
return false;
|
return false;
|
||||||
byte[] response = executeCommand(new byte[]{COMMAND_OUTPUTS}, "output channels", false);
|
|
||||||
|
byte packet[] = new byte[5];
|
||||||
|
packet[0] = COMMAND_OUTPUTS;
|
||||||
|
putShort(packet, 1, 0); // offset
|
||||||
|
putShort(packet, 3, swap16(Fields.TS_OUTPUT_SIZE));
|
||||||
|
|
||||||
|
byte[] response = executeCommand(packet, "output channels", false);
|
||||||
if (response == null || response.length != (Fields.TS_OUTPUT_SIZE + 1) || response[0] != RESPONSE_OK)
|
if (response == null || response.length != (Fields.TS_OUTPUT_SIZE + 1) || response[0] != RESPONSE_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||||
* @see EngineSnifferPanel
|
* @see EngineSnifferPanel
|
||||||
*/
|
*/
|
||||||
public class Launcher {
|
public class Launcher {
|
||||||
public static final int CONSOLE_VERSION = 20170522;
|
public static final int CONSOLE_VERSION = 20170527;
|
||||||
public static final boolean SHOW_STIMULATOR = false;
|
public static final boolean SHOW_STIMULATOR = false;
|
||||||
private static final String TAB_INDEX = "main_tab";
|
private static final String TAB_INDEX = "main_tab";
|
||||||
protected static final String PORT_KEY = "port";
|
protected static final String PORT_KEY = "port";
|
||||||
|
|
Loading…
Reference in New Issue