From 2e7041470dcfa07cf1d9b132e38a0340d6ddea01 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 4 Jan 2025 16:09:31 +0100 Subject: [PATCH] disable error frames when ignore_rx_error_frames is set --- can/interfaces/socketcan/socketcan.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/can/interfaces/socketcan/socketcan.py b/can/interfaces/socketcan/socketcan.py index 40da0d094..301d755b9 100644 --- a/can/interfaces/socketcan/socketcan.py +++ b/can/interfaces/socketcan/socketcan.py @@ -702,6 +702,14 @@ def __init__( ) except OSError as error: log.error("Could not enable error frames (%s)", error) + else: + # disable error frames + try: + self.socket.setsockopt( + constants.SOL_CAN_RAW, constants.CAN_RAW_ERR_FILTER, 0x0 + ) + except OSError as error: + log.error("Could not disable error frames (%s)", error) # enable nanosecond resolution timestamping # we can always do this since