* [PATCH] add 'v' command response
@ 2015-05-07 14:20 Marc Kleine-Budde
2015-05-07 14:24 ` Marc Kleine-Budde
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-05-07 14:20 UTC (permalink / raw)
To: linux-can; +Cc: bombilee
From: bombilee <chenglung@gmail.com>
add v command response. Some software like USBtinViewer using v for software version.
Tested on USBtinViewer 1.0
---
Hello,
this just came in via gibhub.
Marc
slcanpty.c | 7 +++++++
1 file changed, 7 insertions(+)
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");
+ tmp = strlen(replybuf);
+ ptr = 1;
+ goto rx_out;
+ }
/* check for serial 'N'umber command */
if (cmd == 'N') {
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] add 'v' command response
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
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-05-07 14:24 UTC (permalink / raw)
To: linux-can; +Cc: bombilee
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]
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?
> + tmp = strlen(replybuf);
> + ptr = 1;
> + goto rx_out;
> + }
>
> /* check for serial 'N'umber command */
> if (cmd == 'N') {
>
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: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] add 'v' command response
2015-05-07 14:24 ` Marc Kleine-Budde
@ 2015-05-07 20:57 ` Oliver Hartkopp
[not found] ` <CAH=KbUsshrrQjBSkWzC6sgnXkfhnzUJfS8DcxrNx5-NBk9mysg@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2015-05-07 20:57 UTC (permalink / raw)
To: Marc Kleine-Budde, bombilee; +Cc: linux-can
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-08 10:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).