2012-08-10 34 views
6

¿Existe alguna manera confiable de averiguar si una tarjeta RFID es una Mifare Ultralight o una Mifare Ultralight C?Distinguir a Mifare Ultralight de Mifare Ultralight C

La única forma que encontré hasta ahora es utilizar la diferencia en el tamaño de esas dos tarjetas emitiendo un comando de lectura más allá de los límites de la más pequeña. Pero parece un truco y supongo que el comando de lectura podría fallar si la tarjeta utiliza el mecanismo de autenticación Ultralight C.

const char* mifare_ultralight_identification(const nfc_target_info_t nti) 
{ 
    byte_t abtCmd[2]; 
    byte_t abtRx[265]; 
    size_t szRxLen; 

    abtCmd[0] = 0x30; // MIFARE Ultralight READ command 
    abtCmd[1] = 0x10; // block address (1K=0x00..0x39, 4K=0x00..0xff) 

    if (!nfc_initiator_transceive_dep_bytes(pnd,abtCmd,2,abtRx,&szRxLen)) { 
    // READ command of 0x10 failed, we consider that Ultralight does have 0x10 address, so it's a "simple" Ultralight (i.e. not a Ultralight C) 
    // When a READ failed, the tag returns in HALT state, so we need to reselect tag 
    nfc_initiator_select_passive_target(pnd, NM_ISO14443A_106, nti.nai.abtUid, nti.nai.szUidLen, NULL); 
    return ""; 
    } 
    return " C"; 
} 

Source

Respuesta

5

Sí, es posible, si usted tiene la documentación sobre cómo funciona el mecanismo de autenticación MIFARE Ultralight C. MIFARE Ultralight no es compatible con esto, por lo que generará una condición de error.

+0

Ese fue mi segundo pensamiento también. Sin embargo, el uso de un comando que no existe en uno de ellos todavía es una solución. Pero parece que no hay una manera limpia de hacerlo. – mibollma

+0

Sí, es la forma más sencilla y confiable. –

-1

Una vez que esté bajo el NDA y obtenga acceso a las hojas de datos completas, verá una sección que describe cómo diferenciar un Mifare Ultralight C de otras etiquetas de Mifare.

+0

No encontré esta sección. ¿Podría decir a qué documento se refiere? (Eché un vistazo a 137631 y no encontré nada). ¡Gracias! – kdmin

Cuestiones relacionadas