On 10/13/2010 10:19 AM, Marc Kleine-Budde wrote:
> On 10/13/2010 10:07 AM, Alexander Stein wrote:
>> Hello,
>>
>> is there a way to detect whether the CAN frame actually was sent on the bus?
>> I
>> guess the write call on the socket returns immediately and the data will be
>> buffered in kernel space. The cangen demo also does optionally a POLLOUT
>> poll
>> on the CAN socket, but I expect this will only show if there is free buffer
>> available.
>> So, what can I do to get the information when the frame was sent?
>
> You can switch the socket to receive it's own messages
> ("setsockopt(CAN_RAW_RECV_OWN_MSGS)"). There's an ongoing discussion
> about this on socketcan-core:
>
> http://old.nabble.com/Self-reception-and-more-td29760073.html
> http://old.nabble.com/Self-reception-td29932236.html
I'm following the discussion and realized that it will not work for
devices doing the local loopback in hardware, like the flexcan
controller. Strictly speaking it will only work properly for drivers
doing the local loopback in software when the TX done interrupt is
handled. Also some USB devices are not able to do that properly.
Wolfgang.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users