Marc,
On Thu, Oct 21, 2010 at 02:28:35PM +0200, Marc Kleine-Budde wrote:
>
> the socket CAN implementation allows sending of CAN frames with RTR set
> and dlc != 0. My question is what should be received?
I vote to stick pretty close to CAN itself.
This means that a CAN frame with RTR and DLC still contains no data (If I
remember well).
>
> I've tested several CAN cores (sja1000, mcp2515, at91_can) and all
> receive the RTR bit and set the dlc correct, but the data is not handled
> as expected.
an RTR frame contains no data, just a dlc.
> On the at91 and mcp2515 it seems that we get the old
> mailbox data, on the sja1000 we get the old data but shifted by several
> bytes.
You shouldn't read the data bytes.
>
> Our options are:
> leave as it is, or combinations of these:
>
> 1) drop frames with RTR && dlc != 0
this violates CAN
> 2) set dlc = 0 if RTR is set
this violates CAN
> 3) set data = to 0 if RTR is set
this works.
This could be even be accomplished above the driver.
>
> a) during RX
very well,
> b) during TX
No CAN chips would use the data, memset would make no sense
>
Regards,
Kurt
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core