Commit 5a11e644 ke.sun

调试修改

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