(Page 20 of 26 in this chapter)
cpi_open
Description
- Opens a channel to receive on the host.
Prototype
- #include <txcpi.h>
- TX_HANDLE cpi_open (unsigned short port,
- short mode,
- short *rcvr (short fd, short len) )
- port contains the board number to receive packets from in the high byte and the DPR channel in the low byte. For example, 0x0113 indicates receive from board 1, on host channel 19 (0x13).
- mode unused and retained for backwards compatibility.
- rcvr unused and retained for backwards compatibility.
Return Values
Details
- TX_HANDLE is operating system specific. Since this return value is only ever passed back to other CPI calls, it is not important to the application what this type actually is. When the handle needs to be used in a "wait" call (WaitForSingleObject in Windows NT, poll in UnixWare and Solaris), then use cpi_wait_obj(handle) to access the proper element for each operating system.
- WaitForSingleObject (cpi_wait_obj (handle), 0);
Note: If writing multi-threaded applications, the thread that opens a channel should be the same thread that processes all I/O for that channel. Unpredictable behavior may result otherwise.
(Page 20 of 26 in this chapter)
tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights
reserved.