X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-87
Text of C Example
/*
*----------------------------------------------------------------------
* TERMINAL_COMPLETE FUNCTION
* --------------------------
*
* This function is called to perform the following tasks if the main
* function receives terminal input:
*
* 1) copies the terminal input into the comm write buffer;
* 2) calls the WriteComm() function to write the data to the
* remote subdevice.
*----------------------------------------------------------------------
*/
void TerminalComplete( short count )
{
strncpy( comm_buffWs, term_buffs, count );
WriteComm( count );
} /* TerminalComplete() */
/*
*----------------------------------------------------------------------
* WRITE_COMM FUNCTION
* -------------------
*
* This function writes out the data in the comm write buffer, and
* checks for errors.
*----------------------------------------------------------------------
*/
void WriteComm( short count )
{
short error;
if( WRITE( comm_file, comm_buffW, count, , WRITE_TAG ) != CCE )
{
FILEINFO( comm_file, &error );
ReportCommError( error );
}; /* if write() */
} /* WriteComm() */
/*