Serial.print now covered by LogSerial class

This commit is contained in:
Lubos Petrovic
2020-12-27 15:39:35 +01:00
parent 5df0732772
commit fbdfd1f1e3
11 changed files with 246 additions and 215 deletions

View File

@@ -19,12 +19,12 @@ void CommInterface::initComm(LiveData* pLiveData, BoardInterface* pBoard) {
void CommInterface::mainLoop() {
// Send command from TTY to OBD2
if (Serial.available()) {
ch = Serial.read();
if (syslog->available()) {
ch = syslog->read();
if (ch == '\r' || ch == '\n') {
board->customConsoleCommand(response);
response = response + ch;
Serial.println(response);
syslog->println(response);
executeCommand(response);
response = "";
} else {
@@ -59,8 +59,8 @@ bool CommInterface::doNextQueueCommand() {
liveData->currentAtshRequest = liveData->commandRequest;
}
Serial.print(">>> ");
Serial.println(liveData->commandRequest);
syslog->print(">>> ");
syslog->println(liveData->commandRequest);
liveData->responseRowMerged = "";
executeCommand(liveData->commandRequest);
liveData->commandQueueIndex++;
@@ -72,7 +72,7 @@ bool CommInterface::doNextQueueCommand() {
bool CommInterface::parseResponse() {
// 1 frame data
Serial.println(liveData->responseRow);
syslog->println(liveData->responseRow);
// Merge frames 0:xxxx 1:yyyy 2:zzzz to single response xxxxyyyyzzzz string
if (liveData->responseRow.length() >= 2 && liveData->responseRow.charAt(1) == ':') {