change - RFID条码解析修改

master
wenjy 1 month ago
parent 96ff56e84f
commit 60b79724b3

@ -96,7 +96,7 @@ namespace SlnMesnac.TouchSocket
if(result != "多条码" && result != "noread" && result != "NoRead" && !string.IsNullOrEmpty(result)) if(result != "多条码" && result != "noread" && result != "NoRead" && !string.IsNullOrEmpty(result))
{ {
isOk = "Ok"; isOk = "OK";
}else if(result == "多条码") }else if(result == "多条码")
{ {
isOk = "Mul"; isOk = "Mul";
@ -257,10 +257,23 @@ namespace SlnMesnac.TouchSocket
{ {
if(rfidStr != "noread") if(rfidStr != "noread")
{ {
string bufferHex = rfidStr.Substring(bufferStart.Length, bufferBody.Length); int hexLength = Convert.ToInt32(rfidStr.Substring(4, 2));
string bufferHex = rfidStr.Substring(bufferStart.Length, hexLength * 2);
long decimalValue = Convert.ToInt64(bufferHex, 16); long decimalValue = Convert.ToInt64(bufferHex, 16);
//if (rfidStr.Contains("0C2"))
//{
// rfidStr = decimalValue.ToString().PadLeft(10, '0');
//}
//else
//{
// rfidStr = decimalValue.ToString();
//}
rfidStr = decimalValue.ToString(); rfidStr = decimalValue.ToString();
} }
} }

Loading…
Cancel
Save