Skip to content

Conversation

@polymorf
Copy link

@polymorf polymorf commented Jan 4, 2025

Changing ignore_rx_error_frames for socketcan interfaces has no effect since error filter is only applied when ignore_rx_error_frames is false

)
except OSError as error:
log.error("Could not enable error frames (%s)", error)
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could simplify this a bit like this:

            # set error frame filter
            try:
                self.socket.setsockopt(
                    constants.SOL_CAN_RAW,
                    constants.CAN_RAW_ERR_FILTER,
                    0x0 if ignore_rx_error_frames else 0x1FFFFFFF,
                )
            except OSError as error:
                log.error("Could not enable error frame filter (%s)", error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants