Linux CAN drivers development
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Nathan Conrad <nconrad.mlock@gmail.com>
Cc: Josselin Costanzi <josselin.costanzi@mobile-devices.fr>,
	linux-can <linux-can@vger.kernel.org>,
	Yannick Bedhomme <yannick.bedhomme@mobile-devices.fr>
Subject: Re: iso-tp: timeout handling for unknown packet size
Date: Wed, 23 Oct 2013 18:00:57 +0200	[thread overview]
Message-ID: <5267F2B9.2000704@hartkopp.net> (raw)
In-Reply-To: <CABLFF-=Rxi7Gtpr+OD5q5QsjD5fnrcZQaTJFoeT9a8UzuMbSEA@mail.gmail.com>

On 23.10.2013 16:40, Nathan Conrad wrote:
> You could also add a filter for the ISO-TP reception ID to a raw
> protocol socket and monitor the reception of packets that way.  Non
> ISO-TP packets shouldn't be on that ID.
> 
> Nathan Conrad

Yes. This would be an idea.

You could also create a CAN_BCM socket to detect a timeout on a given CAN-ID.

See the BCM documentation(s) at

	http://marc.info/?l=linux-can&m=138217795117288&w=2

or the tst-bcm-*.c examples at

	https://gitorious.org/linux-can/can-tests/

With the BCM you can put the timeout handling completely into the kernel.

Regards,
Oliver



> 
> On Wed, Oct 23, 2013 at 8:32 AM, Josselin Costanzi
> <josselin.costanzi@mobile-devices.fr> wrote:
>> Hello,
>>
>> We are working with the current implementation of ISO-TP from Oliver
>> Hartkopp available on github. The implementation works well for us
>> with a slight limitation that we would like to discuss here.
>>
>> We use ISO-TP to talk to OBD ECUs. In this context, our userspace
>> opens an ISO-TP socket and sends an OBD-CAN request to the ECU and
>> waits for a response over ISO-TP. To be able to receive large frames
>> over ISO-TP or to account for transmitter having a large inter frame
>> delay, we have to use large timeout values so we don't close the
>> socket while the packet is still being received.
>>
>> We would like to know if an ECU is responding or not without having to
>> wait several seconds for a hypotetical packet to be received, do you
>> have any idea how we could do that?
>>
>> Thanks,
>>
>> --
>> Josselin Costanzi
>>   Embedded Linux System Engineer



  reply	other threads:[~2013-10-23 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 13:32 iso-tp: timeout handling for unknown packet size Josselin Costanzi
2013-10-23 14:40 ` Nathan Conrad
2013-10-23 16:00   ` Oliver Hartkopp [this message]
2013-10-23 16:50     ` Josselin Costanzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5267F2B9.2000704@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=josselin.costanzi@mobile-devices.fr \
    --cc=linux-can@vger.kernel.org \
    --cc=nconrad.mlock@gmail.com \
    --cc=yannick.bedhomme@mobile-devices.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox