USB 串行驱动程序框架不强制(或至少强烈建议)所有驱动程序/dev
使用设备“位置 ID”创建文件,这太糟糕了。
这似乎是用于通过设备连接到的物理端口来识别设备的逻辑通用值。它始终提供,始终唯一,始终特定于物理端口,在重新启动后不会更改,如果再次重新连接到同一物理端口,则不会在移除和重新插入时更改,并且不依赖于可选具有这样的序列号。
同时,对于那些没有序列号的设备,例如 Prolific PL2303,当前的驱动程序(1.6.1,又名 1.6.0,在 10.13.6 上)/dev/cu.usbserialN
每次移除和重新连接设备时都会组成一些随机名称(即使相同的端口),并且通常它也会在重新启动后发生变化。
例如,这是我插入外部集线器的三个 USB 串行设备:
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