GX5701, GX5702, GX5704
Gx5731ModuleBufferGetState (nHandle, nPort, pnState, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a GX5731 board. |
nPort |
SHORT |
Specified Module's port number:0. GX5731_PORT0: Module port 0 1. GX5731_PORT1: Module port 1 2. GX5731_PORT2: Module port 2 |
pnState |
PSHORT |
Returned Buffer state can be as follow: 0. GX5731_MODULE_BUFFER_EMPTY: buffer is empty (reading from the buffer) or not full (writing to the buffer). 1. GX5731_MODULE_BUFFER_FULL: buffer is full (writing to the buffer) or buffer is empty (reading from the buffer). |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
When reading or writing to the buffer the state is as follow:
Writing to the buffer:
Indicates the buffer in not yet full.
The buffer is full. In order to write new data the buffer needs to be cleared first by calling Gx5731ModuleBufferClear or by reading data from the buffer using Gx5731ModuleBufferReadData.
Reading from the buffer:
Indicates the buffer in not empty.
The buffer is empty.
The following example returns Module 0 buffer flag state:
SHORT nState, nStatus;
Gx5731ModuleBufferGetState (nHandle, GX5731_PORT0, &nState, &nStatus);
Gx5731ModuleBufferWriteData, Gx5731ModuleBufferReadData, Gx5731ModuleBufferSetMode