Java With 1023 Phidget RFID R/W Facing Exception

Supporting Java SE version 7 and up
patelal1
Fresh meat
Posts: 1
Joined: Tue May 19, 2015 10:36 am
Contact:

Java With 1023 Phidget RFID R/W Facing Exception

Postby patelal1 » Tue May 19, 2015 12:38 pm

Hi I am working on Phidgets RFID R/W TagGainListener event, as soon as i attached tag to device, this trigger get fire and I got receive lastTag value, but according our requirement i need to modify whatever last written on tag and again rewrite that modified content in to tag on TagGainListener event. While rewriting, I am facing EPHIDGET_TIMEOUT = 13 Timeout exception. “Given timeout has been exceeded.”
My sample code is below.
RFIDPhidget rfid;
System.out.println(Phidget.getLibraryVersion());
rfid = new RFIDPhidget();
rfid.addTagGainListener(new TagGainListener()
{
public void tagGained(TagGainEvent oe)
{
System.out.println("Tag Gained: " +oe.getValue() + " (Proto:"+ oe.getProtocol()+")");
String lsLastValue = oe.getValue() + “World”; // Modify last tag content and rewrite
((RFIDPhidget)ae.getSource()).write(lsLastValue, RFIDPhidget.PHIDGET_RFID_PROTOCOL_PHIDGETS, false); // This line throwing EPHIDGET_TIMEOUT = 13 Timeout exception. “Given timeout has been exceeded.”
}
});
rfid.addTagLossListener(new TagLossListener()
{
public void tagLost(TagLossEvent oe)
{
System.out.println(oe);
}
});

rfid.openAny();
System.out.println("waiting for RFID attachment...");
rfid.waitForAttachment(1000);
rfid.close();
rfid = null;
System.out.println(" ok");

Can some show me where I am failing, Or how to rewrite content at addTagGainListener Event
I appreciate all kind of help. Thanks in advance.

Return to “Java”

Who is online

Users browsing this forum: No registered users and 3 guests