Hello
I am following this guide to understand how to detect, from an Android 10 application running on a TC26, a possible connection loss with the RFID reader (an RFD4030):
https://techdocs.zebra.com/dcs/rfid/android/2-0-2-124/guide/connection/
Actually I am using the Zebra API in version 2.0.2.125 (api3-ascii, api3-cmn, api3-interface, api3-reader, and api3-transport libraries).
When physically disconnecting for test purposes the RFID reader, or even programmatically using reader.disconnect(), the eventStatusNotify() method of my RfidEventsListener is not called at all with a status event type of DISCONNECTION_EVENT. Although I have initialized the reader with reader.Events.setReaderDisconnectEvent(true) as instructed by the guide mentioned earlier, and checked the status of the reader with reader.Events.isReaderDisconnectEventSet.
The only event reported during disconnection is an informative message displayed in Logcat saying "Stopping mState=STOPPED" with tag "RFIDSerialIOMgr".
Any idea on how to make this work ?
I have been testing all day long, checking different parameters or changing the order of the instructions at initialization, and no success at all so far.
Thank you for any piece of advice
2 Replies
BTW, RFIDReader.isConnected() returns true even when the battery of the RFD40 has been removed. I cannot even poll the RFD state at regular intervals with this method.
OK, problem solved; the page I was looking at gives instructions that are maybe obsolete or not correct for an RFD40.
Instructions in https://techdocs.zebra.com/dcs/rfid/android/2-0-2-124/tutorials/reader-appeared-disppeared/ seem to be correct even if they are not complete (I had to create Readers with enum_transport ENUM_TRANSPORT.ALL, call Readers.attach() with a custom class implementing Readers.RFIDReaderEventHandler, adding permission android.permission.BLUETOOTH)
Hope this can be useful to someone