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
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
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
[url]http://library.developer.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-D38F02EB-1628-489B-997D-EF723C16E3CF/com/nokia/nfc/nxp/mfstd/MFManufacturerBlock.html[/url]
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. [B][SIZE="5"]The length of the array is always 4.[/SIZE][/B]
As they have hardcoded the number 4,do we have a new interface to access the 7 byte cards?
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
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.
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
Re: Access Mifare classic 7 byte UID on Nokia 6131
Hi There,
I am working on the same project to implement 7 byte UID for Access Mifare classic.
For sure, I will need to upgrade SDK to latest one(Nokia_Symbian_Belle_SDK_v0.6 is the latest one I found) which can support 7 byte.
I was wondering if you have got any idea on what interface and method can be used in stead of getUid and MFStandardConnection.
Appreciate your input.
Regards,
Pranaw
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,
Re: Access Mifare classic 7 byte UID on Nokia 6131
[QUOTE=NFC dev;899791]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,[/QUOTE]
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