×

Discussion Board

Results 1 to 9 of 9

Hybrid View

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Access Mifare classic 7 byte UID on Nokia 6131

    Fellow Developers,

    We are working on Contactless card reader application for Nokia 6131.We are working with the 4 byte MifareClassic cards.But now have a requirement to support 7 byte UID on the same cards.

    Till now i am using MFStandardConnection Interface to get the 4 Byte UID of MifareClassic card.

    Now i have to get 7 Byte UID of MifareClassic 7 Byte UID cards.

    GetUID method on MFStandardConnection Interface returns only 4 byte UID so i am unable use it now.

    Does any one know on how to get access to Mifare classic 7 Byte UID,what interfaces,methods etc.

    Appreciate your help,

    Urmila

  2. #2
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Access Mifare classic 7 byte UID on Nokia 6131

    Hallo Urmila,

    the UID is stored in the first 7 bytes of the first block of the MIFARE card. Thus, if you have read access to this block you could read the UID from there using the MFStandardConnection.

    br,
    Michael

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Re: Access Mifare classic 7 byte UID on Nokia 6131

    Michael,

    Thanks for the response.
    We tried the same with the MFStandardConnection already.But please note the documentation available on the

    http://library.developer.nokia.com/i...urerBlock.html

    getUID
    byte[] getUID()

    Returns the serial number of the card as a byte array. The bytes in the returned array are in the same order as these are in the raw contents of manufacturer block. The length of the array is always 4.

    As they have hardcoded the number 4,do we have a new interface to access the 7 byte cards?

  4. #4
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Access Mifare classic 7 byte UID on Nokia 6131

    Hallo,

    this was not quite what I meant. I actually thought about using the read() method to access that data. Something like this:

    MFStandardConnection mfcon = ...;
    MFSector sector0 = mfcon.getSector(0);
    MFBlock block0 = sector0.getBlock(0);
    byte[] mfdata = new byte[] {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
    int readlen = block0.read(mfkey, mfdata, 0, 0, 16);

    Now the UID should be the first 7 bytes of mfdata. (Of course you need to use a valid mfkey for your card.)

    Another idea that came to my mid when reading the API documentation was the following:
    Using the MFStandardCOnnection's MFManufacturerBlock, you have the method getUID() for which the documentation states that it always returns 4 bytes. But you also have the methods getManufacturerData() (for which the documentation states that it always returns 11 bytes) and getCheckByte() which returns 1 byte. If these methods do what they promise, in total, you have all the bytes of the manufacturer block. So if you join these 16 bytes, the first 7 of them should be the UID.

    br
    Michael

  5. #5
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    Re: Access Mifare classic 7 byte UID on Nokia 6131

    Michael,

    thanks for the suggestion.

    i tried what you have suggested.
    but before read the card data we have to open the connection.
    while opening the connection (MFStandardConnection) Connector.open(nfc:rf;type=mf1k;uid=04ae4009321b84);
    i am getting the exception.
    the value "nfc:rf;type=mf1k;uid=04ae4009321b84" we are getting from the card when TargeDetectedmethod() triggered.

    even though we are getting uid in the above statement,to access the card data this connection should be opened.


    for 4 byte UID cards we are getting the url value as "nfc:rf;type=mf1k;uid=ebe13abc". and we are able to open the conneciton and accessing the card data.

    do you think that nokia MFStandardConnection interface does not support 7 byte UID?.

    or

    anything else needs to be done.

    please suggest.

    Thanks,
    Urmila.

  6. #6
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Access Mifare classic 7 byte UID on Nokia 6131

    Hallo Urmila,

    I've done some testing now. It seems as if there was a bug in the Connector.open() method which prevents opening a connection to such cards (actually the connection seems to be opened but an exception is thrown before a MFStandardConnection object is returned). The TargetProperties object returns the correct URI and the TargetProperties object's getUid() method returns the complete UID (7 bytes!) but trying to open a connection to the card will fail with an IOException. (Tested on both Nokia 6131 & 6212.)

    So you should be able to get the UID (from the TargetProperties) but you won't be able to access the tag's data.

    br
    Michael

  7. #7
    Registered User
    Join Date
    Jul 2012
    Posts
    3

    Re: Access Mifare classic 7 byte UID on Nokia 6131

    Hi everyone

    Current Mifare card that support 7 byte of UID therefore Nokia API couldn't establish connection like MFStandardConnection.
    Is there any idea to make connection and call targetdetected Method while RFID card reading.

    Please replay soon

    Thank you,

  8. #8
    Registered User
    Join Date
    Jul 2012
    Posts
    12

    Re: Access Mifare classic 7 byte UID on Nokia 6131

    Quote Originally Posted by NFC dev View Post
    Hi everyone

    Current Mifare card that support 7 byte of UID therefore Nokia API couldn't establish connection like MFStandardConnection.
    Is there any idea to make connection and call targetdetected Method while RFID card reading.

    Please replay soon

    Thank you,
    Hi nfc dev,

    I also have same problem I am not able to read/write 7 byte uid mifare 1k card using Nokia 603
    Please can you tell me which card you are using i.e. NXP or UPM?

    Thanks in advance

    Pradip

Similar Threads

  1. ACR122 emulate MIFARE 1K for 6131 access
    By jo.le.ouf in forum Near Field Communication
    Replies: 0
    Last Post: 2010-01-22, 14:25
  2. Mifare card emulation on 6212 classic
    By kentw in forum Near Field Communication
    Replies: 1
    Last Post: 2009-09-05, 09:56
  3. Can we access MiFare part of secure element in Nokia 6131 without unlocking
    By prasad.nokia in forum Near Field Communication
    Replies: 0
    Last Post: 2009-09-04, 07:53
  4. How to read the UID of a MIFARE card with the 6131 NFC
    By stewert in forum Near Field Communication
    Replies: 2
    Last Post: 2007-05-15, 11:18
  5. JavaCard & Mifare Access (6131)
    By geri-m in forum Near Field Communication
    Replies: 10
    Last Post: 2007-04-20, 19:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×