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

How to send / Received extended Frame #82

Open
sfJonas opened this issue Jun 17, 2022 · 1 comment
Open

How to send / Received extended Frame #82

sfJonas opened this issue Jun 17, 2022 · 1 comment

Comments

@sfJonas
Copy link

sfJonas commented Jun 17, 2022

Hello,

I have two Arduino with a MCP2515 module on each. I installed your library and ran your CAN_write code on one, and your CAN_read code on the other. I did these changes in the code, to send the extended frame :
canMsg2.can_id = 0x18DAF41F | CAN_EFF_FLAG;
mcp2515.sendMessage(MCP2515::TXB1, &canMsg2);
The sender transmits the message with canMsg2.can_id = 0x18DAF41F, But de read receives the message with canMsg2.can_id = 98DAF41F
Could you help me to solve this problem?

@maincraft-io
Copy link

maincraft-io commented May 24, 2023

Has same problem and fixed by this trick :)
It's just demo how to CUT 0x8..... (do not use it in another situations)

Sender side:

packet.can_id = 0x12345678 | CAN_EFF_FLAG;
packet.can_dlc = 6;

Reciever side:

canid_t can_id = canMsg.can_id;
can_id = can_id & (~CAN_EFF_FLAG);

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

2 participants