Chris Verges wrote:
> Hi Ravi,
> 
> Also, have you tried adding CAN_EFF_FLAG to the can_id in a logical OR?

This is indeed the problem here:

(..)

>  
>    /* Send a message to the CAN bus */
>    struct can_frame frame;
>    frame.can_id = 0x123;

This has to be:

    frame.can_id = 0x123 | CAN_EFF_FLAG;


... to create a valid EFF CAN Frame.

Btw. that you see a truncated CAN-ID with your above code comes from a
recently fixed bug in the PCAN_USB driver for netdevices:

There was a problem sending correct SFF(!) CAN-IDs (which you've done in your
code).

Please update to the latest PEAK driver 6.13 or 6.11 that contains the fix for
that or apply the attached patch, if you can't update your PEAK driver for any
reason.

Regards,
Oliver

Index: driver/src/pcan_usb_kernel.c
===================================================================
--- driver/src/pcan_usb_kernel.c	(Revision 590)
+++ driver/src/pcan_usb_kernel.c	(Revision 591)
@@ -1089,11 +1089,11 @@
   else
   {
     localID.ul = cf->can_id & CAN_SFF_MASK;
-    localID.ul   <<= 21;
+    localID.ul   <<= 5;
 
     #if defined(__LITTLE_ENDIAN)
-    *ptr++ = localID.uc[2];
-    *ptr++ = localID.uc[3];
+    *ptr++ = localID.uc[0];
+    *ptr++ = localID.uc[1];
     #elif defined(__BIG_ENDIAN)
     *ptr++ = localID.uc[3];
     *ptr++ = localID.uc[2];
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to