Debug logging, Transportlistener interface – ThingMagic Mercury API v1.23.0 User Manual
Page 63

Debug Logging
Level 2 API
63
Debug Logging
TransportListener Interface
The TransportListener interface provides a method of snooping on raw, transport-layer
packets sent to and received from any device. The class that is interested in observing
raw message packets implements this interface, and the object created with that class is
registered with:
void addTransportListener(TransportListener listener)
Once registered data transmitted or receive will cause the
message() method to be
invoked.
void message(boolean tx, byte[] data, int timeout)
When
data is sent to the device, message() is invoked with tx set to true.
When
data is received from the device, message() is invoked with tx set to false.
The
timeout originally specified by the caller is also returned.
The
data field includes every byte that is sent over the connection, including framing
bytes and CRCs.
To remove a TransportListener from an object so that it no longer is notified of message
packets call
removeTransportListener():
void removeTransportListener(Reader.TransportListener listener)
Note
For most users raw, transport layer packet information will not be very useful
but can be a critical tool for ThingMagic Support to debug a problem. To
facilitate debugging it is recommended that TransportListener logging be
available in all applications.