linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: recv list
@ 2012-01-09 13:26 Kurt Van Dijck
  2012-01-09 16:35 ` Wolfgang
  0 siblings, 1 reply; 26+ messages in thread
From: Kurt Van Dijck @ 2012-01-09 13:26 UTC (permalink / raw)
  To: Wolfgang; +Cc: linux-can

On Mon, Jan 09, 2012 at 10:46:17AM +0000, Wolfgang wrote:
> Hi,
> 
> now it is saying 'sendto failed: Machine is not on the network', when I am 
> sending a message with id 0x15FFD000
I think what happens is that your engine ECU (0x00) does address claiming.
During recvfrom, its 8byte name is returned in src_addr too.
Since that name has not been seen on the second network, you get an error.

Try clearing the destination NAME by:

> 
> 		len = sizeof(src_addr);
> 		ret = recvfrom(s, buf, sizeof(buf), 0, (void *)&src_addr, &len);
> 		
> 		
> 		if (ret < 0)
> 		perror ("recvfrom failed");
> 		
> 		src_addr.can_addr.j1939.addr = J1939_NO_ADDR;

+ 		src_addr.can_addr.j1939.name = J1939_NO_NAME;

> 
> 		
> 			if (sendto(s2, buf, ret, 0, (void *)&src_addr, len) < 0)
> 				perror("sendto failed");
> 						
> 	}
> 

Kurt

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2012-02-28 16:26 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-09 13:26 recv list Kurt Van Dijck
2012-01-09 16:35 ` Wolfgang
2012-01-10  8:51   ` Kurt Van Dijck
2012-01-10 10:45     ` Wolfgang
2012-01-10 15:23       ` Kurt Van Dijck
2012-01-11 16:06         ` promiscuous mode Wolfgang
2012-01-12 15:37           ` bridge Kurt Van Dijck
2012-01-12 15:23         ` recv list Wolfgang
2012-01-12 15:43           ` Kurt Van Dijck
2012-01-12 18:08           ` bridging with can-gw - was " Oliver Hartkopp
2012-01-13 11:12             ` bridging with can-gw Kurt Van Dijck
2012-01-13 11:31               ` Wolfgang
2012-01-16 10:04                 ` MSG_DONTROUTE Wolfgang
2012-01-16 13:31                   ` MSG_DONTROUTE Kurt Van Dijck
2012-01-16 15:28                     ` sendmsg Wolfgang
2012-01-16 15:36                       ` sendmsg Kurt Van Dijck
2012-02-07 14:21                         ` max dlc Wolfgang
2012-02-07 15:11                         ` sendmsg Wolfgang
2012-02-08  8:46                           ` sendmsg Kurt Van Dijck
2012-02-16  9:58                             ` How to get the DA Wolfgang Wagner
2012-02-16 19:49                               ` Kurt Van Dijck
2012-02-24 15:23                                 ` Transport Protocol Wolfgang Wagner
2012-02-27 14:05                                   ` Kurt Van Dijck
2012-02-28 10:46                                   ` Transport Protocol: example Kurt Van Dijck
2012-02-28 15:21                                     ` Wolfgang Wagner
2012-02-28 16:26                                       ` Kurt Van Dijck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).