讀取15693卡,IC讀卡器如下入所示:
15693卡片,通常指的是符合ISO/IEC 15693標(biāo)準(zhǔn)的非接觸式智能卡或RFID卡。以下是對(duì)15693卡片的詳細(xì)介紹:
一、基本概述
15693卡片是基于ISO/IEC 15693國(guó)際標(biāo)準(zhǔn)設(shè)計(jì)的非接觸式智能卡,該標(biāo)準(zhǔn)定義了用于非接觸式集成電路卡(即RFID卡)的物理特性、初始化及防沖突方法、傳輸協(xié)議以及傳輸規(guī)范。這種卡片通常用于門(mén)禁系統(tǒng)、圖書(shū)管理、身份識(shí)別、物流追蹤等多種應(yīng)用場(chǎng)景。
二、技術(shù)特點(diǎn)
工作頻率:15693卡片通常工作在13.56MHz的高頻頻段,這是RFID技術(shù)中常用的一個(gè)頻段,具有較遠(yuǎn)的讀寫(xiě)距離和較高的數(shù)據(jù)傳輸速率。
存儲(chǔ)容量:根據(jù)卡片類(lèi)型和芯片的不同,15693卡片的存儲(chǔ)容量會(huì)有所差異。一些卡片可能具有較小的存儲(chǔ)容量,如幾百字節(jié),而一些高級(jí)卡片則可能具有更大的存儲(chǔ)容量,以滿(mǎn)足更復(fù)雜的應(yīng)用需求。
數(shù)據(jù)傳輸:15693卡片采用非接觸式的數(shù)據(jù)傳輸方式,讀寫(xiě)器通過(guò)發(fā)射電磁波來(lái)激活卡片,并與卡片進(jìn)行數(shù)據(jù)傳輸。這種傳輸方式具有快速、準(zhǔn)確、可靠的特點(diǎn)。
安全性:15693卡片通常具有多種安全機(jī)制,如密碼保護(hù)、數(shù)據(jù)加密等,以確保卡片數(shù)據(jù)的安全性和完整性。這些安全機(jī)制可以有效地防止非法讀寫(xiě)和數(shù)據(jù)篡改。
三、應(yīng)用場(chǎng)景
門(mén)禁系統(tǒng):15693卡片可以作為門(mén)禁系統(tǒng)的身份識(shí)別工具,用于控制進(jìn)出特定區(qū)域的權(quán)限。
圖書(shū)管理:在圖書(shū)館中,15693卡片可以用于借閱證、讀者證等,方便讀者借閱圖書(shū)和管理個(gè)人信息。
身份識(shí)別:15693卡片還可以用于身份識(shí)別,如企業(yè)員工證、學(xué)生證等,用于驗(yàn)證身份和權(quán)限。
物流追蹤:在物流領(lǐng)域,15693卡片可以用于追蹤貨物的運(yùn)輸狀態(tài)和位置信息,提高物流管理的效率和準(zhǔn)確性。
四、市場(chǎng)現(xiàn)狀與發(fā)展趨勢(shì)
目前,隨著物聯(lián)網(wǎng)技術(shù)的快速發(fā)展和普及,15693卡片作為RFID技術(shù)的重要組成部分,在各個(gè)領(lǐng)域得到了廣泛的應(yīng)用。未來(lái),隨著技術(shù)的不斷進(jìn)步和應(yīng)用場(chǎng)景的不斷拓展,15693卡片的市場(chǎng)需求將會(huì)持續(xù)增長(zhǎng)。同時(shí),隨著人們對(duì)數(shù)據(jù)安全性的要求越來(lái)越高,15693卡片的安全機(jī)制也將不斷完善,以更好地滿(mǎn)足市場(chǎng)需求。
綜上所述,15693卡片作為一種重要的非接觸式智能卡或RFID卡,在各個(gè)領(lǐng)域具有廣泛的應(yīng)用前景和發(fā)展?jié)摿Α?/p>
QT小程序頁(yè)面:
QT代碼:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pb_beep_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; status = mypcdbeep(30); if(status==0){ } else { disperrinf(status); } } void MainWindow::on_pb_getdevnum_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char devicenumber[4]; unsigned char status; status = mypcdgetdevicenumber(devicenumber); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", QString::asprintf("設(shè)備編號(hào):%03d-%03d-%03d-%03d", devicenumber[0],devicenumber[1],devicenumber[2],devicenumber[3])); } else { disperrinf(status); } } void MainWindow::on_pb_easyread_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char ctrlword=0x00; //讀任何卡,不需指定卡號(hào),讀完后不靜止該卡,可賦值NEEDSERIAL及NEEDHALT的組合模式,或?yàn)? unsigned char afi; unsigned char myuid[8]; unsigned char startblock; unsigned char blocknum; unsigned char piccdatabuf[255]; ui->lineEdit_uid->setText(""); ui->plainTextEdit_data->setPlainText(""); QString afistr=ui->lineEdit_afi->text().trimmed(); if(afistr.length()==2 and checkinput(afistr)){ bool ok; afi=afistr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制AFI!"); ui->lineEdit_afi->setFocus(); return; } startblock=ui->spinBox_star->value(); blocknum=ui->spinBox_num->value(); if(blocknum>12){ QMessageBox::critical(NULL, "提示","一次最多只能讀取12塊數(shù)據(jù)!"); return; } status = myiso15693readex(ctrlword,afi,startblock,blocknum,myuid,piccdatabuf); if(status==0){ mypcdbeep(30); QString uidstr=""; for(int i=0;i8;i++){ uidstr=uidstr+QString::asprintf("%02X", myuid[i]); } ui-?>lineEdit_uid->setText(uidstr); QString datastr=""; for(int i=1;i<=piccdatabuf[0];i++){ datastr=datastr+QString::asprintf("%02X ", piccdatabuf[i]); } ui-?>plainTextEdit_data->setPlainText(datastr); QMessageBox::information(NULL, "提示", "讀卡成功,卡片UID:"+uidstr); } else { if(status==46){ QString uidstr=""; for(int i=0;i8;i++){ uidstr=uidstr+QString::asprintf("%02X", myuid[i]); } ui-?>lineEdit_uid->setText(uidstr); QMessageBox::information(NULL, "提示", "本次讀取的塊數(shù)超過(guò)卡片允許的一次讀取最多塊數(shù),讀取卡片UID:"+uidstr); }else{ disperrinf(status); } } } void MainWindow::on_pb_easywrite_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char ctrlword=0x00; //讀任何卡,不需指定卡號(hào),讀完后不靜止該卡,可賦值NEEDSERIAL及NEEDHALT的組合模式,或?yàn)? unsigned char afi=0x00; unsigned char myuid[8]; unsigned char startblock; unsigned char blocknum; unsigned char piccdatabuf[255]; unsigned char eachblocksize; ui->lineEdit_uid->setText(""); QString afistr=ui->lineEdit_afi->text().trimmed(); if(afistr.length()==2 and checkinput(afistr)){ bool ok; afi=afistr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制AFI!"); return; } startblock=ui->spinBox_star->value(); blocknum=ui->spinBox_num->value(); if(blocknum>12){ QMessageBox::critical(NULL, "提示","一次最多只能寫(xiě)12塊數(shù)據(jù)!"); return; } switch(ui->comboBox_cardtype->currentIndex()){ case 0: eachblocksize=4; break; case 1: eachblocksize=8; break; default: eachblocksize=32; break; } piccdatabuf[0]=blocknum*eachblocksize; //檢測(cè)寫(xiě)卡數(shù)據(jù) QChar ch; QString writinf = ui->plainTextEdit_data->toPlainText().trimmed(); QString writinf1 = ""; int m = 1; int n = 0; char s; if(writinf.length()1){ QMessageBox::critical(NULL, "提示", "請(qǐng)輸入正確的16進(jìn)制寫(xiě)卡數(shù)據(jù)!"); ui-?>plainTextEdit_data->setFocus(); return; } ch = writinf.at(0); s = writinf.at(0).toLatin1(); for(int i=0; i=49){ break; } } } else if(s == ' '){ } else { QMessageBox::critical(NULL, "提示", "寫(xiě)卡數(shù)據(jù)錯(cuò)誤,請(qǐng)輸入正確的16進(jìn)制數(shù)據(jù)!"); ui->plainTextEdit_data->setFocus(); return; } } if(m<=piccdatabuf[0]){ QMessageBox::critical(NULL, "提示", "寫(xiě)卡數(shù)據(jù)不足,請(qǐng)輸入"+QString::asprintf("錯(cuò)誤代碼:%d", piccdatabuf[0])+"個(gè)字節(jié)16進(jìn)制數(shù)據(jù)!"); ui-?>plainTextEdit_data->setFocus(); return; } status = myiso15693writeex(ctrlword,afi,startblock,blocknum,myuid,piccdatabuf); if(status==0){ mypcdbeep(30); QString uidstr=""; for(int i=0;i8;i++){ uidstr=uidstr+QString::asprintf("%02X", myuid[i]); } ui-?>lineEdit_uid->setText(uidstr); QMessageBox::information(NULL, "提示", "寫(xiě)卡成功,卡片UID:"+uidstr); } else { if(status==45){ QString uidstr=""; for(int i=0;i8;i++){ uidstr=uidstr+QString::asprintf("%02X", myuid[i]); } ui-?>lineEdit_uid->setText(uidstr); QMessageBox::information(NULL, "提示", "每塊字節(jié)數(shù)選錯(cuò),卡片UID:"+uidstr); }else{ disperrinf(status); } } } void MainWindow::on_pb_search1_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char afi; unsigned char maskuid[8]; //卡號(hào)掩碼,一般可以不理這個(gè)參數(shù) unsigned char masklen; unsigned char uid[9]; ui->lineEdit_uid->setText(""); ui->lineEdit_flags->setText("36"); flags=54; QString afistr=ui->lineEdit_afi->text().trimmed(); if(afistr.length()==2 and checkinput(afistr)){ bool ok; afi=afistr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制AFI!"); return; } QString masklstr=ui->lineEdit_masklen->text().trimmed(); if(masklstr.length()==2 and checkinput(masklstr)){ bool ok; masklen=masklstr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制掩碼長(zhǎng)度!"); return; } status = myiso15693inventory(flags, afi, masklen, maskuid, uid); if(status==0){ mypcdbeep(30); ui->lineEdit_dsfid->setText(QString::asprintf("%02X", uid[0])); QString uidstr=""; for(int i=1;i9;i++){ uidstr=uidstr+QString::asprintf("%02X", uid[i]); } ui-?>lineEdit_uid->setText(uidstr); }else{ disperrinf(status); } } void MainWindow::on_pb_searchall_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char afi; unsigned char maskuid[8]; //卡號(hào)掩碼,一般可以不理這個(gè)參數(shù) unsigned char masklen; unsigned char uid[9]; unsigned char revlen[1]; ui->lineEdit_uid->setText(""); ui->comboBox_uid->clear(); ui->lineEdit_flags->setText("16"); flags=22; QString afistr=ui->lineEdit_afi->text().trimmed(); if(afistr.length()==2 and checkinput(afistr)){ bool ok; afi=afistr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制AFI!"); ui->lineEdit_afi->setFocus(); return; } QString masklstr=ui->lineEdit_masklen->text().trimmed(); if(masklstr.length()==2 and checkinput(masklstr)){ bool ok; masklen=masklstr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制掩碼長(zhǎng)度!"); return; } status = myiso15693inventory16(flags, afi, masklen, maskuid,revlen, uid); if(status==0){ mypcdbeep(30); ui->lineEdit_dsfid->setText(QString::asprintf("%02X", uid[0])); QString uidstr=""; for(int i=1;i9;i++){ uidstr=uidstr+QString::asprintf("%02X", uid[i]); } ui-?>lineEdit_uid->setText(uidstr); // QStringList strlist; int j=0; while (jcomboBox_uid->addItem(cardinfstr); j=j+9; } // model = new QStringListModel(strlist); //QStringListModel將QStringList包裝了起來(lái) // ui->listView->setModel(model); //填充到listview // ui->listView->setEditTriggers(QAbstractItemView::NoEditTriggers); //設(shè)置item內(nèi)容不可編輯 }else{ disperrinf(status); } } void MainWindow::on_pb_quiet_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693stayquiet(flags, uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "操作成功,卡片已靜止!"); }else{ if(status==40){ QMessageBox::critical(NULL, "提示","使卡進(jìn)入靜止(Quiet)狀態(tài)失敗!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_select_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693Select(flags, uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "操作成功,卡片已在選中狀態(tài)!"); }else{ if(status==41){ QMessageBox::critical(NULL, "提示","使卡進(jìn)入選中狀態(tài)失敗!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_restare_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693resettoready(flags, uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "操作成功,卡片已從靜止中重起到準(zhǔn)備狀態(tài)!"); }else{ if(status==42){ QMessageBox::critical(NULL, "提示","讓卡從靜止中重起準(zhǔn)備失敗!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_afi_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char afi; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; QString afistr=ui->lineEdit_afi->text().trimmed(); if(afistr.length()==2 and checkinput(afistr)){ bool ok; afi=afistr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制AFI!"); ui->lineEdit_afi->setFocus(); return; } QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693writeafi(flags, afi,uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "寫(xiě)AIF操作成功!"); }else{ if(status==46){ QMessageBox::critical(NULL, "提示","寫(xiě)AIF操作失敗!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_dsfid_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char dsfid; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; QString dsfidstr=ui->lineEdit_dsfid->text().trimmed(); if(dsfidstr.length()==2 and checkinput(dsfidstr)){ bool ok; dsfid=dsfidstr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制dsfid!"); ui->lineEdit_dsfid->setFocus(); return; } QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693writedsfid(flags, dsfid,uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "寫(xiě)DSFID操作成功!"); }else{ if(status==41){ QMessageBox::critical(NULL, "提示","寫(xiě)DSFID操作失敗!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_systeminf_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char uid[8]; unsigned char revlen[1]; unsigned char revbuf[255]; ui->plainTextEdit_data->setPlainText(""); ui->lineEdit_flags->setText("22"); flags=34; QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693readinfo(flags, uid,revlen,revbuf); if(status==0){ mypcdbeep(30); int j=0; QString cardinfstr=""; while (jplainTextEdit_data->setPlainText(cardinfstr); QMessageBox::information(NULL, "提示", "讀取卡片系統(tǒng)信息成功!"); }else{ disperrinf(status); } } void MainWindow::on_pb_secure_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char startblock; unsigned char blocknum; unsigned char uid[8]; unsigned char revlen[1]; unsigned char revbuf[255]; ui->plainTextEdit_data->setPlainText(""); ui->lineEdit_flags->setText("22"); flags=34; startblock=ui->spinBox_star->value(); blocknum=ui->spinBox_num->value(); QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693readsecuritystate(flags, startblock,blocknum,uid,revlen,revbuf); if(status==0){ mypcdbeep(30); int j=0; QString cardinfstr=""; while (jplainTextEdit_data->setPlainText(cardinfstr); QMessageBox::information(NULL, "提示", "讀取卡片系統(tǒng)信息成功!"); }else{ disperrinf(status); } } void MainWindow::on_pb_lockafi_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 int answ=QMessageBox::question (this, "警告", "你確定要鎖定卡片的AFI嗎 ?鎖定后不可以再次修改!", QMessageBox::Ok, QMessageBox::Cancel); if (answ ==1024){ unsigned char status; unsigned char flags; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693lockafi(flags, uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "鎖AFI操作成功!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_lockdsfid_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 int answ=QMessageBox::question (this, "警告", "你確定要鎖定卡片的DSFID嗎 ?鎖定后不可以再次修改!", QMessageBox::Ok, QMessageBox::Cancel); if (answ ==1024){ unsigned char status; unsigned char flags; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693lockdsfid(flags, uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "數(shù)據(jù)存儲(chǔ)格式標(biāo)識(shí)DSFID鎖定成功!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_lockdata_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 int answ=QMessageBox::question (this, "警告", "你確定要鎖定卡片的數(shù)據(jù)塊嗎 ?鎖定后不可以再次修改!", QMessageBox::Ok, QMessageBox::Cancel); if (answ ==1024){ unsigned char status; unsigned char flags; unsigned char startblock; unsigned char uid[8]; ui->lineEdit_flags->setText("22"); flags=34; startblock=ui->spinBox_star->value(); QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } status = myiso15693lockblock(flags,startblock, uid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "數(shù)據(jù)塊鎖定成功!"); }else{ disperrinf(status); } } } void MainWindow::on_pb_read_clicked() { if(!checkdllos()){return;} //判斷運(yùn)行目錄內(nèi)動(dòng)態(tài)庫(kù)文件是否存在 unsigned char status; unsigned char flags; unsigned char startblock; unsigned char blocknum; unsigned char uid[8]; unsigned char revlen[1]; unsigned char revbuf[255]; ui->plainTextEdit_data->setPlainText(""); ui->lineEdit_flags->setText("22"); flags=34; startblock=ui->spinBox_star->value(); blocknum=startblock+ui->spinBox_num->value(); QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ bool ok; for(int i=0;i8;i++){ uid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)先尋找卡片或輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } QString blockdata=""; while (startblocklineEdit_afi->text().trimmed(); if(afistr.length()==2 and checkinput(afistr)){ bool ok; afi=afistr.toInt(&ok,16); }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入2位16進(jìn)制AFI!"); ui->lineEdit_afi->setFocus(); return; } QString uidstr=ui->lineEdit_uid->text().trimmed(); if(uidstr.length()==16 and checkinput(uidstr)){ for(int i=0;i9;i++){ bool ok; newuid[i]=QString(uidstr.mid(i*2,2)).toInt(&ok,16); } }else{ QMessageBox::critical(NULL, "提示","請(qǐng)輸入16位16進(jìn)制UID!"); ui-?>lineEdit_uid->setFocus(); return; } if(myiso15693writeuid!=NULL){ status = myiso15693writeuid(ctrlword,afi,olduid,newuid); if(status==0){ mypcdbeep(30); QMessageBox::information(NULL, "提示", "寫(xiě)卡成功,卡片UID:"+uidstr); } else { if(status==45){ QMessageBox::critical(NULL, "提示", "寫(xiě)UID失敗,此卡UID不可以改寫(xiě)!"); }else{ disperrinf(status); } } }else{ QMessageBox::critical(NULL, "提示", "myiso15693writeuid函數(shù)未正確載入!"); } } 審核編輯 黃宇
-
usb
+關(guān)注
關(guān)注
60文章
7950瀏覽量
264860 -
讀寫(xiě)器
+關(guān)注
關(guān)注
3文章
662瀏覽量
38870 -
Qt
+關(guān)注
關(guān)注
1文章
307瀏覽量
37941
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論