It's too bad the USB Serial driver framework doesn't force (or at least strongly recommend) that all drivers create /dev
files using the device "Location ID".
It would seem to be the logical common value to use to identify devices by the physical port they are connected to. It is always provided, always unique, always specific to the physical port, doesn't change across reboots, doesn't change across removal and reinsertion if it is re-attached to the same physical port again, and doesn't rely on optional features such a serial numbers.
Meanwhile for those without serial numbers, such as the Prolific PL2303, the current driver (1.6.1, aka 1.6.0, on 10.13.6) makes up some random /dev/cu.usbserialN
name each time the device is removed and re-attached (even if to the same port), and often it changes across reboots too.
For example here are three of my USB-Serial devices plugged into an external hub:
USB2.0 Hub:
Product ID: 0x0610
Vendor ID: 0x05e3 (Genesys Logic, Inc.)
Version: 92.12
Speed: Up to 480 Mb/sec
Manufacturer: GenesysLogic
Location ID: 0x26400000 / 3
Current Available (mA): 500
Current Required (mA): 100
Extra Operating Current (mA): 0
USB-Serial Controller:
Product ID: 0x2303
Vendor ID: 0x067b (Prolific Technology, Inc.)
Version: 3.00
Speed: Up to 12 Mb/sec
Manufacturer: Prolific Technology Inc.
Location ID: 0x26430000 / 8
Current Available (mA): 500
Current Required (mA): 100
Extra Operating Current (mA): 0
USB-Serial Controller:
Product ID: 0x2303
Vendor ID: 0x067b (Prolific Technology, Inc.)
Version: 3.00
Speed: Up to 12 Mb/sec
Manufacturer: Prolific Technology Inc.
Location ID: 0x26420000 / 7
Current Available (mA): 500
Current Required (mA): 100
Extra Operating Current (mA): 0
FT232R USB UART:
Product ID: 0x6001
Vendor ID: 0x0403 (Future Technology Devices International Limited)
Version: 6.00
Serial Number: A603YGV3
Speed: Up to 12 Mb/sec
Manufacturer: FTDI
Location ID: 0x26410000 / 6
Current Available (mA): 500
Current Required (mA): 90
Extra Operating Current (mA): 0