Setting a timeout on TagAccess.readEvent()

// Expert user has replied.
P Philippe Hacquin 8 months 1 week ago
99 3 0

Hello, I am using the RFID SDK version 2.0.2.124 in Android 10, to read tags with a RFD40 + TC26. EPC memory bank is read first using a prefilter, then USER memory bank second after I have selected the EPC with the highest RSSI. 
I am using TagAccess.readEvent() to read user memory, and sometimes the operation will not complete because the tag is out of reach for example. The read operation seems to try to read forever.
I want to handle a timeout of a few seconds on this operation, and have the library call a callback method/function so that I can warn user and reset the read cycle (look for tags, select EPC and try to read user memory again).
How can I do that ? I could not find any solution to my problem (except maybe using TagAccess.readWait() maybe and handle a timeout by myself ?)
Thanks for the feedback

Please Register or Login to post a reply

3 Replies

A Alex Lavie

Not a dev expert but on a project we used the TriggerInfo or TriggerWithTimout to set some conditions prior to executing an Operation or sequence of operations.

extract from Techdocs.zebra.com
A Alex Lavie

also going forward I recommend looking at IOTConnect which supports these operations and is perhaps more flexible. Check accesses section here: https://zebradevs.github.io/rfid-ziotc-docs/schemas/operating_modes/index.html

 

 

P Philippe Hacquin

Hello Alex, thank you for the feedback. I managed to solve my problem with an Android Handler, but I will have a look at TriggerInfo + TriggerWithTimeout for the stop trigger. This one is not documented in the guides, and not used in 123RFID also, I was not aware of it.

I had a quick look at the Zebra IoT Connector, but the TC26/RFD40 does not seem supported (?).

Thanks anyway

CONTACT
Can’t find what you’re looking for?