用的是这个代码。
编译正常。能正常识别到ttyCH343USB0.
[ 163.815243] usb 2-1: new full-speed USB device number 2 using ohci-platform
[ 164.042656] usb 2-1: New USB device found, idVendor=1a86, idProduct=55d3, bcdDevice= 4.45
[ 164.042685] usb 2-1: New USB device strings: Mfr=0, Product=2, SerialNumber=3
[ 164.042695] usb 2-1: Product: USB Single Serial
[ 164.042703] usb 2-1: SerialNumber: 5719028097
[ 164.044893] usb_ch343 2-1:1.0: ttyCH343USB0: usb to uart device
[ 164.046660] usb_ch343 2-1:1.0: chip idproduct is 21971,chiptype is 8
[ 164.048648] usb_ch343 2-1:1.0: chip type is 2
[ 164.048830] usb_ch343 2-1:1.0: normal to probe
[root@RV1126_RV1109:/]# stty -F /dev/ttyCH343USB0
[ 181.176634] usb_ch343 2-1:1.0: chip type is 2
[ 181.176665] usb_ch343 2-1:1.0: ch343_update_status - unknown status received:len:10, data0:0xa1, data1:0x20
speed 9600 baud; line = 0;
-brkint -imaxbel
[root@RV1126_RV1109:/]#
[root@RV1126_RV1109:/]# printf "01" >/dev/ttyCH343USB0
[root@RV1126_RV1109:/]#
发数据的时候会出现多出2个数据。
这是什么原因导致的。而且每次第一次插上,只要直接通信,都会报ch343_update_status - unknown status received:len:10, data0:0xa1, data1:0x20这个。后续不会报。但是发数据就很奇怪