ADApp/pluginSrc/NDPluginDriver.cpp
asynStatus NDPluginDriver::writeOctet(asynUser *pasynUser, const char *value, 
                                    size_t nChars, size_t *nActual)
{
    int addr=0;
    int function = pasynUser->reason;
    asynStatus status = asynSuccess;
    static const char *functionName = "writeOctet";

    status = getAddress(pasynUser, &addr); if (status != asynSuccess) return(status);
    /* Set the parameter in the parameter library. */
    status = (asynStatus)setStringParam(addr, function, (char *)value);

    if (function == NDPluginDriverArrayPort) {
        this->unlock();
        connectToArrayPort();
        this->lock();
    } else {
        /* If this parameter belongs to a base class call its method */
        if (function < FIRST_NDPLUGIN_PARAM) 
            status = asynNDArrayDriver::writeOctet(pasynUser, value, nChars, nActual);
    }
    
     /* Do callbacks so higher layers see any changes */
    status = (asynStatus)callParamCallbacks(addr);

    if (status) 
        epicsSnprintf(pasynUser->errorMessage, pasynUser->errorMessageSize, 
                  "%s:%s: status=%d, function=%d, value=%s", 
                  driverName, functionName, status, function, value);
    else        
        asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, 
              "%s:%s: function=%d, value=%s\n", 
              driverName, functionName, function, value);
    *nActual = nChars;
    return status;
}
/** Called when asyn clients call pasynOctet->write().
  * This function performs actions for some parameters, including NDPluginDriverArrayPort.
  * 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 Address of the string 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().
This function performs actions for some parameters, including NDPluginDriverArrayPort.
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 Address of the string 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 () . This function performs actions for some parameters including NDPluginDriverArrayPort . 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 Address of the string to write . \ param [ in ] nChars Number of characters to write . \ param [ out ] nActual Number of characters actually written .
asynStatus NDPluginDriver::writeOctet(asynUser *pasynUser, const char *value, 
                                    size_t nChars, size_t *nActual)
{
    int addr=0;
    int function = pasynUser->reason;
    asynStatus status = asynSuccess;
    static const char *functionName = "writeOctet";
    status = getAddress(pasynUser, &addr); if (status != asynSuccess) return(status);
    status = (asynStatus)setStringParam(addr, function, (char *)value);
    if (function == NDPluginDriverArrayPort) {
        this->unlock();
        connectToArrayPort();
        this->lock();
    } else {
        if (function < FIRST_NDPLUGIN_PARAM) 
            status = asynNDArrayDriver::writeOctet(pasynUser, value, nChars, nActual);
    }
    status = (asynStatus)callParamCallbacks(addr);
    if (status) 
        epicsSnprintf(pasynUser->errorMessage, pasynUser->errorMessageSize, 
                  "%s:%s: status=%d, function=%d, value=%s", 
                  driverName, functionName, status, function, value);
    else        
        asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, 
              "%s:%s: function=%d, value=%s\n", 
              driverName, functionName, function, value);
    *nActual = nChars;
    return status;
}
asynStatus NDPluginDriver :: writeOctet ( asynUser * pasynUser , const char * value , size_t nChars , size_t * nActual ) { int addr = 0 ; int function = pasynUser -> reason ; asynStatus status = asynSuccess ; static const char * functionName = " " ; status = getAddress ( pasynUser , & addr ) ; if ( status != asynSuccess ) return ( status ) ; status = ( asynStatus ) setStringParam ( addr , function , ( char * ) value ) ; if ( function == NDPluginDriverArrayPort ) { this -> unlock ( ) ; connectToArrayPort ( ) ; this -> lock ( ) ; } else { if ( function < FIRST_NDPLUGIN_PARAM ) status = asynNDArrayDriver :: writeOctet ( pasynUser , value , nChars , nActual ) ; } status = ( asynStatus ) callParamCallbacks ( addr ) ; if ( status ) epicsSnprintf ( pasynUser -> errorMessage , pasynUser -> errorMessageSize , " " , driverName , functionName , status , function , value ) ; else asynPrint ( pasynUser , ASYN_TRACEIO_DRIVER , " \n " , driverName , functionName , 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 parameter belongs to a base class call its method */ /* Do callbacks so higher layers see any changes */