Skip to content

Commit 817d804

Browse files
authored
Update requests.ino
1 parent 27b8d05 commit 817d804

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

id3esp32obd2/requests.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,13 @@ void readAndSendHVTotalChargeDischarge() {
210210

211211
if (sendUDSRequest(0x17fc007B,UDS_ReadDataByIdentifier_0x22,0x1E,0x32)) {
212212
Serial.print("Total charge/discharge : ");
213-
Serial.print(buffer2unsignedLong(8,4)/8583.07123641215f);
214-
// google for 8583.07123641215 shows, that it seems to be something VW special
213+
Serial.print(buffer2unsignedLong(8,4)/8583.07f);
215214
Serial.print(" ");
216-
Serial.println(fabs((long) buffer2unsignedLong(12,4)/8583.07123641215f));
215+
Serial.println(fabs((long) buffer2unsignedLong(12,4)/8583.07f));
217216

218-
snprintf(strData,MAXSTRDATALENGTH+1,"%i|%.1f",idHVTOTALCHARGE,buffer2unsignedLong(8,4)/8583.07123641215f);
217+
snprintf(strData,MAXSTRDATALENGTH+1,"%i|%.1f",idHVTOTALCHARGE,buffer2unsignedLong(8,4)/8583.07f);
219218
g_SerialBT.write((byte*)strData,strlen(strData)+1);
220-
snprintf(strData,MAXSTRDATALENGTH+1,"%i|%.1f",idHVTOTALDISCHARGE,fabs((long) buffer2unsignedLong(12,4)/8583.07123641215f));
219+
snprintf(strData,MAXSTRDATALENGTH+1,"%i|%.1f",idHVTOTALDISCHARGE,fabs((long) buffer2unsignedLong(12,4)/8583.07f));
221220
g_SerialBT.write((byte*)strData,strlen(strData)+1);
222221
} else {
223222
snprintf(strData,MAXSTRDATALENGTH+1,"%i|ERR",idHVTOTALCHARGE);

0 commit comments

Comments
 (0)