+ len = ulev1_getVersion(version, sizeof(version));
+ if (len > -1) ul_switch_off_field(); //if -1 it is already off
+
+ switch (len) {
+ case 0x0A: {
+
+ if ( version[2] == 0x03 && version[6] == 0x0B )
+ tagtype = UL_EV1_48;
+ else if ( version[2] == 0x03 && version[6] != 0x0B )
+ tagtype = UL_EV1_128;
+ else if ( version[2] == 0x04 && version[6] == 0x0F )
+ tagtype = NTAG_213;
+ else if ( version[2] == 0x04 && version[6] == 0x11 )
+ tagtype = NTAG_215;
+ else if ( version[2] == 0x04 && version[6] == 0x13 )
+ tagtype = NTAG_216;
+ else if ( version[2] == 0x04 )
+ tagtype = NTAG;
+
+ break;
+ }
+ case 0x01: tagtype = UL_C; break;
+ case 0x00: tagtype = UL; break;
+ case -1 : tagtype = (UL | UL_C); break; //when does this happen?
+ default : tagtype = UNKNOWN; break;
+ }
+ if (tagtype == (UL | UL_C)) {
+ status = ul_select(&card);
+ if ( status < 1 ){
+ PrintAndLog("Error: couldn't select 2");
+ ul_switch_off_field();
+ return UL_ERROR;
+ }
+ uint8_t nonce1[11] = {0x00};
+ status = ulc_requestAuthentication(0, nonce1, sizeof(nonce1));
+ if ( status > 0 )
+ tagtype = UL_C;
+ else
+ tagtype = UL;
+
+ if (status != -1) ul_switch_off_field();
+ }
+ } else {
+ // Infinition MY-D tests Exam high nibble
+ uint8_t nib = (card.uid[1] & 0xf0) >> 4;
+ switch ( nib ){
+ case 1: tagtype = MY_D; break;
+ case 2: tagtype = (MY_D | MY_D_NFC); break;
+ case 3: tagtype = (MY_D_MOVE | MY_D_MOVE_NFC); break;