From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Cheng-Lung Lee <chenglung@gmail.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: [PATCH] add 'v' command response
Date: Fri, 08 May 2015 12:52:46 +0200 [thread overview]
Message-ID: <554C957E.8020709@hartkopp.net> (raw)
In-Reply-To: <CAH=KbUsshrrQjBSkWzC6sgnXkfhnzUJfS8DcxrNx5-NBk9mysg@mail.gmail.com>
On 05/08/2015 04:18 AM, Cheng-Lung Lee wrote:
> I am using USBtin device software(http://www.fischl.de/usbtin/ ) which like
> some SLCAN based serial CAN protocol using "v" as Major/Minor version number.
> Please check the pdf file for more detial.
> http://www.mirrorservice.org/sites/downloads.sourceforge.net/s/so/socketcan.berlios/SLCAN-API.pdf
Whoa!
That's pretty hard to be pointed at my *own* created documentation after seven
years m)
Indeed you are right. To emulate the SLCAN adapter with the slcanpty emulation
this patch makes perfectly sense.
I pulled your changes into can-utils:master.
Best regards,
Oliver
ps. The pointer to http://www.fischl.de/usbtin/ was interesting.
> The software I am testing is USBtinViewer, which sends "V" and "v" on startup.
> If slcanpty sends NACK . The program quits.
>
> Best,
> Steven
>
> On Thu, May 7, 2015 at 4:57 PM, Oliver Hartkopp <socketcan@hartkopp.net
> <mailto:socketcan@hartkopp.net>> wrote:
>
> Hi all
>
> On 05/07/2015 04:24 PM, Marc Kleine-Budde wrote:
> > Hello bombilee,
> >
> > On 05/07/2015 04:20 PM, Marc Kleine-Budde wrote:
> >> diff --git a/slcanpty.c b/slcanpty.c
> >> index c062a027da41..f485ac775a53 100644
> >> --- a/slcanpty.c
> >> +++ b/slcanpty.c
> >> @@ -185,6 +185,13 @@ rx_restart:
> >> ptr = 1;
> >> goto rx_out;
> >> }
> >> + /* check for 'v'ersion command */
> >> + if (cmd == 'v') {
> >> + sprintf(replybuf, "v1014\r");
> >
> > Is there a special meaning behing "v1014"? Where does the string come from?
>
> We *already* check for the version command!
>
> But it has to be 'V' with upper case:
>
> See http://www.can232.com/docs/can232_v3.pdf page 12:
>
> Get Version number of both CAN232 hardware and software
> This command is only active always.
> Example: V[CR]
> Get Version numbers
> Returns: V and a 2 bytes BCD value for hardware version and
> a 2 byte BCD value for software version plus
> CR (Ascii 13) for OK. E.g. V1013[CR]
>
> The SLCAN/Lawicel protocol is case sensitive!!
>
> See T/t R/r S/s M/m commands.
>
> A hunk could be to support lower case for the version information check too.
>
> But IMO that's the wrong approach.
>
> The application should send 'V' and not 'v' - and this should be fixed there.
>
> What kind of application sends 'v' to get the version information?
>
> Regards,
> Oliver
>
> >
> >> + tmp = strlen(replybuf);
> >> + ptr = 1;
> >> + goto rx_out;
> >> + }
> >>
> >> /* check for serial 'N'umber command */
> >> if (cmd == 'N') {
> >>
> >
> > Marc
> >
>
>
prev parent reply other threads:[~2015-05-08 10:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 14:20 [PATCH] add 'v' command response Marc Kleine-Budde
2015-05-07 14:24 ` Marc Kleine-Budde
2015-05-07 20:57 ` Oliver Hartkopp
[not found] ` <CAH=KbUsshrrQjBSkWzC6sgnXkfhnzUJfS8DcxrNx5-NBk9mysg@mail.gmail.com>
2015-05-08 10:52 ` Oliver Hartkopp [this message]
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=554C957E.8020709@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=chenglung@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.