Retry lấy số tiền trong két
Hiển thị giao dịch trong log
This commit is contained in:
+12
-3
@@ -12,6 +12,7 @@ using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.ServiceProcess;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -267,9 +268,17 @@ namespace SafeBagDE70
|
||||
}
|
||||
public static byte[] GetCassetteData()
|
||||
{
|
||||
cCmdRsp.SendXXCmd((byte)Command.CMD_DE_READ_CASSETTE);
|
||||
for(int i = 0; i < 2; i++)//Retry if failed
|
||||
{
|
||||
cCmdRsp.SendXXCmd((byte)Command.CMD_DE_READ_CASSETTE);
|
||||
if (cCmdRsp.recv_dat.dat[0] != 0x40)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
var data = cCmdRsp.recv_dat.dat;
|
||||
|
||||
StringBuilder str = new StringBuilder();
|
||||
var recv_dat = cCmdRsp.recv_dat;
|
||||
|
||||
@@ -477,7 +486,7 @@ namespace SafeBagDE70
|
||||
Log.Error("GetandExecuteCommands error: "+str);
|
||||
}
|
||||
}
|
||||
static string deviceStatusFileName = "device_status.txt";
|
||||
static string deviceStatusFileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),"device_status.txt");
|
||||
public static void GetDeviceStatusFromFile()
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user