×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    2

    Regarding NFC Technology Issue

    Dear All;

    Actually i am developing an application which is using NFC technology. I am using Nokia 6212 as a NFC reader device and Mifare 1k card. Now my problem is that Sometime i can read the extenal Mifare card very properly and sometimes Not, it return Target Not Exception.

    when i again open the application its read the card properly and after some times its not read the card. i am not understand what is exact problem?? Is the problem is with my connection object or with card??
    Can anyone have solution to this proble. i am waiting for positive response from your side.

  2. #2
    Registered User
    Join Date
    Jan 2010
    Posts
    29

    Re: Regarding NFC Technology Issue

    Quote Originally Posted by aaatul.paliwal@gmail.com View Post
    Dear All;

    Actually i am developing an application which is using NFC technology. I am using Nokia 6212 as a NFC reader device and Mifare 1k card. Now my problem is that Sometime i can read the extenal Mifare card very properly and sometimes Not, it return Target Not Exception.

    when i again open the application its read the card properly and after some times its not read the card. i am not understand what is exact problem?? Is the problem is with my connection object or with card??
    Can anyone have solution to this proble. i am waiting for positive response from your side.
    Hello,

    Sometimes I encounter the same problem when I read several times the same tag.
    but it's really rare ..
    may be in the application there is one thing you forgot.

    I also developed a Java API for 6212 to read the UID of TAG.
    I am inspired examples NOKIA (UIDReader).

    Currently I try to communicate with PN533, NFC reader.

    may be you can show us your application to see

    best regards

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    2

    Re: Regarding NFC Technology Issue

    Hi....
    Thanks for your reply.
    Sometimes when i am not getting any value from the card, it shows the exception TARGETLOST. it means it connect to card but can't find unique tag (UID)of the Mifare Card.

    i have one more query also. i am doing lots of process in the same application. like connected with Web Services, integration of bluetooth hardware with our application. Is it is possible there are so many process that by application sometimes could not find the card unique id??

    I am sharing the code for read the RFID_TAG. plz give me the solution as soon as possible. i am waiting for positive response from your side...

    ''''''''''''''''''''''for standard connection'''''''''''''''''''''''

    public MFStandardConnection getMFStandardConnection(TargetProperties[] tProp)
    {
    for (int j = 0; j < tProp.length; j++)
    {
    Class[] connections = tProp[j].getConnectionNames();
    if(connections != null)
    {
    for (int i = 0; i < connections.length; i++)
    {
    if (connections[i].getName().equals("com.nokia.nfc.nxp.mfstd.MFStandardConnection"))
    {
    try
    {
    return (MFStandardConnection) Connector.open(tProp[j].getUrl(connections[i]));
    }
    catch (Exception e)
    {
    form.append("Main Exception : "+e.toString());
    }
    }
    }
    }
    }
    return null;
    }
    '''''''''''''''''''''''''''Closed Here''''''''''''''''''''''''''''''''''''''


    ''''''''''''''''''''''''for target detection''''''''''''''''''''

    public void targetDetected (TargetProperties [] tProp)
    {
    conn = getMFStandardConnection(tProp);
    if(conn == null)
    {
    try
    {
    conn.close();
    }
    catch(Exception exp){}
    }
    else if(conn!=null)
    {
    form.append("Connection Found.");
    String usid = readData(12).trim().substring(0,8);
    String vhno = readData(13).trim();
    String expdt = readData(26).trim();
    tf_cardid.setString(usid);
    tf_expdate.setString(expdt);
    tf_vhno.setString(vhno);
    }
    try
    {
    conn.close();
    form.append("conection closed");
    }
    catch (IOException e){form.append("Get IO Exception : "+e.toString());}
    }
    ''''''''''''''''''''''''''Close Here'''''''''''''''''''''

    ''''''''''''''''''''''for card read'''''''''''''''''''''''''''

    public String readData(int b)
    {
    MFBlock block = conn.getBlock(b);
    byte[] k = {(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff};
    MFKey.KeyA key = new MFKey.KeyA(k);
    String str="";
    byte[] counterBytes = new byte[100];
    try
    {
    block.read(key, counterBytes, 0, 0, 12);
    str=new String(counterBytes);
    }
    catch (Exception e){form.append("read Exception : "+e.toString());}
    return str;
    }
    '''''''''''''''''''''''''''close here'''''''''''''''''''''''''''''''

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    29

    Re: Regarding NFC Technology Issue

    Quote Originally Posted by aaatul.paliwal@gmail.com View Post
    Hi....
    Thanks for your reply.
    Sometimes when i am not getting any value from the card, it shows the exception TARGETLOST. it means it connect to card but can't find unique tag (UID)of the Mifare Card.

    i have one more query also. i am doing lots of process in the same application. like connected with Web Services, integration of bluetooth hardware with our application. Is it is possible there are so many process that by application sometimes could not find the card unique id??

    I am sharing the code for read the RFID_TAG. plz give me the solution as soon as possible. i am waiting for positive response from your side...

    ''''''''''''''''''''''for standard connection'''''''''''''''''''''''

    public MFStandardConnection getMFStandardConnection(TargetProperties[] tProp)
    {
    for (int j = 0; j < tProp.length; j++)
    {
    Class[] connections = tProp[j].getConnectionNames();
    if(connections != null)
    {
    for (int i = 0; i < connections.length; i++)
    {
    if (connections[i].getName().equals("com.nokia.nfc.nxp.mfstd.MFStandardConnection"))
    {
    try
    {
    return (MFStandardConnection) Connector.open(tProp[j].getUrl(connections[i]));
    }
    catch (Exception e)
    {
    form.append("Main Exception : "+e.toString());
    }
    }
    }
    }
    }
    return null;
    }
    '''''''''''''''''''''''''''Closed Here''''''''''''''''''''''''''''''''''''''


    ''''''''''''''''''''''''for target detection''''''''''''''''''''

    public void targetDetected (TargetProperties [] tProp)
    {
    conn = getMFStandardConnection(tProp);
    if(conn == null)
    {
    try
    {
    conn.close();
    }
    catch(Exception exp){}
    }
    else if(conn!=null)
    {
    form.append("Connection Found.");
    String usid = readData(12).trim().substring(0,8);
    String vhno = readData(13).trim();
    String expdt = readData(26).trim();
    tf_cardid.setString(usid);
    tf_expdate.setString(expdt);
    tf_vhno.setString(vhno);
    }
    try
    {
    conn.close();
    form.append("conection closed");
    }
    catch (IOException e){form.append("Get IO Exception : "+e.toString());}
    }
    ''''''''''''''''''''''''''Close Here'''''''''''''''''''''

    ''''''''''''''''''''''for card read'''''''''''''''''''''''''''

    public String readData(int b)
    {
    MFBlock block = conn.getBlock(b);
    byte[] k = {(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff};
    MFKey.KeyA key = new MFKey.KeyA(k);
    String str="";
    byte[] counterBytes = new byte[100];
    try
    {
    block.read(key, counterBytes, 0, 0, 12);
    str=new String(counterBytes);
    }
    catch (Exception e){form.append("read Exception : "+e.toString());}
    return str;
    }
    '''''''''''''''''''''''''''close here'''''''''''''''''''''''''''''''
    hi,
    I do not think it's your process that pose problems.

    I also sometimes have problems finding the UID of a MIFARE card.
    My program is simple but sometimes this bug (once every forty .. lol).

    I am not sufficiently versed in Java programming to tell you if there is an error in your code yet.

    Sorry.

    Best regards

Similar Threads

  1. NFC tag with usb interface?
    By bela.the.king in forum Near Field Communication
    Replies: 8
    Last Post: 2009-06-26, 09:55
  2. [moved] Nokia 6131 NFC - New firmware (v 05.12)
    By j.delinselle in forum Near Field Communication
    Replies: 0
    Last Post: 2008-08-08, 09:04
  3. Replies: 0
    Last Post: 2007-11-06, 11:06
  4. Replies: 0
    Last Post: 2007-04-24, 08:57
  5. Welcome to the NFC Discussion Board
    By Nokia Ron in forum Near Field Communication
    Replies: 0
    Last Post: 2007-03-26, 22:30

Posting Permissions

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