int cascade_level = 0;
int len;
+ // init card struct
+ if(p_hi14a_card) {
+ p_hi14a_card->uidlen = 0;
+ memset(p_hi14a_card->uid, 0, 10);
+ p_hi14a_card->ats_len = 0;
+ }
+
// Broadcast for a card, WUPA (0x52) will force response from all cards in the field
ReaderTransmitBitsPar(wupa, 7, NULL, NULL);
if(p_hi14a_card) {
memcpy(p_hi14a_card->atqa, resp, 2);
- p_hi14a_card->uidlen = 0;
- memset(p_hi14a_card->uid,0,10);
}
if (anticollision) {
if(p_hi14a_card) {
p_hi14a_card->sak = sak;
- p_hi14a_card->ats_len = 0;
}
// non iso14443a compliant tag
size_t lenbits = c->arg[1] >> 16;
uint32_t timeout = c->arg[2];
uint32_t arg0 = 0;
- byte_t buf[USB_CMD_DATA_SIZE];
+ byte_t buf[USB_CMD_DATA_SIZE] = {0};
uint8_t par[MAX_PARITY_SIZE];
if(param & ISO14A_CONNECT) {
if (WaitForResponseTimeout(CMD_ACK,&resp,1500)) {
recv = resp.d.asBytes;
- uint8_t iLen = iSelect ? resp.arg[1] : resp.arg[0];
- PrintAndLog("received %i octets", iLen);
+ uint8_t iLen = resp.arg[0];
+ if (iSelect){
+ iLen = resp.arg[1];
+ if (iLen){
+ PrintAndLog("Card selected. UID[%i]:", iLen);
+ } else {
+ PrintAndLog("Can't select card.");
+ }
+ } else {
+ PrintAndLog("received %i bytes:", iLen);
+ }
if(!iLen)
return;
hexout = (char *)malloc(iLen * 3 + 1);