串口缓冲区里的数据是0
往串口机子发出命令时,其命令格式符合了要求规格,但是并没有收到返回值,缓冲区里的数据是0,很是郁闷,不知道是什么原因?
源代码如下:
public short DrfGetFirmwareVersion()
{
short result = -1;
byte[] blockWrite = new byte[5] { 0xAA, 0xFF, 0x02, 0x66, 0x00 };
result = this.spt.Write(blockWrite, 0, blockWrite.Length);
byte[] blockRead = new byte[7];
result = this.spt.Read(blockRead, 0, blockRead.Length);
MessageBox.Show(this.spt.BytesToRead.ToString() + ";" + this.spt.BytesToWrite.ToString() + ";"
return result;
}