福建高科沁恒串口加个别名之跟硬件名字对应

1增加一个文件/etc/udev/rules.d/89_fjgs_xxxx.rules,内容如下

KERNEL=="ttyCH9344USB0", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM1"
KERNEL=="ttyCH9344USB1", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM2"
KERNEL=="ttyCH9344USB2", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM3"
KERNEL=="ttyCH9344USB3", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM4"
KERNEL=="ttyCH9344USB4", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM5"
KERNEL=="ttyCH9344USB5", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM6"
KERNEL=="ttyCH9344USB6", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM7"
KERNEL=="ttyCH9344USB7", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d9", MODE:="0777", SYMLINK+="ttyCOM8"
KERNEL=="ttyACM1", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d2", MODE:="0777", SYMLINK+="ttyCOM9"
KERNEL=="ttyACM0", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d2", MODE:="0777", SYMLINK+="ttyCOM10"

 

2.执行命令,让规则生效或重启后自动生效

udevadm control --reload-rules && udevadm trigger

posted @ 2024-11-13 11:22  DMCF  阅读(5)  评论(0编辑  收藏  举报