NordicID / nur_nurapi_android

NurApi for Android
MIT License
4 stars 5 forks source link

The method traceTagByEpc(byte[] epcBuffer) not behaving as expected #2

Closed jtrenton closed 5 years ago

jtrenton commented 5 years ago

If I'm not mistaken, you do not cover tracing tags in the sample application nor is there any documentation whatsoever on the method, let alone the library in general. If I'm wrong, can you please point me in the right direction?

At the moment, I have an RFID tag with the epc 8FFFFFC8298A304000A02A4E. I convert it to a byte array of {-113, -1, -1, -56, 41, -118, 48, 64, 0, -96, 42, 78}. I then hand it off to nurApi.traceTagByEpc(). My expectation is to both get a NurRespReadData object with an rssi value as well as receive traceTagEvents in the NurApiListener object with rssi values.

Both of these things do indeed happen, but the rssi value is always zero. In fact, the epc variable for both the NurRespReadData object and event object is empty.

I've included my code. Is there something I don't understand about the API? Should the following work as far as you can tell?

private void handleIOEvent(NurEventIOChange event) {
        try {
            switch (event.source) {
                case 100:
                    if (event.direction == 1){
                        String epc = getIntent().getStringExtra("maskEPC");

                        byte[] bytes = ByteString.decodeHex(epc).toByteArray();

                        NurRespReadData nurRespReadData = nurApi.traceTagByEpc(bytes);
                    }
                    else
                        stopRFIDInventory();
                    break;
                default:
                    break;
            }
        }
        catch (Exception ex) {

        }
}
AriPoy commented 5 years ago

if RSSI reported as zero, there are fix for that in latest NUR Firmware 7.1-A. So make sure you have latest NUR firmware in your device.

jtrenton commented 5 years ago

Okay. I am attempting to update the Alien S350 via the Alien Demo app. I've downloaded Nur2Application_71A.bin but I'm getting an "Invalid Update File" error. Do I need to change the extension on the file to something else?

AriPoy commented 5 years ago

ok, that file is not probably correct in your device. What "About" screen shows about your device? Model: Firmware:

jtrenton commented 5 years ago

Model: NUR-10W NUR firmware: 5.12-A Device firmware: 2.2.7-L Sep 7 2018

AriPoy commented 5 years ago

Sorry, my mistake. Your device is up to date. Tag tracing is not straight forward task but there are sample implemented on nur_sample_android Take a look Trace.java, TraceTagController.java and TraceAntennaSelector.java Direct *.apk of nur_sample_android can be get from app/Release folder

jtrenton commented 5 years ago

That was very helpful. I've got the trace tag function working well now.

By the way, I assumed that the sample Android application included in the Alien SDK was the same one offered here on Github so I didn't even look at the nur_sample_android. Looks like Alien needs to update their SDK.

Thanks for being so responsive!