- // Receive the ATQA
- if(!ReaderReceive(resp)) return 0;
- // Dbprintf("atqa: %02x %02x",resp[0],resp[1]);
-
- if(p_hi14a_card) {
- memcpy(p_hi14a_card->atqa, resp, 2);
- p_hi14a_card->uidlen = 0;
- memset(p_hi14a_card->uid,0,10);
- }
+ //uint8_t deselect[] = {0xc2}; //DESELECT
+ //uint8_t halt[] = { 0x50, 0x00, 0x57, 0xCD }; // HALT
+ uint8_t wupa[] = { 0x52 }; // WAKE-UP
+ //uint8_t reqa[] = { 0x26 }; // REQUEST A
+ uint8_t sel_all[] = { 0x93,0x20 };
+ uint8_t sel_uid[] = { 0x93,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+ uint8_t rats[] = { 0xE0,0x80,0x00,0x00 }; // FSD=256, FSDI=8, CID=0
+ uint8_t *resp = ((uint8_t *)BigBuf) + RECV_RESP_OFFSET;
+ uint8_t *resp_par = ((uint8_t *)BigBuf) + RECV_RESP_PAR_OFFSET;
+
+ byte_t uid_resp[4];
+ size_t uid_resp_len;
+ uint8_t sak = 0x04; // cascade uid
+ int cascade_level = 0;
+ int len =0;
+
+ // test for the SKYLANDERS TOY.
+ // ReaderTransmit(deselect,sizeof(deselect), NULL);
+ // len = ReaderReceive(resp, resp_par);
+
+ // Broadcast for a card, WUPA (0x52) will force response from all cards in the field
+ ReaderTransmitBitsPar(wupa,7,0, NULL);
+
+ // Receive the ATQA
+ if(!ReaderReceive(resp, resp_par)) return 0;
+
+ if(p_hi14a_card) {
+ memcpy(p_hi14a_card->atqa, resp, 2);
+ p_hi14a_card->uidlen = 0;
+ memset(p_hi14a_card->uid,0,10);
+ }