Skip to content

Commit 2e70414

Browse files
committed
disable error frames when ignore_rx_error_frames is set
1 parent 654a02a commit 2e70414

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

can/interfaces/socketcan/socketcan.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,14 @@ def __init__(
702702
)
703703
except OSError as error:
704704
log.error("Could not enable error frames (%s)", error)
705+
else:
706+
# disable error frames
707+
try:
708+
self.socket.setsockopt(
709+
constants.SOL_CAN_RAW, constants.CAN_RAW_ERR_FILTER, 0x0
710+
)
711+
except OSError as error:
712+
log.error("Could not disable error frames (%s)", error)
705713

706714
# enable nanosecond resolution timestamping
707715
# we can always do this since

0 commit comments

Comments
 (0)