Commit 5a11e644 ke.sun

调试修改

1 个父辈 dd37b5ee
...@@ -339,14 +339,14 @@ namespace OnlineStore.Common ...@@ -339,14 +339,14 @@ namespace OnlineStore.Common
if (_serialPort.IsOpen) if (_serialPort.IsOpen)
{ {
lock (_serialPort) lock (lockObj)
{ {
try try
{ {
_serialPort.DiscardInBuffer(); //清空接收缓冲区 _serialPort.DiscardInBuffer(); //清空接收缓冲区
_serialPort.Write(SendData, 0, SendData.Length); _serialPort.Write(SendData, 0, SendData.Length);
int num = 0, ret = 0; int num = 0, ret = 0;
System.Threading.Thread.Sleep(10); //System.Threading.Thread.Sleep(10);
if (ReceiveData == null) if (ReceiveData == null)
{ {
ReceiveData = new byte[ReceiveLength]; ReceiveData = new byte[ReceiveLength];
...@@ -359,7 +359,7 @@ namespace OnlineStore.Common ...@@ -359,7 +359,7 @@ namespace OnlineStore.Common
break; break;
System.Threading.Thread.Sleep(1); System.Threading.Thread.Sleep(1);
} }
if (i >= 100) if (i >= Overtime)
{ {
LogUtil.info("等待超时"); LogUtil.info("等待超时");
} }
......
...@@ -192,7 +192,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -192,7 +192,7 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
byte[] returnData = SendCommand(portName, data, 100, reviceLength); byte[] returnData = SendCommand(portName, data, 50, reviceLength);
string strSend = ""; string strSend = "";
for (int i = 0; i < returnData.Length; i++) for (int i = 0; i < returnData.Length; i++)
{ {
...@@ -230,7 +230,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -230,7 +230,7 @@ namespace OnlineStore.DeviceLibrary
//} //}
//bean.SendData(data, 0, data.Length); //bean.SendData(data, 0, data.Length);
byte[] returnData = SendCommand(portName, data, 100, 8); byte[] returnData = SendCommand(portName, data, 50, 8);
string strSend = ""; string strSend = "";
for (int i = 0; i < returnData.Length; i++) for (int i = 0; i < returnData.Length; i++)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!