Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of arbitration ID is incorrect #23

Open
abichinger opened this issue Feb 8, 2024 · 0 comments
Open

Implementation of arbitration ID is incorrect #23

abichinger opened this issue Feb 8, 2024 · 0 comments

Comments

@abichinger
Copy link

The arbitration ID is composed of a sender_id and a receiver_mask:

Explanation using the can id 0x1FE40801

hex:       1    F    E    4    0    8    0    1
binary: 0001 1111 1110 0100 0000 1000 0000 0001
index:    28   24   20   16   12    8    4    0
  • [31, 22]: is always 0001 1111 11
  • [21, 11]: device id of sender
    b10 0100 0000 1 = 1153, in this example the sender would be a Gateway (GW)
  • [10, 0]: receiver mask
    b000 0000 0001 = 1, the receiver is a heat generator (WEZ). I think b111 1111 1111 can be used to address all devices on the bus.

image

Current implementation

def build_arbitration_id(message_id, priority, device_type, device_id):
    return (message_id << 24) | (priority << 16) | (device_type << 8) | device_id

Should be:

def build_arbitration_id(sender_id, receiver_mask):
    return (0x7F << 22) | (sender_id << 11) | receiver_mask;
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

No branches or pull requests

1 participant