// perform read
// write the result to the provided card
if(!emv_readrecord(record,sfi,receivedAnswer)) {
- if(EMV_DBGLEVEL >= 1) Dbprintf("readrecord failed");
+ if(MF_DBGLEVEL >= 1) Dbprintf("readrecord failed");
}
if(*(receivedAnswer+1) == 0x70){
decode_ber_tlv_item(receivedAnswer+1, &inputtag);
}
else
{
- if(EMV_DBGLEVEL >= 1)
+ if(MF_DBGLEVEL >= 1)
Dbprintf("Record not found SFI=%i RECORD=%i", sfi, record);
}
return;
tlvtag inputtag; // create the tag structure
// perform select
if(!emv_select(AID, AIDlen, receivedAnswer)){
- if(EMV_DBGLEVEL >= 1) Dbprintf("AID Select failed");
+ if(MF_DBGLEVEL == 1) Dbprintf("AID Select failed");
return;
}
// write the result to the provided card
if(currentcard.tag_61_len !=0){
emv_decode_field(currentcard.tag_61, currentcard.tag_61_len, ¤tcard);}
}
- if(EMV_DBGLEVEL >= 2)
+ if(MF_DBGLEVEL >= 2)
DbpString("SELECT AID COMPLETED");
}
tlvtag inputtag; //create the tag structure
// perform pdol
if(!emv_getprocessingoptions(PDOL, PDOLlen, receivedAnswer)){
- if(EMV_DBGLEVEL >= 1) Dbprintf("get processing options failed");
+ if(MF_DBGLEVEL >= 1) Dbprintf("get processing options failed");
return 0;
}
// write the result to the provided card
// store 82 and 94 tags (AIP, AFL)
emv_decode_field(inputtag.value, inputtag.valuelength, ¤tcard);
}
- if(EMV_DBGLEVEL >= 2)
+ if(MF_DBGLEVEL >= 2)
DbpString("GET PROCESSING OPTIONS COMPLETE");
return 1;
}
// tlvtag inputtag; //create the tag structure
// perform select
if(!emv_getchallenge(receivedAnswer)){
- if(EMV_DBGLEVEL >= 1) Dbprintf("get processing options failed");
+ if(MF_DBGLEVEL >= 1) Dbprintf("get processing options failed");
return 1;
}
return 0;
// tlvtag inputtag; //create the tag structure
// perform select
if(!emv_generateAC(refcontrol, cdolcommand, cdolcommandlen,receivedAnswer)){
- if(EMV_DBGLEVEL >= 1) Dbprintf("get processing options failed");
+ if(MF_DBGLEVEL >= 1) Dbprintf("get processing options failed");
return 1;
}
if(receivedAnswer[2] == 0x77) //format 2 data field returned
cardMode = VISA_FDDA;
}
else if((currentcard.tag_9F66[0] & 0x80) == 0x80) {
- if((currentcard.tag_9F66[1] & 0x80) == 1) { //CVN17
+ if((currentcard.tag_9F66[1] & 0x80) == 0x80) { //CVN17
cardMode = VISA_CVN17;
} else {
cardMode = VISA_DCVV;
Dbhexdump(pdolcommandlen, pdolcommand,false);
if(!EMVGetProcessingOptions(pdolcommand,pdolcommandlen, ¤tcard)) {
- if(EMV_DBGLEVEL >= 1) Dbprintf("PDOL failed");
+ if(MF_DBGLEVEL >= 1) Dbprintf("PDOL failed");
return 1;
}
emv_generateDOL(currentcard.tag_9F38, currentcard.tag_9F38_len, ¤tcard, pdolcommand, &pdolcommandlen);
}
if(EMVGetProcessingOptions(pdolcommand,pdolcommandlen, ¤tcard)) {
- if(EMV_DBGLEVEL >= 1) Dbprintf("PDOL failed");
+ if(MF_DBGLEVEL >= 1) Dbprintf("PDOL failed");
return 1;
}
while(true) {
if(!iso14443a_select_card(uid, NULL, &cuid, true, 0)) {
- if(EMV_DBGLEVEL >= 1) Dbprintf("Can't select card");
+ if(MF_DBGLEVEL >= 1) Dbprintf("Can't select card");
break;
}
//selectPPSE
//TODO: add other card schemes like AMEX, JCB, China Unionpay etc
break;
}
- if (EMV_DBGLEVEL >= 2) DbpString("EMV TRANSACTION FINISHED");
+ if (MF_DBGLEVEL >= 2) DbpString("EMV TRANSACTION FINISHED");
//finish up
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
LEDsoff();