Changes required for c#/.net – ThingMagic Mercury API v1.23.0 User Manual

Page 107

Advertising
background image

Custom Serial Transport Naming

Advanced Customization

107

Changes Required for C#/.NET

Starting with version 1.23.0 of the MercuryAPI SDK, we have added a serial transport
dispatch table to store the transport scheme name and factory init functions.

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 inerits from SerialTransport.cs.

public class SerialTransportTCP : SerialTransport

{

// Factory function to return serial reader object

public static SerialReader CreateSerialReader(String uriString)

{

SerialReader rdr = new SerialReader(uriString,new

SerialTransportTCP());

return rdr;

}

….

contains the definitions for all the declarations in

SerialTransport.cs

…...

}

Note that SerialTransportTCP can be any user defined transport file.

Advertising