Skip to contentSkip to conversation

Transmitted Data is not to be received by other Application

DISCUSSION Oliver Stefan 2 participants 2 messages Mar 28, 2013 CAN network drivers

lore
Share & tools
lore
#0 lore raw

I'm developing Software for the Raspberry Pi with MCP2515 extension.

I have two applications running the same time.
One is in the receiving mode, and the other can transmit and receive.
Unfortunately the application that is permanently receiving, receives the data of the second application too.

How can I turn off this function?

I read the helpfile
http://svn.berlios.de/wsvn/socketcan/trunk/kernel/2.6/Documentation/networking/can.txt

but I don't see there any possibility to eleminate this function.

Thank you very much!

#1 lore raw
Quoted 8 lines · Oliver Stefan

I'm developing Software for the Raspberry Pi with MCP2515 extension.

I have two applications running the same time.
One is in the receiving mode, and the other can transmit and receive. Unfortunately the application that is permanently receiving, receives the data of the second application too.

How can I turn off this function?

Have you tried this:

4.1.3 RAW socket option CAN_RAW_LOOPBACK

To meet multi user needs the local loopback is enabled by default (see chapter 3.2 for details). But in some embedded use-cases (e.g. when only one application uses the CAN bus) this loopback functionality can be disabled (separately for each socket):

int loopback = 0; /* 0 = disabled, 1 = enabled (default) */

setsockopt(s, SOL_CAN_RAW, CAN_RAW_LOOPBACK, &loopback, sizeof(loopback));

Marc

Signature · 4 lines
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   |