X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-76
Text of C Example
*------------------------------------------------------------------
* Step 2: Post a new read on the X.25 line, and check for errors.
*------------------------------------------------------------------
*/
if( READ( comm_file, comm_buffR, MAX_COMM_READ, , READ_TAG ) != CCE )
{
FILEINFO( comm_file, &error );
ReportCommError( error );
}; /* if read() */
/*
*------------------------------------------------------------------
* Step 3: Cancel previous read on the terminal device.
*------------------------------------------------------------------
*/
if( CANCEL( term_file ) != CCE )
{
FILEINFO( term_file, &error );
PrintErrorMessage( error );
}; /* if read() */
/*
*------------------------------------------------------------------
* Step 4: Display the line data on the terminal.
*------------------------------------------------------------------
*/
if( fprintf( stderr, "\nData received: %s\n", term_buffs ) < 0 )
{
exit( EXIT_FAILURE );
}
else
{
fflush( stderr );
}; /* if fprintf() */
} /* CommComplete() */