Repository navigation
etas: mask filter can_id with can_mask before passing it to BOA - #2178
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
EtasBus._apply_filterspassed the rawcan_idto BOA asframeIDValue. The ETAS BOA OCI CAN API (BOA v2.50.0,OCI_CANRxFilterEx::frameIDValue) allows only the lower 11 (standard) or 29 (extended) bits and states that "setting bits out of range will result in a filter that can not pass any frames". A filter whosecan_idhas such bits outsidecan_masktherefore received nothing._recv_internalreportsfiltered=True, so no software filter catches this and frames are dropped without any error.This matches the rule
BusABC._matches_filtersalready applies:can_idbits outsidecan_maskare ignored. Filters whosecan_idis already withincan_mask(including the accept-all filter) are unchanged.can/interfaces/etas/__init__.pytest_filter_id_bits_outside_mask_are_ignoredintest/test_etas.pydoc/changelog.d/+etas-filter-id-mask.fixed.rstEvidence, filter
{"can_id": 0x18FF0123, "can_mask": 0x7FF, "extended": False}:frameIDValuetest_filter_id_bits_outside_mask_are_ignored0x18FF0123(out of range, passes no frames)[(419365155, 2047, 0, 5)] != [(291, 2047, 0, 5)]0x123Related Issues / Pull Requests
Type of Change
Checklist
tox).