while (bytesRd < byteExpctd) { bytesRd += serialPort.Read(Req, bytesRd, byteExpctd - bytesRd); //serialPort.ReadTimeout = 80; } byteExpctd = (int)Req[1]; while (bytesRd < byteExpctd) { bytesRd += serialPort.Read(Req, bytesRd, byteExpctd - bytesRd); } if (Req[0] == 0x14 && Req[0] == 0x06) { AckMsg[0] = 0x0B; AckMsg[1] = 0x06; AckMsg[2] = 0xA4; AckMsg[3] = CheckSum(AckMsg); serialPort.Write(AckMsg, 0, 5); } else { // code for something } Thread.sleep(1000); RsltMsg[0] = 0x9F; RsltMsg[1] = 0x05; RsltMsg[2] = 0x19; RsltMsg[3] = CheckSum(RsltMsg); serialPort.Write(RsltMsg, 0, 3);
Thread.Sleep(1000);
Thread.Sleep(1000 * 60);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)