FASTApp/MPA3DetectorSrc/MPA3Detector.cpp
/** Called when asyn clients call pasynOctet->write().
  * For all parameters it sets the value in the parameter library and calls any registered callbacks..
  * \param[in] pasynUser pasynUser structure that encodes the reason and address.
  * \param[in] value Value to write. 
  * \param[in] nChars Number of characters to write 
  * \param[out] nActual Number of characters actually written */
Called when asyn clients call pasynOctet->write().
For all parameters it sets the value in the parameter library and calls any registered callbacks
\param[in] pasynUser pasynUser structure that encodes the reason and address.
\param[in] value Value to write.
\param[in] nChars Number of characters to write
\param[out] nActual Number of characters actually written
Called when asyn clients call pasynOctet - > write () . For all parameters it sets the value in the parameter library and calls any registered callbacks \ param [ in ] pasynUser pasynUser structure that encodes the reason and address . \ param [ in ] value Value to write . \ param [ in ] nChars Number of characters to write \ param [ out ] nActual Number of characters actually written
asynStatus MPA3Detector::writeOctet(asynUser *pasynUser, const char *value,
                                            size_t nChars, size_t *nActual)
{
    int function = pasynUser->reason;
    asynStatus status = asynSuccess;
    status = setStringParam(function, (char *)value);
    if (function == P_Command) {
      if (strlen(value)+1 < sizeof(command))
	sendCommand((char *)value);
    }
    else if (function == P_MPAFilename) {
      if (strlen(value)+strlen("mapname=") < sizeof(command))
	{
	sprintf(command,"mpaname=%s",value);
	sendCommand((char *)command);
	}
    }
    if (function < FIRST_MPA_DETECTOR_PARAM) 
      status = asynNDArrayDriver::writeOctet(pasynUser, value,nChars, nActual);
    callParamCallbacks();
    if (status) 
        asynPrint(pasynUser, ASYN_TRACE_ERROR, 
              "%s:writeOctet: error, status=%d function=%d, value=%s\n", 
              driverName, status, function, value);
    else        
        asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, 
              "%s:writeOctet: function=%d, value=%s\n", 
              driverName, function, value);
    *nActual = nChars;
    return(status); 
}
asynStatus MPA3Detector :: writeOctet ( asynUser * pasynUser , const char * value , size_t nChars , size_t * nActual ) { int function = pasynUser -> reason ; asynStatus status = asynSuccess ; status = setStringParam ( function , ( char * ) value ) ; if ( function == P_Command ) { if ( strlen ( value ) + 1 < sizeof ( command ) ) sendCommand ( ( char * ) value ) ; } else if ( function == P_MPAFilename ) { if ( strlen ( value ) + strlen ( " " ) < sizeof ( command ) ) { sprintf ( command , " " , value ) ; sendCommand ( ( char * ) command ) ; } } if ( function < FIRST_MPA_DETECTOR_PARAM ) status = asynNDArrayDriver :: writeOctet ( pasynUser , value , nChars , nActual ) ; callParamCallbacks ( ) ; if ( status ) asynPrint ( pasynUser , ASYN_TRACE_ERROR , " \n " , driverName , status , function , value ) ; else asynPrint ( pasynUser , ASYN_TRACEIO_DRIVER , " \n " , driverName , function , value ) ; * nActual = nChars ; return ( status ) ; }
Called when asyn clients call pasynOctet->write().
Called when asyn clients call pasynOctet - > write () .
/* Set the parameter in the parameter library. */ /* If this is not a parameter we have handled call the base class */ /* Update any changed parameters */