[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

TlpOpen

PURPOSE
Initialize the library.
PROTOTYPE
Trap: Err TlpOpen (UInt16 refNum, UInt16 port)

PARAMETERS
port IN the port to open

DESCRIPTION
This functions allocate global data for the library, and establish a connection to the port port. Use serPortCradlePort to designate the serial port. See the documentation for SrmOpen in the Palm OS Reference Manual for other values.

TlpOpen returns a PalmOS error code if it fails to establish the connection or allocate data. It is safe to call TlpOpen again if the previous call failed but not if it was successful (because in the latter case the library intialized its internal state).

This function will return sysErrRomIncompatible if a needed feature (such as the new serial manager) is missing.

The default mode used by this library is ASCII at 9600 bauds, if this do not correspond to the reader configuration, reconfigure the line with TlpConfigureLinePalm.

SEE ALSO
TlpClose,
TlpConfigureLinePalm.

EXAMPLE
 
 UInt16 tlpRef;
 Err err;

 err = SysLibFind (tlpLibName, &tlpRef);
 if (err)
   err = SysLibLoad (tlpLibType, tlpLibCreator, &tlpRef);
 if (err)
   ... handle error ...
 err = TlpOpen (tlpRef, serPortCradlePort);
 if (err)
   ... handle error ...



This document was generated by Alexandre Duret-Lutz on August, 7 2001 using texi2html