auto-sync

This commit is contained in:
rusEfi 2014-10-12 14:02:57 -05:00
parent fa82771901
commit 7f2144f940
3 changed files with 29 additions and 1 deletions

View File

@ -241,5 +241,5 @@ void firmwareError(const char *fmt, ...) {
}
int getRusEfiVersion(void) {
return 20141011;
return 20141012;
}

View File

@ -154,6 +154,22 @@ static void echo(int value) {
}
int findEndOfToken(const char *line) {
if (line[0] == '"') {
/**
* Looks like this is a quoted token
*/
int v = indexOf(line + 1, '"');
if (v == -1) {
/**
* Matching closing quote not found
*/
return -1;
}
/**
* Skipping first quote and the symbol after closing quote
*/
return v + 2;
}
return indexOf(line, ' ');
}

View File

@ -278,6 +278,12 @@ void testConsoleLogic(void) {
char * cmd = "he ha";
assertEquals(2, findEndOfToken(cmd));
cmd = "\"hee\" ha";
assertEquals(5, findEndOfToken(cmd));
cmd = "\"h e\" ha";
assertEquals(5, findEndOfToken(cmd));
char *ptr = validateSecureLine(UNKNOWN_COMMAND);
assertEquals(0, strcmp(UNKNOWN_COMMAND, ptr));
@ -307,6 +313,12 @@ void testConsoleLogic(void) {
assertEquals(111, atoi(lastFirst));
assertEquals(333, atoi(lastThird));
strcpy(buffer, "echosss \" 1\" 222 333");
handleConsoleLine(buffer);
assertTrue(strEqual("\" 1\"", lastFirst));
//addConsoleActionSSS("GPS", testGpsParser);
}