I am sorry for being unclear about the details…
Only two nodestatus messages are leaving the can0 interface and going out on the physical bus.
Regarding res = -1 and errno, I think this result was normal in this situation, so sorry for confusing…
The problem seems to be that MSG_CONFIRM flag is never set by the the socket. So the
read(..) never reach 'frame =
As I have understood, correct me if I am wrong, this flag is dependent on if can driver implements support for echo or not according to SocketCAN readme:
4.1.7 RAW socket returned message flags
When using recvmsg() call, the msg->msg_flags may contain following flags:
MSG_DONTROUTE: set when the received frame was created on the local host.
MSG_CONFIRM: set when the frame was sent via the socket it is received on.
This flag can be interpreted as a 'transmission confirmation' when the
CAN driver supports the echo of frames on driver level, see 3.2 and 6.2.
In order to receive such messages, CAN_RAW_RECV_OWN_MSGS must be set.
Right now I am not sure if it is a driver issue or not, but it might be… I have read some forums about similar issues with the flexcan driver, http://socket-can.996257.n3.nabble.com/Help-with-CAN-RAW-LOOPBACK-td431.html
Have tested the “tst-rcv-own-msgs” program mentioned in the thread, and it works ok, however, it does not evaluate the MSG_CONFIRM flag.
I noticed your test_socket.cpp application under libuavcan_drivers/linux/apps and will execute it also to see if it passes as well.
Thanks for the link! I will investigate further…