Thingmagic Mercury API v1.23.0 Uživatelský manuál Strana 112

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 128
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 111
Custom Serial Transport Naming
112 Advanced Customization
Example
In MercuryAPI we have added support for a TCP serial bridge. The TCP serial bridge
allows the user to connect to a serial reader using TCP/IP and a port number. We have
added the custom transport file for TCP serial bridge. The following code example shows
how to implement it in Java.
class CustomTransport
{
public static void Main(string[] args)
{
……
Reader.setSerialTransport("tcp",new SerialTransportTCP.Factory());
// Add the custom transport scheme before calling Reader.create()
// This can be done by using function Reader.setSerialTransport()
// It accepts two arguments. scheme and Factory object.
// scheme: the custom transport scheme name. For demonstration
// purposes, we are using scheme "tcp".
// Factory object: reference to the serial transport.
// Call Reader.Create() method with reader URI as tcp://
readerIP:portnumber.
Reader.create(“tcp://172.16.16.146:1001”);
………
}
}
Zobrazit stránku 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 127 128

Komentáře k této Příručce

Žádné komentáře