link.py DTC/freeze-frame parsing bugs (phantom codes, malformed Mode 02, hex frame index) #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the review (logic).
obdcore/link.py:parse_dtcsCAN branch flattens all lines and strips the SID/count once, so when multiple ECUs respond the pairs misalign and it fabricates phantom DTCs. Fix: message-aware parse (per-ECU-message, detect ISO-TP frame-index prefix before_line_bytesstrips it). Note:0x43is a legal DTC first byte (C03xx) so do NOT blind-scan the flat stream for the SID.read_freeze_framesends a malformed Mode 02 request (0202instead of020200) and mis-parses the DTC with an off-by-one. Fix: send020200, skip SID+PID+frame (+3)._line_bytesonly strips single-digit0-9ISO-TP frame indices, dropping consecutive frames indexedA:-F:. Fix: accept hex0-9A-Fa-f.