From owner-freebsd-usb@freebsd.org Thu Oct 3 07:56:11 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5702212C551 for ; Thu, 3 Oct 2019 07:56:11 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [150.101.137.136]) by mx1.freebsd.org (Postfix) with ESMTP id 46kQLK6L6wz3GwQ for ; Thu, 3 Oct 2019 07:56:09 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (HELO midget.dons.net.au) ([14.2.72.4]) by ipmail01.adl6.internode.on.net with ESMTP; 03 Oct 2019 17:26:04 +0930 Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.15.2/8.15.2) with ESMTPS id x937twsP002277 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 3 Oct 2019 17:25:58 +0930 (ACST) (envelope-from darius@dons.net.au) Received: (from mailnull@localhost) by midget.dons.net.au (8.15.2/8.15.2/Submit) id x937bTfO087900 for ; Thu, 3 Oct 2019 17:07:29 +0930 (ACST) (envelope-from darius@dons.net.au) X-Authentication-Warning: midget.dons.net.au: mailnull set sender to using -f X-MIMEDefang-Relay-be813b1f1da6d6b27d681222cb70cc4f5b642383: 203.31.81.187 Received: from havok.gsoft.com.au (Havok.gsoft.com.au [203.31.81.187]) by ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (envelope-sender ) (MIMEDefang) with ESMTP id x937bNsX087894; Thu, 03 Oct 2019 17:07:29 +0930 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: USB serial ports by serial number From: "O'Connor, Daniel" In-Reply-To: <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> Date: Thu, 3 Oct 2019 17:07:23 +0930 Cc: Oleksandr Rybalko , freebsd-usb@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> References: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Score: 0.4 () No, score=0.4 required=5.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 46kQLK6L6wz3GwQ X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of darius@dons.net.au has no SPF policy when checking 150.101.137.136) smtp.mailfrom=darius@dons.net.au X-Spamd-Result: default: False [4.88 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; HAS_XAW(0.00)[]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[dons.net.au]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.973,0]; NEURAL_SPAM_LONG(0.96)[0.963,0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4739, ipnet:150.101.0.0/16, country:AU]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(1.54)[ip: (3.90), ipnet: 150.101.0.0/16(2.51), asn: 4739(1.29), country: AU(0.01)]; RCVD_IN_DNSWL_LOW(-0.10)[136.137.101.150.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 07:56:11 -0000 > On 3 Oct 2019, at 17:01, Hans Petter Selasky 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. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum