can
This commit is contained in:
@@ -75,6 +75,15 @@ void CommObd2Can::mainLoop() {
|
|||||||
if (rxRemaining <= 2)
|
if (rxRemaining <= 2)
|
||||||
break;
|
break;
|
||||||
delay(1);
|
delay(1);
|
||||||
|
// apply timeout for next frames loop too
|
||||||
|
if (lastDataSent != 0 && (unsigned long)(millis() - lastDataSent) > 100) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Process incomplette messages
|
||||||
|
if (liveData->responseRowMerged.length() > 7) {
|
||||||
|
processMergedResponse();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lastDataSent != 0 && (unsigned long)(millis() - lastDataSent) > 100) {
|
if (lastDataSent != 0 && (unsigned long)(millis() - lastDataSent) > 100) {
|
||||||
@@ -266,13 +275,20 @@ bool CommObd2Can::processFrame() {
|
|||||||
|
|
||||||
// Send response to board module
|
// Send response to board module
|
||||||
if (rxRemaining <= 2) {
|
if (rxRemaining <= 2) {
|
||||||
Serial.print("merged:");
|
processMergedResponse();
|
||||||
Serial.println(liveData->responseRowMerged);
|
|
||||||
board->parseRowMerged();
|
|
||||||
liveData->responseRowMerged = "";
|
|
||||||
liveData->canSendNextAtCommand = true;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
processMergedResponse
|
||||||
|
*/
|
||||||
|
void CommObd2Can::processMergedResponse() {
|
||||||
|
Serial.print("merged:");
|
||||||
|
Serial.println(liveData->responseRowMerged);
|
||||||
|
board->parseRowMerged();
|
||||||
|
liveData->responseRowMerged = "";
|
||||||
|
liveData->canSendNextAtCommand = true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,4 +30,5 @@ class CommObd2Can : public CommInterface {
|
|||||||
void sendFlowControlFrame();
|
void sendFlowControlFrame();
|
||||||
uint8_t receivePID();
|
uint8_t receivePID();
|
||||||
bool processFrame();
|
bool processFrame();
|
||||||
|
void processMergedResponse();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user