Add packet filtering (Ioniq only)

Signed-off-by: Martin Kolací <martin.kolaci@lmc.eu>
This commit is contained in:
Martin Kolací
2020-12-23 23:55:14 +01:00
parent fecc4866ce
commit 01cbd4592c

View File

@@ -237,16 +237,6 @@ uint8_t CommObd2Can::receivePID() {
Serial.print(msgString);
// Filter received messages (Ioniq only)
if(liveData->settings.carType == CAR_HYUNDAI_IONIQ_2018) {
long unsigned int atsh_response = liveData->hexToDec(liveData->currentAtshRequest.substring(4), 2, false) + 8;
if(rxId != atsh_response) {
Serial.println(" [Filtered packet]");
return 0xff;
}
}
if ((rxId & 0x40000000) == 0x40000000) { // Determine if message is a remote request frame.
sprintf(msgString, " REMOTE REQUEST FRAME");
Serial.print(msgString);
@@ -263,6 +253,16 @@ uint8_t CommObd2Can::receivePID() {
Serial.println(" [Ignored packet]");
return 0xff;
}
// Filter received messages (Ioniq only)
if(liveData->settings.carType == CAR_HYUNDAI_IONIQ_2018) {
long unsigned int atsh_response = liveData->hexToDec(liveData->currentAtshRequest.substring(4), 2, false) + 8;
if(rxId != atsh_response) {
Serial.println(" [Filtered packet]");
return 0xff;
}
}
Serial.println();
processFrameBytes();