×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    3

    Can't read RFID Tag with NFC Shell

    Hi there


    I'm developing right now some MIDlet using the Nokia NFC & RFID SDK (v.1.1). The platform I'm using is the Nokia 3220 phone in addition with the NFC-shell for payment & ticketing.


    I want to get the ID of an RFID-tag displayed on the screen if I touch an ISO14443-A tag.


    But the only tags i've been able to get an Event when touching, are Mifare-tags.
    If I try to touch the shell with my ISO14443-A tag, there isn't any event at all, as if the shell don't listen to it.


    Attached is my the source of my MIDlet. Maybe someone can find the bug in it, or may help me out with some actualy working code-sample?


    Theoreticaly it's working, because there is already a MIDlet from Nokia installed on the phone.
    Why I dont look at it's source? Because Nokia wasn't so kind providing the source code


    Code:
    MIDlet:
    ******************************
    
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.StringItem;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    
    import com.nokia.nfc.shell.ContactlessConnection;
    import com.nokia.nfc.shell.ContactlessEvent;
    import com.nokia.nfc.shell.ContactlessListener;
    import com.nokia.nfc.shell.Iso14443;
    
    public class RFIDReaderMidlet extends MIDlet implements ContactlessListener, Runnable{
    	private ContactlessConnection conn;
    
    	private StringItem screenText;
    
    	private Iso14443 iso;
    
    	public NFCReaderMidlet() {}
    
    	protected void startApp() throws MIDletStateChangeException {
    		Form screen = new Form("RFIDReaderMidlet");
    		screenText = new StringItem(null, "-");
    		screen.append(screenText);
    		Display.getDisplay(this).setCurrent(screen);
    		conn = ContactlessConnection.openConnection(this,new String[] {"iso14443-4"},null);
    
    		iso = (Iso14443) conn.getFeature("iso14443-4");
    
    		Thread t = new Thread(this);
    		t.start();
    	}
    	
        public void run() {
        
        }
    
    
    	protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
    		conn.close();
    	}
    
    	protected void pauseApp() {
    	}
    
    	/**
    	 * Handles the event sent by the ContactlessConnection.
    	 */
    	public void handleEvent(ContactlessEvent e) {
    		screenText.setText("Event: "+e.getType());
    		if (e.getType() == ContactlessEvent.TYPE_READ_DATA) {
    			switch (e.getStatus()) {
    			case ContactlessEvent.STATUS_OK:
    				// Mifare Ultralight tag was read successfully.
    				// Display its identifier on screen.
    				screenText.setText("CID: "+e.getTarget().getCid());
    				break;
    			default:
    				// An error occurred. Print the error status code.
    				screenText.setText("Error #" + e.getStatus());
    				break;
    			}
    		}else if (e.getType() == ContactlessEvent.TYPE_CONNECTION_STATUS) {
    			boolean connected = (e.getStatus() == ContactlessEvent.STATUS_CONNECTED);
    			// Only read if connected to NFC Shell.
    			if (connected) {
    				iso.read();
    				screenText.setText("Connected!");
    			} else {
    				screenText.setText("Disconnected");
    			}
    		}
    	}
    }

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    3

    Re: Can't read RFID Tag with NFC Shell

    Does realy no one have any Suggestions what I'm doing wrong?
    It can't be I'm the only one working with the NFC Shell!

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    2

    Re: Can't read RFID Tag with NFC Shell

    Hi, I am also developing midlets with RFID, and Im also trying to use the NFCReader Example provided with the documentation, but I have a strange problem. When running the midlet from the examples folders with the emulator everything is ok, but when using Eclipse with the same code, nothing works.....May I ask you what Developing Tool are you using?? By the way, have you checked if the type of Tag you are trying to scanned is supported by the NFC shell? All the information about supported types is included in the docs.
    I am going crazy with this scanning...
    Thanks!

  4. #4
    Registered User
    Join Date
    Aug 2006
    Posts
    3

    Re: Can't read RFID Tag with NFC Shell

    Quote Originally Posted by begermic
    Does realy no one have any Suggestions what I'm doing wrong?
    It can't be I'm the only one working with the NFC Shell!
    maybe you want to drop in at talknfc forum, there are some members who are also developing nfc applications.

  5. #5
    Registered User
    Join Date
    Dec 2006
    Location
    Budapest, Hungary
    Posts
    20

    Re: Can't read RFID Tag with NFC Shell

    Hi begermic,
    finally, are you succeeded in reading or writing iso14443?

  6. #6
    Registered User
    Join Date
    Jan 2007
    Posts
    27

    Re: Can't read RFID Tag with NFC Shell

    Quote Originally Posted by begermic
    I want to get the ID of an RFID-tag displayed on the screen if I touch an ISO14443-A tag.

    But the only tags i've been able to get an Event when touching, are Mifare-tags.
    If I try to touch the shell with my ISO14443-A tag, there isn't any event at all, as if the shell don't listen to it.
    I've tried this some time ago with my JCOP 30 card, which has an ISO 14443A interface. The Shell reports it to be a CompositeDevice.

    You might want to broaden your code by removing the if statements - start with printing at every event, and then narrow down your results.
    http://www.nfc-development.org/
    Daniel's NFC Development Weblog

Similar Threads

  1. [moved] Nokia RFID Shell
    By JeppeKuukeri1 in forum Near Field Communication
    Replies: 2
    Last Post: 2009-01-15, 14:48
  2. Nokia NFC shell and PN531 communication
    By rudieschonenberg in forum Near Field Communication
    Replies: 33
    Last Post: 2007-11-17, 07:09
  3. NFC Shell
    By mpcoloma in forum General Development Questions
    Replies: 1
    Last Post: 2007-01-31, 10:34
  4. Nokia NFC & RFID SDK 1.0
    By escoli in forum Mobile Java Tools & SDKs
    Replies: 27
    Last Post: 2007-01-09, 16:48
  5. socket read hangs until socket is closed
    By camroe in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-07-21, 09:44

Posting Permissions

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