Open alisonbelow opened 1 month ago
Hi @alisonbelow ,
You are setting NAME for the bind address: addr.can_addr.j1939.name = 0x01; // peer, name = 1
If you are doing it, you need to do address claiming and the kernel stack should see the address claiming on the bus. So, you should use j1939acd to claim the address, or add own code to do it, or set J1939_NO_NAME. Especially if you areldy set the address, name is not needed. Except of this, you are trying to send a can frame as payload, this makes no sense. Payload is just a payload, everything else is done by the kernel stack. For example if it is more then 8 byte, it will be split and transferred by using transport protocol.
Looking for some assistance here - I am trying to create a simple program to send a j1939 message on a vcan interface.
My goals:
When I run this binary, I get error "sendto failed: Cannot assign requested address".
Is there anything distinctly I'm doing wrong here? I tried to find the configured addressing/names but I do not have a
/proc/net/can/j1939
file tocat
.I've confirmed the vcan interface is configured and up:
and
sudo modprobe vcan
is successful.