Commit 01c48d90 by NitefullWind

1. 修改默认账号读取。

parent c970d0e8
......@@ -4,7 +4,7 @@
#include <QDebug>
#include <iostream>
#define OldSector 2
#define OldSector 4
bool ConnectDevice(int port, int baud, int sector, const QString password, HANDLE &handle, QString &error)
{
......@@ -81,6 +81,7 @@ bool ReadCard(const HANDLE handle, int sector, QString &vipNo, QString& uuid, QS
// error = "check key_data error";
// return false;
// }
rf_halt(handle);
rf_beep(handle,30);
return true;
}
......@@ -111,16 +112,15 @@ bool ActivateCard(const HANDLE handle, int sector, const QString newPassword, QS
return false;
}
// 读卡
unsigned char rdata[17];
ZeroMemory(rdata,17);
st = rf_read(handle, OldSector*4, rdata);
char rdata[32];
ZeroMemory(rdata,32);
st = rf_read_hex(handle, OldSector*4, rdata);
if(st!=0)
{
error = "read default card no error";
return false;
}
vipNo = QByteArray((char*)rdata);
vipNo = QByteArray(rdata).mid(16);
// 将卡号写入传入的扇区
// 鉴权
st = rf_authentication(handle, 0, sector);
......@@ -176,6 +176,7 @@ bool ActivateCard(const HANDLE handle, int sector, const QString newPassword, QS
// }
rf_halt(handle);
rf_beep(handle,30);
return true;
}
......@@ -212,6 +213,7 @@ bool WriteCard(const HANDLE handle, int sector, QString data, QString &error)
return false;
}
rf_halt(handle);
rf_beep(handle,30);
return true;
}
......
......@@ -4,7 +4,7 @@
#include <QDebug>
#include <QCryptographicHash>
#define ReadS 2
#define ReadS 4
#if 1
#define ReadP "ffffffffffff"
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment