* Re: [Socketcan-users] Finding a transmitter's CAN ID [not found] <1376923439605-7678.post@n3.nabble.com> @ 2013-08-19 14:59 ` Marc Kleine-Budde 2013-08-19 15:11 ` Marc Kleine-Budde 2013-08-21 13:41 ` Valler, Robert 0 siblings, 2 replies; 3+ messages in thread From: Marc Kleine-Budde @ 2013-08-19 14:59 UTC (permalink / raw) To: Rob__V; +Cc: linux-can@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 1483 bytes --] Hello Rob, please come to the new mailinglist inux-can@vger.kernel.org Marc On 08/19/2013 04:43 PM, Rob__V wrote: > Hi all, > > I am currently working on a project with several embedded platforms connect > via CAN: > 1 x Linux board connected via SocketCAN > N x embedded boards using the Atmega16M1 (CAN) MCU. > > The Linux board is 'treated' as the master and needs to know the CAN ID of > each > atmega board that sends it a CAN message. So my question is : > > How is the Linux/SocketCAN board able to determine the CAN ID of other > networked nodes when they transmit ? > > Of course, each CAN node can determine the target ID for each message but > I am not sure if the source ID is known ... outside of arbitration. > > > Thank you for your time. > > All the best, > Rob > > > > -- > View this message in context: http://socket-can.996257.n3.nabble.com/Finding-a-transmitter-s-CAN-ID-tp7678.html > Sent from the Socket-CAN Users mailing list archive at Nabble.com. > _______________________________________________ > Socketcan-users mailing list > Socketcan-users@lists.berlios.de > https://lists.berlios.de/mailman/listinfo/socketcan-users > -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 259 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Socketcan-users] Finding a transmitter's CAN ID 2013-08-19 14:59 ` [Socketcan-users] Finding a transmitter's CAN ID Marc Kleine-Budde @ 2013-08-19 15:11 ` Marc Kleine-Budde 2013-08-21 13:41 ` Valler, Robert 1 sibling, 0 replies; 3+ messages in thread From: Marc Kleine-Budde @ 2013-08-19 15:11 UTC (permalink / raw) To: Rob__V; +Cc: linux-can@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 2029 bytes --] On 08/19/2013 04:59 PM, Marc Kleine-Budde wrote: >> I am currently working on a project with several embedded platforms connect >> via CAN: >> 1 x Linux board connected via SocketCAN >> N x embedded boards using the Atmega16M1 (CAN) MCU. >> >> The Linux board is 'treated' as the master and needs to know the CAN ID of >> each >> atmega board that sends it a CAN message. So my question is : >> >> How is the Linux/SocketCAN board able to determine the CAN ID of other >> networked nodes when they transmit ? When we're talking about RAW CAN frames, there is no such thing as CAN id of a node, it's not an address. Neither sending nor receiving. Think of the CAN id more as a part of the data of the CAN frame. Depending on your higher level protocol there might be an addressing scheme which makes use of the CAN id. Then there is probably a CAN id (or part of) associated which each node. Are you using some kind of (standardised) protocol on top of RAW CAN? >> Of course, each CAN node can determine the target ID for each message but >> I am not sure if the source ID is known ... outside of arbitration. For arbitration purpose the CAN id of each CAN frame is used. All nodes that receive the CAN frame receive the same CAN id, in particular the CAN id the sending node put into the CAN frame. Under Linux the CAN if is stored in the "can_id" member of the "struct can_frame" (which is used for both sending and receiving CAN frames). > struct can_frame { > canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ > __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ > __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8))); > }; Hope that helps, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 259 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [Socketcan-users] Finding a transmitter's CAN ID 2013-08-19 14:59 ` [Socketcan-users] Finding a transmitter's CAN ID Marc Kleine-Budde 2013-08-19 15:11 ` Marc Kleine-Budde @ 2013-08-21 13:41 ` Valler, Robert 1 sibling, 0 replies; 3+ messages in thread From: Valler, Robert @ 2013-08-21 13:41 UTC (permalink / raw) To: linux-can@vger.kernel.org Hello again, Thanks all for the helpful information. I am a little clearer on how the CAN bus works now. All the best, Rob On 08/19/2013 04:43 PM, Rob__V wrote: > Hi all, > > I am currently working on a project with several embedded platforms connect > via CAN: > 1 x Linux board connected via SocketCAN > N x embedded boards using the Atmega16M1 (CAN) MCU. > > The Linux board is 'treated' as the master and needs to know the CAN ID of > each > atmega board that sends it a CAN message. So my question is : > > How is the Linux/SocketCAN board able to determine the CAN ID of other > networked nodes when they transmit ? > > Of course, each CAN node can determine the target ID for each message but > I am not sure if the source ID is known ... outside of arbitration. > > > Thank you for your time. > > All the best, > Rob > > > > -- > View this message in context: http://socket-can.996257.n3.nabble.com/Finding-a-transmitter-s-CAN-ID-tp7678.html > Sent from the Socket-CAN Users mailing list archive at Nabble.com. > _______________________________________________ > Socketcan-users mailing list > Socketcan-users@lists.berlios.de > https://lists.berlios.de/mailman/listinfo/socketcan-users > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-21 13:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1376923439605-7678.post@n3.nabble.com>
2013-08-19 14:59 ` [Socketcan-users] Finding a transmitter's CAN ID Marc Kleine-Budde
2013-08-19 15:11 ` Marc Kleine-Budde
2013-08-21 13:41 ` Valler, Robert
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox