DiMgslReceive


Prototype  
NTSTATUS DiMgslReceive( void *Handle,
                        char *Buf,
                        ULONG *Size,
                        ULONG *Status );
Parameters  
Handle
handle to open port
Buf
Pointer to buffer to hold returned data
Size
Size of buffer in bytes
Status
Returned status
Return Value  
STATUS_SUCCESS
a received frame or receive error has been returned in pBuffer and pStatus
STATUS_INVALID_HANDLE
Handle is invalid
STATUS_INVALID_PARAMETER
Buf, Size, or Status is invalid.
STATUS_BUFFER_TOO_SMALL
Buffer is too small to hold next available frame
STATUS_DEVICE_NOT_READY
Receiver is disabled and no data is available.
STATUS_RETRY
No received frames available or not enough receive data available to satisfy request

Get received data from the API buffers.

STATUS_SUCCESS is returned when data is available. If the receiver is enabled and data is not available then STATUS_RETRY is returned. If the receiver is disabled and data is not available, STATUS_DEVICE_NOT_READY is returned.

When the receiver is disabled, existing receive data remains in the API receive buffers until retrieved with DiMgslReceive.

When more data becomes available, the ReceiveReady callback is called.

HDLC Mode

Prior to call, set *Size to the size of Buf in bytes. Buf must be large enough to hold the maximum size frame. If a complete frame is available, the frame is copied to Buf, *Size is set to the size of the frame, and *Status is set to the frame state. RxStatus_OK indicates the frame was received without error.

STATUS_BUFFER_TOO_SMALL is returned when Buf is too small to hold the next available frame. The frame remains in the API buffers until this call is made with a sufficiently large buffer.

Async Mode

Prior to call, set *Size to the number of bytes of data required. Buf must be large enough to contain the requested data. When the entire requested amount is available, the data is copied to Buf, *Status is set to RxStatus_OK, and STATUS_SUCCESS is returned.


Previous Contents Next