|
@@ -2864,6 +2864,11 @@ namespace MOKA_Factory_Tools
|
|
|
byte[] receive2Data = new byte[20480];
|
|
|
//划一个空间用来存放实际长度
|
|
|
int reallyLength=Comport.Read(receive2Data, 0,20480);
|
|
|
+ if ( reallyLength <= 0 )
|
|
|
+ {
|
|
|
+ Log.WriteErrorLog("Received Nothing.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
//CRC校验
|
|
|
byte crcHighByte = receive2Data[reallyLength - 2];
|
|
|
byte crcLowByte = receive2Data[reallyLength - 1];
|