From: Maxime Jayat Subject: Re: linux-can ISOTP module Date: Thu, 05 Jun 2014 12:18:18 +0200 Message-ID: <539043EA.6030001@artisandeveloppeur.fr> References: <538F6836.3060508@hartkopp.net> Reply-To: maxime@artisandeveloppeur.fr Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-wi0-f180.google.com ([209.85.212.180]:50207 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbaFEKSX (ORCPT ); Thu, 5 Jun 2014 06:18:23 -0400 Received: by mail-wi0-f180.google.com with SMTP id hi2so3106969wib.1 for ; Thu, 05 Jun 2014 03:18:21 -0700 (PDT) In-Reply-To: Sender: linux-can-owner@vger.kernel.org List-ID: To: laurent vaudoit , linux-can@vger.kernel.org, Oliver Hartkopp Hi, Le 05/06/2014 09:16, laurent vaudoit a =C3=A9crit : > Hi Oliver, > thank you for your answer. > I'm sorry but there is still somethings i do not understand. >=20 >=20 > Ok, with isotp.h api, i understand that we can parameter block size, = stmin, > wftmax, transmission time (n_ax), padding. > But how can i specify the timing n_CS (time between flow control rece= ption > and first consecutive frame) and the timing n_BS (time between first = frame > reception and flow control emission)? In the same way, is it possible= to > specify according timeout (n_BR for flow control timeout reception, a= nd n_CR > for consecutive frame timeout reception)? >> >>> >>> For extended adressing method, it seems that both rx and tx frame m= ust have >>> the same first byte in can frame (the one set by ext_address field = of the >>> structure). This is correct for mixed addressing method (see Iso157= 65-2), >>> but for extended adressing method, we should be able to specify dif= ferent >>> Target and source adress. I have not seen anything like this. >> >> One socket represents one virtual 1:1 connection (defined by two CAN >> identifiers and optional with one address extension) on the CAN bus. >> >> If you want to receive from different sources just create different = sockets >> (and e.g. use select() to listen to many open socket file descriptor= s). >> >> The protocol engine has always to answer with the correct address in= formation. >> > With this method, how can i have a segmented transfer like this: > 0x6a7 0x55 0x10 0x08 ........ > 0x687 0xAA 0x30 0x00 0x00 > 0x6a7 0x55 0x21 ..... >=20 > The connection i need is between two ECU, using IDs 0x6a7/687 and one= has > adress extension 0x55, the other 0xAA (this adressing method is used = on some > FIAT ECUs for example), but i don't see how it can work using two soc= ket. I confirm. This is a problem that we also encountered on a BMW ECU with the curren= t implementation of ISOTP. The use-case is real and not currently supported. I had to hack isotp.c, adding a socket option to be able to choose an address extension for the reception. Probably not the best solution but it worked. > just after posting and some debug, i found that the problem was the > txqueulen. By increasing this parameter through ifconfig tool, i'm ab= le to > send 255 bytes frames with stmin=3D0. >> >> >> Regards, >> Oliver >=20 > Regards > Laurent >=20 > On Wed, Jun 4, 2014 at 8:40 PM, Oliver Hartkopp wrote: >> Hi Laurent, >> >> On 04.06.2014 14:55, laurent vaudoit wrote: >> >>> i'm using isotp module for some work purpose, >>> on a imx25 board, with kernel 3.10. >>> >>> I have integrated the module isotp and the correct header file in m= y >>> kernel. >>> >>> I'm able to use isotpsend adn isotprecv functions but i have some q= uestions: >>> >>> Comming from automotiv diagnostic, we are used to configure a lots = of >>> parameters in our baremetal Iso15765 protocol firmware (stmin, >>> bs,n_cs,n_bs...) >>> I have not seen anything to parameter timings such as n_cs, n_bs. >>> Is their something i missed? >> >> Definitely :-) >> >> See the help text from isotprecv: >> >> --- >> >> Usage: isotprecv [options] >> Options: -s (source can_id. Use 8 digits for extended IDs) >> -d (destination can_id. Use 8 digits for extended= IDs) >> -x (extended addressing mode.) >> -p (set and enable padding byte) >> -P (check padding in SF/CF. (l)ength (c)ontent (a= )ll) >> -b (blocksize. 0 =3D off) >> -m (STmin in ms/ns. See spec.) >> -f