使用以下代码时:
Private Sub DataReceivedHandler(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs)
Dim sp As SerialPort = CType(sender, SerialPort)
Debug.WriteLine("DataReceivedHandler() - Data Received! number of bytes=" & sp.BytesToRead)
Dim indata As String = sp.ReadExisting()
Debug.WriteLine("DataReceivedHandler() - indata=" & TTSHelperFunctions.StringToHex(indata))
End Sub
什么可能导致sp.BytesToRead
指示的字节数比indata
在调试输出中显示变量时少?