用的是這個代碼。
編譯正常。能正常識別到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:/]#?
發(fā)數(shù)據(jù)的時候會出現(xiàn)多出2個數(shù)據(jù)。
這是什么原因?qū)е碌?。而且每次第一次插上,只要直接通信,都會報ch343_update_status - unknown status received:len:10, data0:0xa1, data1:0x20這個。后續(xù)不會報。但是發(fā)數(shù)據(jù)就很奇怪