Thingmagic Mercury API v1.23.0 Manuel d'utilisateur Page 109

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 128
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 108
Custom Serial Transport Naming
Advanced Customization 109
Changes Required for C
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 TMR_create() to use the dispatch table for serial readers.
So in order to use a new transport layer, the user needs to touch the Mercury C API in
one place only: In TMR_Serial_transport.h, you will need to add the prototype of the
factory init function.
typedef TMR_Status (*TMR_TransportNativeInit)(TMR_SR_SerialTransport
*transport, TMR_SR_SerialPortNativeContext *context, const char
*device);
TMR_Status TMR_setSerialTransport(char* scheme,
TMR_TransportNativeInit nativeInit);
main ()
{
……
ret = TMR_setSerialTransport(“Custom scheme name”, &”reference to
the factory init func”);
}
In the “c\src\samples” directory, there is source code for this example,
readcustomtransport.c, which shows how to enable reading over a “tcp” custom serial
transport layer (created by serial_transport_tcp_win32.c and serial_transport_tcp_posix.c
in the c\src\api directory).
Vue de la page 108
1 2 ... 104 105 106 107 108 109 110 111 112 113 114 ... 127 128

Commentaires sur ces manuels

Pas de commentaire