[Moved] .read and .write functions | Thread profile
Thread profile page for "[Moved] .read and .write functions" on http://www.forum.nokia.com.
This report page is a snippet summary view from a single thread "[Moved] .read and .write functions", located on the Message Board at http://www.forum.nokia.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity, which are reported in a table below.
Additional thread profile information is also shown in the following ways:
Warning: These statistics are generated using 'best efforts' and can experience delays and reporting errors at times. Please note that such statistics do not constitute a thread's popularity and/or exact posting volumes at any given reporting period.
Started 1 month, 3 weeks ago (2008-07-03 11:55:00)
by alixwarnke
The blank squares are 0s, I'm quite surprised you didn't get a nullpointexception from this code. Any way it seems that you may need to initiate MY_KEY with KEY_BYTES /A
Started 1 month, 3 weeks ago (2008-07-03 12:49:00)
by cisa
Actually I have a string of code that initializes MY_KEY with KEY_BYTES above that snippet: MY_KEY=new MFKey.KeyB(KEY_BYTES); Anyway, can you please give advice how I can write and read properly what I wrote to the memory? Your help is very appreciated, thanks.
Started 1 month, 3 weeks ago (2008-07-03 12:54:00)
by alixwarnke
It appears that your key was invalid then. You are not trying to write the first block in the first sector? Check the access bits if both writing and reading data can be done using key B /A
Started 1 month, 3 weeks ago (2008-07-03 14:04:00)
by cisa
Well I do a statement of block=conn.getBlock(1); before that snipet of code? Is this correct? Should I be getting a different block to write with my key? Do I also have to do a getSector(number) statement as well? Thanks for your help.
Started 1 month, 3 weeks ago (2008-07-03 15:39:00)
by alixwarnke
getBlock(1) should be fine, it should point to the second block of the standard sector, which also uses the default keys. But to be sure, try: conn.getSector(1).getBlock(0); instead Also: Have you unlocked the secure element? If not, the default keys are invalid.
Started 1 month, 3 weeks ago (2008-07-03 17:37:00)
by Terenas
From the javadoc Code: getBlock public MFBlock getBlock(int blockIndex) Returns the block at the specified block index. Valid block index ranges from 0 to getBlockCount() - 1. Parameters: blockIndex - the block index. Returns: the MFBlock object that corresponds with the specified index. Throws: java.lang.IllegalArgumentException...
Started 1 month, 3 weeks ago (2008-07-03 17:38:00)
by cisa
Okay, I replaced block=conn.getBlock(1) with block=conn.getSector(1).getBlock(0);. I believe that is what you said to that? I guess I didn't unlock the security element because so far I have only been doing this in the Nokia Emulator. Do I still need to unlock the security element even with the emulator? Is this what I need to download to unlock the security element, I want to make sure...
Started 1 month, 3 weeks ago (2008-07-03 17:47:00)
by cisa
Terenas, String internalUrl=System.getProperty("internal.mf.url"); conn=(MFStandardConnection)Connector.open(internal Url); This is how I make the connection to internal mifare portion. As for unlocking the security element, I haven't done that yet. I am just doing this on the emulator so far. Is this what I need to download to unlock the security element. http://www.forum....
Started 1 month, 3 weeks ago (2008-07-03 18:13:00)
by alixwarnke
Since your phone is locked, try the other transport keys, 0xa0a1a2... and 0xb0b1b2... (google for them). Not sure that it will do any help, one of the things that happen when you unlock your phone is that the MIFARE keys are set to (0xfff...), so I guess they are arbitrary to start with. /A