Publication 1756-RM004B-EN-P - October 2000
5-6 Serial Port API
MVIsp_OpenAlt
Syntax:
int MVIsp_ OpenAlt(int comport, MVISPALTSETUP *altsetup);
Parameters:
comport communications port to open
altsetup pointer to structure of type MVISPALTSETUP
Description:
MVIsp_OpenAlt provides an alternate method to acquire access to a
communications port. With MVIsp_OpenAlt, the sizes of the serial port
data queues can be set by the application. See MVIsp_Open for any
considerations about opening a port.
comport specifies which port is to be opened. See MVIsp_Open for
valid values.
altsetup points to a MVISPALTSETUP structure that contains the
configuration information for the port. The MVISPALTSETUP structure
is defined as follows:
typedef struct tagMVISPALTSETUP
{
BYTE baudrate;
BYTE parity;
BYTE wordlen;
BYTE stopbits;
int txquesize; /* Transmit queue size */
int rxquesize; /* Receive queue size */
} MVISPALTSETUP;
See MVIsp_Open for valid values for the baudrate, parity, wordlen,
and stopbits members of the structure. The txquesize and rxquesize
members determine the size of the data buffers used to queue serial
data. Valid values for the queue sizes can be any value from
MINQSIZE to MAXQSIZE. The MVIsp_Open function uses a queue
size of DEFQSIZE. These values are defined as:
#define MINQSIZE 512 /* Minimum Queue Size */
#define DEFQSIZE 1024 /* Default Queue Size */
#define MAXQSIZE 16384 /* Maximum Queue Size */
Either MVIsp_OpenAlt or MVIsp_Open must be called before any of
the other API functions can be used.
Return Value:
MVI_SUCCESS port was opened successfully
MVI_ERR_REOPEN port is already open
MVI_ERR_NODEVICE UART not found for port