- if ( !mifare_ultra_auth(key) ) {\r
- OnError(1);\r
- return; \r
- }\r
- }\r
-\r
- // UL-EV1 / NTAG authentication\r
- if (usePwd) { \r
- uint8_t pwd[4] = {0x00};\r
- memcpy(pwd, datain, sizeof(pwd));\r
- uint8_t pack[4] = {0,0,0,0};\r
-\r
- if (!mifare_ul_ev1_auth(pwd, pack)){\r
- OnError(1);\r
- return; \r
- }\r
- }\r
- \r
- for (int i = 0; i < blocks; i++){\r
- if ((i*4) + 4 > CARD_MEMORY_SIZE) {\r
- Dbprintf("Data exceeds buffer!!");\r
- break;\r
- }\r
- \r