Thingmagic Mercury API v1.23.0 Instrukcja Użytkownika Strona 108

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 128
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 107
Custom Serial Transport Naming
108 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 C#.
class Program
{
static void Main(string[] args)
{
……
Reader.SetSerialTransport("tcp",SerialTransportTCP.CreateSerialReader
);
// Add the custom transport scheme before calling Create().
// This can be done by using C# API helper function
SetSerialTransport().
// It accepts two arguments. scheme and serial transport factory
function.
// scheme: the custom transport scheme name. For this demonstration
we are using the scheme "tcp".
// Factory function:custom serial transport factory function
//call Reader.Create() method with reader URI such as tcp://
readerIP:portnumber.
Reader.create(“tcp://172.16.16.146:1001”);
………
}
}
In the “cs\Sample\Codelets” directory, there is source code for this example, in the
ReadCustomTransport subdirectory, which shows how to enable reading over a “tcp”
custom serial transport layer (created by SerialTransportTCP.cs in the
cs\ThingMagicReader directory).
Przeglądanie stron 107
1 2 ... 103 104 105 106 107 108 109 110 111 112 113 ... 127 128

Komentarze do niniejszej Instrukcji

Brak uwag