×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    31

    How to format an NDEF tag

    Hi All,
    I am able to write an image to an NDEF tag of the Nokia 6131 NFC phone. I wish to format the NDEF tag by resetting the NDEF keys to its default value. How is this done? The forum suggests me to use a desktop application. I am not sure about this though. I will be glad if anyone can share this desktop application so that it will help me format the keys.
    Amar Sahu
    CEDT@IISc

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    21

    Re: How to format an NDEF tag

    Hello,
    When you say "NDEF tag", I presume you mean the NFC tag (the internal RFID tag). NDEF is a standarized framework for writing & reading from a NFC tag. I am not sure what you mean, so I'll simply share some thoughts I have.

    As far as I know, the NFC tag of the 6131 is'nt protected, so you should be able to read the image fairly easy. I'm not sure what you mean by "formatting" and "resetting the NDEF tag", but here is some points I can share with you:

    First of all, when reading and writing to the tag, you should be familiar with the memory layout of the tag. NFC is standarized for using Mifare tags which again comes in different flavours (1K, 4K etc.). The typical 1K tag has 15 sectors (each 16 bytes in size). Sector 0 is write-protected and reserved for manufacturing data. All of this is well described in the NFC user manual : http://epic.hpi.uni-potsdam.de/pub/H...de_v1_1_en.pdf

    The good thing though, when using NDEF, you really dont need to care anything about bits&bytes. The NDEF framework handles all the memory operations itself.

    In my own tests, I have found out that a NFC tag can only contain 1 NDEF message on it. But, if you want more NDEF messages with mixed content (images, audio, raw bytes etc), you have to construct a Nested NDEF message. You can do this with the standard Nokia NFC framework SDK for the 6131 phone.

    So, as I said, if you only care about the actual content, you shouldn't care about the authentication. However, you should make sure that the length of the content you are writing is less than the limit of the tag. But again, this depends on the API you are using. I also found that NDEF messages are actually written from sector 1 + the length of your data. So every time you write something to the tag, the previous data is overwritten (and if the length of the new data is less than the whats already there, then you have redundant data on the tag...).

    If you have questions, then please try to be a bit more specific about what you are trying to achive. Why do you want to reset the the keys? And, are you talking about the internal tag authentication keys (key A & key B). But, if you are talking about resetting the data on the phone, then is will be different. What you then need is a desktop RFID writer and code that opens a connection to your phone.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    21

    Re: How to format an NDEF tag

    Quote Originally Posted by amarsahu
    Hi Dervis,

    Thank you for your valuable inputs. I am using an application from the Nokia forum called "Writing an Image to an NDEF tag". I compiled this application with the image size being 20x20. I loaded the jar on to the Nokia 6131 NFC phone. Now I want to change the image size and reload the jar on to the phone. How do I do this?

    I tried quiet a few things to see if I could write a larger image.
    a. I deleted the jar from the phone and tried to load a fresh jar which had a larger image. This failed as the older image was itself getting reflected.

    b. I also tried to load a different image of the same size i.e. 20x20 which didn't work as well. My doubt is whether this image is residing somewhere in the phone memory. If yes how do i delete this image so that the phone can load a larger image.

    I hope I have made things slightly clearer. Your feedback will really help.
    Ok, I understand your your problem. For the "Writing an Image to an NDEF tag" example, you'll need a) a 6131 NFC phone and b) a rewriteable RFID tag. I simply tested the demo with the included Nokia 6131 NFC emulator and the included RFID tags. This is what I found:

    a) The example application has two functionalities: Read and Write. When you push the Write button, you can simply drag-drop a RFID tag over the emulator. If you have a phone yourself, you can simply touch the tag that you want to write the image to. However remember this: on a standard Mifare 1K RFID tag, you'll only have about 726 bytes available for your data. So any image you include with the jar, must be less-or-equal to 700 bytes. But, you could easily write a larger image to a RFID tag with a larger capasity. With the emulator included with the Nokia NFC SDK API, there both 1K and 4K tags available for you to play with.

    b) No, the image is not on the phone. The image resides inside the jar file. However I found the source of the refered example a bit confusing since it expects to find the image outside any packages in the jar file. So what I did is the following: I downloaded the example source code and created a new ImageWrite project with the Java ME Platform SDK editor. Then inside the src folder, I created a new folder called "resources". Inside the resources folder I included to images, the first one being the one included with example and a second one which I downloaded. Both images are less then 1K. The first one is 20x20 as you said and the other one is 30x30. To make this work, you have to change this line:

    "InputStream is = getClass().getResourceAsStream("smiley.png");" into this

    "InputStream is = getClass().getResourceAsStream("/resources/smiley.png");"

    Now build the jar file and make sure that it includes both images. The code will then look inside the "resources" folder and load any image you want.

    If you want the source code which I tested, including the jar file, then PM me your email-adress and I'll send a zip to you.

    Hope this help you.

  4. #4
    Registered User
    Join Date
    Nov 2008
    Posts
    31

    Re: How to format an NDEF tag

    Quote Originally Posted by Dervis View Post
    Ok, I understand your your problem. For the "Writing an Image to an NDEF tag" example, you'll need a) a 6131 NFC phone and b) a rewriteable RFID tag. I simply tested the demo with the included Nokia 6131 NFC emulator and the included RFID tags. This is what I found:

    a) The example application has two functionalities: Read and Write. When you push the Write button, you can simply drag-drop a RFID tag over the emulator. If you have a phone yourself, you can simply touch the tag that you want to write the image to. However remember this: on a standard Mifare 1K RFID tag, you'll only have about 726 bytes available for your data. So any image you include with the jar, must be less-or-equal to 700 bytes. But, you could easily write a larger image to a RFID tag with a larger capasity. With the emulator included with the Nokia NFC SDK API, there both 1K and 4K tags available for you to play with.

    b) No, the image is not on the phone. The image resides inside the jar file. However I found the source of the refered example a bit confusing since it expects to find the image outside any packages in the jar file. So what I did is the following: I downloaded the example source code and created a new ImageWrite project with the Java ME Platform SDK editor. Then inside the src folder, I created a new folder called "resources". Inside the resources folder I included to images, the first one being the one included with example and a second one which I downloaded. Both images are less then 1K. The first one is 20x20 as you said and the other one is 30x30. To make this work, you have to change this line:

    "InputStream is = getClass().getResourceAsStream("smiley.png");" into this

    "InputStream is = getClass().getResourceAsStream("/resources/smiley.png");"

    Now build the jar file and make sure that it includes both images. The code will then look inside the "resources" folder and load any image you want.

    If you want the source code which I tested, including the jar file, then PM me your email-adress and I'll send a zip to you.

    Hope this help you.
    Hi,
    Thank you for the reply. I am trying to use the Image write to an NDEF tag with 2 Nokia 6131 NFC phones and not with a phone and a rewritable RFID tag. My whole idea of using this application is to demonstrate a smart poster application between 2 NFC phones by exchanging images from one 6131 NFC phone with the other 6131 NFC phone. I tried to modify the peer to peer application so that I can send an image just like we send text. I have written code but the transmission does not take place via p2p. Hence, I thought writing an image to an ndef tag as one of the possible solutions. I wish to exchange images between the two phones via NFC. Your inputs will really help. Please share your thoughts with me.
    Amar Sahu
    CEDT@IISc

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    21

    Re: How to format an NDEF tag

    Quote Originally Posted by amarsahu View Post
    Hi,
    Thank you for the reply. I am trying to use the Image write to an NDEF tag with 2 Nokia 6131 NFC phones and not with a phone and a rewritable RFID tag. My whole idea of using this application is to demonstrate a smart poster application between 2 NFC phones by exchanging images from one 6131 NFC phone with the other 6131 NFC phone. I tried to modify the peer to peer application so that I can send an image just like we send text. I have written code but the transmission does not take place via p2p. Hence, I thought writing an image to an ndef tag as one of the possible solutions. I wish to exchange images between the two phones via NFC. Your inputs will really help. Please share your thoughts with me.
    I see. I havent tested phone-to-phone communication yet, however, it sound to me like you are trying to write to the other phone's internal Smart Card. As far as I know there isn't any RFID tag inside the 6131. The internal Smart Card has a contactless interface based on RFID. Correct me if I'm wrong, but, try looking up some examples writing to the secure element of the 6131. Again, you have the memory issue. Cuz as with RFID tags, the memory size of Smart Cards vary. Also, communication with Smart Cards is based on ARDU commands. I found two articals which you can look at (one about Java Card, the other one about NFC):
    http://java.sun.com/javacard/referen...art/javacard1/ and this one:
    http://java.sun.com/developer/techni...es/javame/nfc/

Similar Threads

  1. NDEF Tag Format
    By TS-Tec in forum Near Field Communication
    Replies: 15
    Last Post: 2012-03-13, 16:02
  2. Deleting an image from the NDEF tag
    By amarsahu in forum Near Field Communication
    Replies: 1
    Last Post: 2009-06-30, 11:39
  3. Sending a Larger image size to NDEF tag
    By amarsahu in forum Near Field Communication
    Replies: 0
    Last Post: 2009-06-26, 13:13
  4. NDEF Text with a different tag with different KEYS
    By txamv in forum Near Field Communication
    Replies: 6
    Last Post: 2008-03-13, 11:04
  5. NDEF tag text only
    By cde in forum Near Field Communication
    Replies: 2
    Last Post: 2007-07-02, 17:38

Posting Permissions

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