X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/a62bf3afe1732a8c111bb8687da4f536c86f73ec..9833360b251571f82749c352f49d712c9c8322ad:/armsrc/epa.c diff --git a/armsrc/epa.c b/armsrc/epa.c index 737e633f..246393b7 100644 --- a/armsrc/epa.c +++ b/armsrc/epa.c @@ -10,11 +10,7 @@ // the card (with iso14443a_select_card etc.). If You want to use these // functions, You need to do the setup before calling them! //----------------------------------------------------------------------------- - -#include "iso14443a.h" -#include "iso14443b.h" #include "epa.h" -#include "cmd.h" // Protocol and Parameter Selection Request for ISO 14443 type A cards // use regular (1x) speed in both directions @@ -102,7 +98,7 @@ static struct { static uint8_t apdu_lengths_replay[5]; // type of card (ISO 14443 A or B) -static char iso_type = 0; +static char iso_type; //----------------------------------------------------------------------------- // Wrapper for sending APDUs to type A and B cards @@ -523,30 +519,31 @@ int EPA_Setup() uint8_t uid[10]; uint8_t pps_response[3]; uint8_t pps_response_par[1]; - iso14a_card_select_t card_select_info; + iso14a_card_select_t card_a_info; + iso14b_card_select_t card_b_info; // first, look for type A cards // power up the field iso14443a_setup(FPGA_HF_ISO14443A_READER_MOD); // select the card - return_code = iso14443a_select_card(uid, &card_select_info, NULL); + return_code = iso14443a_select_card(uid, &card_a_info, NULL, true, 0); if (return_code == 1) { - // send the PPS request - ReaderTransmit((uint8_t *)pps, sizeof(pps), NULL); - return_code = ReaderReceive(pps_response, pps_response_par); - if (return_code != 3 || pps_response[0] != 0xD0) { - return return_code == 0 ? 2 : return_code; - } + // send the PPS request + ReaderTransmit((uint8_t *)pps, sizeof(pps), NULL); + return_code = ReaderReceive(pps_response, pps_response_par); + if (return_code != 3 || pps_response[0] != 0xD0) { + return return_code == 0 ? 2 : return_code; + } Dbprintf("ISO 14443 Type A"); iso_type = 'a'; - return 0; + return 0; } // if we're here, there is no type A card, so we look for type B // power up the field iso14443b_setup(); // select the card - return_code = iso14443b_select_card(); + return_code = iso14443b_select_card( &card_b_info ); if (return_code == 1) { Dbprintf("ISO 14443 Type B"); iso_type = 'b';