I am currently working with SocketCAN, my application is simple, I just want to filter frame from the Can-bus to save information.
I am learning with the help of <a href="http://">http://svn.berlios.de/wsvn/socketcan/trunk/kernel/2.6/Documentation/networking/can.txt
I am sending on the CAN bus extended frame (29bits of id) like : 0000F004
By using the code : nbytes = read(s, &frame, sizeof(struct can_frame));
I am able to receive data 8000F004 (8 corresponding to the EFF (extended) flag).
Now, here is my problem, I am trying to add a filter for the extended id : 0x0000F004
I am using the setsockopt function as shown in the previoux link. But I have no reception...
Find at the end of my post the code currently used.
Do you have any ideas of where my problem can come from ?
Update (from my previous message) : with Standard ID the Filter works correctly...
After 6 years, I'm not sure you are still having this problem or not but as I searched and find this page, I thought it is a good idea to share my knowledge here with all.
I Extended frame, the first bit is always 1 and as it is extended, you should consider it.
For example, if you want to send 00EA00F9 as can_id, you should change it to 80EA00F9 and then sent. Similarly, when you are getting messages, you should do it in vice verse.