-1

I am implementing with OctaneSDK an application to read some data the reader SPEEDWAY Revolution R220.

In my implementation class I have the following method:

enter image description here

The section 2 is related to the desire to find the EPC code and number of Athena.

My question is: How can I recover the report values for the EPC fields and Atenna number and set in my attributes?

2 Answers2

1

I'm assuming you're attempting to read RFID tags with the Impinj reader via the OctaneSDK. I'm sure you're aware of this but constructing a new Tag will net you nothing, you need to get the tags from the reader itself.

So... you've set an event handler with your TagReportListenerImplementation just before section 2. I looked at the SDK docs and see that this interface fires the onTagReported event. Take a look at the docs for TagReportListener interface, the event will report the reader that read the tag, along with the tag information. Look for your tag information, including the EPC and antenna, in your implementation of this event handler.

If you are not receiving events on your event handler, you need to make sure your reader is actually reading tags and/or reporting them correctly. If your program is communicating with the reader in step 1 then you are almost there!

Fam
  • 580
  • 1
  • 7
  • 29
  • Yes Fam, I'm trying to read RFID tags. I noticed in the code as you **TagReportListener** interface. I'm trying to implicitly change the **onTagReported** event to scroll the list of tags and then to set my attributes. After I will share what the outcome was. – Gustavo Duarte Apr 08 '16 at 19:44
0

I hope this snippet will work for you.

@Override
public void onTagReported(ImpinjReader reader, TagReport report) {

    List<Tag> tags = report.getTags();      
    for (Tag t : tags) {                                
        String uid = t.getEpc().toString();     

        //Here you will get the Epc
        System.out.print("Epc: " + uid);   

        // Here you will get Antenna Number                    
        if (t.isAntennaPortNumberPresent()) {
            System.out.print(" antenna: " + t.getAntennaPortNumber());
        }             
}
PraKi
  • 13
  • 6