- if((length = ReaderReceiveIClass(resp))) {
- if(length == 10) {
- // Select card
- memcpy(&select[1],resp,8);
- ReaderTransmitIClass(select, sizeof(select));
-
- if((length = ReaderReceiveIClass(resp))) {
- if(length == 10) {
- rotateCSN(check_csn,&select[1],1);
- csn_failure = FALSE;
- for(i = 0; i < 8; i++) {
- if(check_csn[i] != resp[i]) {
- csn_failure = TRUE;
- break;
- }
- }
-
- if(!csn_failure) {
- Dbprintf(" Selected CSN: %02x %02x %02x %02x %02x %02x %02x %02x",
- check_csn[0], check_csn[1], check_csn[2],
- check_csn[3], check_csn[4], check_csn[5],
- check_csn[6], check_csn[7]);
- }
- // Card selected, whats next... ;-)
-
- }
- }
+ if(ReaderReceiveIClass(resp) == 10) {
+ // Select card
+ memcpy(&select[1],resp,8);
+ ReaderTransmitIClass(select, sizeof(select));
+
+ if(ReaderReceiveIClass(resp) == 10) {
+ Dbprintf(" Selected CSN: %02x %02x %02x %02x %02x %02x %02x %02x",
+ resp[0], resp[1], resp[2],
+ resp[3], resp[4], resp[5],
+ resp[6], resp[7]);