beautypg.com

Changes required for java – ThingMagic Mercury API v1.23.0 User Manual

Page 111

background image

Custom Serial Transport Naming

Advanced Customization

111

Changes Required for Java

Starting with version 1.23.0 of the MercuryAPI SDK, we have added a serial transport
dispatch table (“Hashmap”) to store the transport scheme name and serial transport
object.

We have also modified the create() method to use the dispatch table for serial readers.

In order to use a new transport layer, the user needs to create their own serial transport
layer which implements SerialTransport.java .

public class SerialTransportTCP implements SerialTransport

{

….

contains the definitions for all the declarations in

SerialTransport.java

…...

}

Note that SerialTransportTCP can be any user defined transport file.

In the “java\samples_nb\src\samples” directory, there is source code for this example,
“ReadCustomTransport.java”, which shows how to enable reading over a “tcp” custom
serial transport layer (created by SerialTransportTCP.java in the
java\mercuryapi_nb\src\com\thingmagic directory).