压力算法移植前
This commit is contained in:
+12
-7
@@ -236,6 +236,10 @@ QByteArray RFIDManager::buildMarkCardCommand(int block, int cardType)
|
||||
Cmd[6] = 0x10;
|
||||
Cmd[7] = 0x0B;
|
||||
}
|
||||
else if(cardType == 2) {
|
||||
Cmd[6] = 0x10;
|
||||
Cmd[7] = 0x0C;
|
||||
}
|
||||
#endif
|
||||
CheckSumOut(Cmd, Cmd[1]);
|
||||
|
||||
@@ -250,13 +254,14 @@ bool RFIDManager::verifyWriteResponse(const QByteArray &recResponse, QString not
|
||||
return false;
|
||||
}
|
||||
|
||||
int n = comForRFID->bytesAvailable();
|
||||
if(n < 8) {
|
||||
qDebug() << "读取数据失败, 数据长度不足8字节" << endl << endl;
|
||||
return false;
|
||||
}
|
||||
// int n = comForRFID->bytesAvailable();
|
||||
// if(n < 8) {
|
||||
// qDebug() << "读取数据失败, 数据长度不足8字节" << endl << endl;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
UCHAR revdata[100];
|
||||
int n = recResponse.size();
|
||||
if (n > sizeof(revdata)) return false;
|
||||
memcpy(revdata, recResponse.constData(), n);
|
||||
|
||||
@@ -304,8 +309,8 @@ int RFIDManager::RFIDmarkCardUsedAsync(int type)
|
||||
}
|
||||
|
||||
// 临时断开信号,避免干扰
|
||||
bool wasConnected = disconnect(comForRFID, &QSerialPort::readyRead,
|
||||
this, &RFIDManager::slt_readRFIDData);
|
||||
bool wasConnected = comForRFID->disconnect(this);
|
||||
wasConnected = true;
|
||||
|
||||
// 清空缓冲区
|
||||
comForRFID->clear(QSerialPort::Input);
|
||||
|
||||
Reference in New Issue
Block a user