Gx5733ModuleBufferGetState

Applies To

GX5701, GX5702, GX5704

Purpose

Returns the Module’s Buffer Full or Half-Full State.

Syntax

Gx5733ModuleBufferGetState (nHandle, nPort, pnState, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5733 board.
nPort
SHORT
Module port 0 (GX5733_PORT0) only.
pnState
PSHORT
Returned Buffer state can be as follow:
0. GX5733_MODULE_BUFFER_EMPTY: buffer is empty (reading from the buffer) or not full (writing to the buffer).
1. GX5733_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.

Comments

When reading or writing to the buffer the state is as follow:

Writing to the buffer:

  1. Indicates the buffer in not yet full.

  2. The buffer is full. In order to write new data the buffer needs to be cleared first by calling Gx5733ModuleBufferClear or by reading data from the buffer using Gx5733ModuleBufferReadData.

Reading from the buffer:

  1. Indicates the buffer in not empty.

  2. The buffer is empty.

Example

The following example returns Module 0 buffer flag state:

 

SHORT nState, nStatus;

Gx5733ModuleBufferGetState (nHandle, GX5733_PORT0, &nState, &nStatus);

 

See Also

Gx5733ModuleBufferWriteData, Gx5733ModuleBufferReadData, Gx5733ModuleBufferSetMode