Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2019 17:43:59 +0930
From:      "O'Connor, Daniel" <darius@dons.net.au>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        Oleksandr Rybalko <ray@ddteam.net>, freebsd-usb@freebsd.org
Subject:   Re: USB serial ports by serial number
Message-ID:  <E84C0C56-0FE1-44C7-855C-ACC374148701@dons.net.au>
In-Reply-To: <138601da-b6f9-f791-c6ef-ce54a4ae60e6@selasky.org>
References:  <CC980A9B-8F41-4C2A-A729-2CC690DFDA7E@dons.net.au> <CAJ1Oi8HeyBvn4UYSDAh8gGxj0hPv-vgFZ9ArNX95CTniuQa80g@mail.gmail.com> <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> <138601da-b6f9-f791-c6ef-ce54a4ae60e6@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 3 Oct 2019, at 17:41, Hans Petter Selasky <hps@selasky.org> wrote:
>=20
> On 2019-10-03 09:37, O'Connor, Daniel wrote:
>>> On 3 Oct 2019, at 17:01, Hans Petter Selasky <hps@selasky.org> =
wrote:
>>> On 2019-10-03 08:56, O'Connor, Daniel wrote:
>>>> Most of USB-serial devices have "very stable" serial number:)
>>>> more than 50% have S/N "0123456789".
>>>=20
>>> It is also allowed to have no serial number.
>> Yes, that's why I match sernum to '.+' to skip those.
>>> Maybe some kind of "lstty" would do.
>>>=20
>>> -l  -  list all devices
>>> -s  -  match by serial
>>> -v  -  match by vendor
>>> -p  -  match by product
>>> -i  -  match by interface ID
>>> -t  -  type [USB/PCI]
>>>=20
>>> which simply output the tty number you need. Could be an API we =
could add to libusb.
>> The problem is you can't modify some program to call a new API a lot =
of the time but it is usually trivial to change which serial port it's =
configured to use.
>=20
> You don't need to change any program:
>=20
> cu /dev/cuaU`lstty -s SERIAL`

That doesn't work in a lot of cases, eg serial port is in some other =
configuration file.

Even in rc.conf it would be tricky since that file is read so often.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E84C0C56-0FE1-44C7-855C-ACC374148701>