hardbyte / python-can

The can package provides controller area network support for Python developers
https://python-can.readthedocs.io
GNU Lesser General Public License v3.0
1.31k stars 604 forks source link

Fix for #1849 (PCAN fails when PCAN_ERROR_ILLDATA is read via ReadFD) #1850

Closed bures closed 2 months ago

bures commented 2 months ago

When there is an invalid frame on CAN bus (in our case CAN FD), PCAN first reports result PCAN_ERROR_ILLDATA and then it send the error frame. If the PCAN_ERROR_ILLDATA is not ignored, python-can throws an exception. Reported as #1849

This fix adds a branch in pcan.py:_recv_internal, which ignores the PCAN_ERROR_ILLDATA.