asyn  4-44-2
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
asynPortDriver Class Reference

Base class for asyn port drivers; handles most of the bookkeeping for writing an asyn port driver with standard asyn interfaces and a parameter library. More...

#include <asynPortDriver.h>

Inheritance diagram for asynPortDriver:
testAsynPortDriver

Public Member Functions

 asynPortDriver (asynParamSet *paramSet, const char *portName, int maxAddr, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize)
 
 asynPortDriver (const char *portName, int maxAddr, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize)
 Constructor for the asynPortDriver class. More...
 
 asynPortDriver (const char *portName, int maxAddr, int paramTableSize, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize) EPICS_DEPRECATED
 Legacy constructor for the asynPortDriver class (DEPRECATED - please use the one above instead). More...
 
virtual ~asynPortDriver ()
 Destructor for asynPortDriver class; frees resources allocated when port driver is created. More...
 
virtual asynStatus lock ()
 Locks the driver to prevent multiple threads from accessing memory at the same time. More...
 
virtual asynStatus unlock ()
 Unlocks the driver; called when an asyn client or driver is done accessing common memory. More...
 
virtual asynStatus getAddress (asynUser *pasynUser, int *address)
 Returns the asyn address associated with a pasynUser structure. More...
 
virtual asynStatus parseAsynUser (asynUser *pasynUser, int *reason, int *address, const char **paramName)
 Returns the asyn reason, address, and parameter name associated with a pasynUser structure. More...
 
virtual asynStatus readInt32 (asynUser *pasynUser, epicsInt32 *value)
 Called when asyn clients call pasynInt32->read(). More...
 
virtual asynStatus writeInt32 (asynUser *pasynUser, epicsInt32 value)
 Called when asyn clients call pasynInt32->write(). More...
 
virtual asynStatus readInt64 (asynUser *pasynUser, epicsInt64 *value)
 Called when asyn clients call pasynInt64->read(). More...
 
virtual asynStatus writeInt64 (asynUser *pasynUser, epicsInt64 value)
 Called when asyn clients call pasynInt64->write(). More...
 
virtual asynStatus readUInt32Digital (asynUser *pasynUser, epicsUInt32 *value, epicsUInt32 mask)
 Called when asyn clients call pasynUInt32Digital->read(). More...
 
virtual asynStatus writeUInt32Digital (asynUser *pasynUser, epicsUInt32 value, epicsUInt32 mask)
 Called when asyn clients call pasynUInt32Digital->write(). More...
 
virtual asynStatus setInterruptUInt32Digital (asynUser *pasynUser, epicsUInt32 mask, interruptReason reason)
 Called when asyn clients call pasynUInt32Digital->setInterrupt(). More...
 
virtual asynStatus clearInterruptUInt32Digital (asynUser *pasynUser, epicsUInt32 mask)
 Called when asyn clients call pasynUInt32Digital->clearInterrupt(). More...
 
virtual asynStatus getInterruptUInt32Digital (asynUser *pasynUser, epicsUInt32 *mask, interruptReason reason)
 Called when asyn clients call pasynUInt32Digital->getInterrupt(). More...
 
virtual asynStatus getBounds (asynUser *pasynUser, epicsInt32 *low, epicsInt32 *high)
 Called when asyn clients call pasynInt32->getBounds(), returning the bounds on the asynInt32 interface for drivers that use raw units. More...
 
virtual asynStatus getBounds64 (asynUser *pasynUser, epicsInt64 *low, epicsInt64 *high)
 Called when asyn clients call pasynInt64->getBounds(), returning the bounds on the asynInt64 interface for drivers that use raw units. More...
 
virtual asynStatus readFloat64 (asynUser *pasynUser, epicsFloat64 *value)
 Called when asyn clients call pasynFloat64->read(). More...
 
virtual asynStatus writeFloat64 (asynUser *pasynUser, epicsFloat64 value)
 Called when asyn clients call pasynFloat64->write(). More...
 
virtual asynStatus readOctet (asynUser *pasynUser, char *value, size_t maxChars, size_t *nActual, int *eomReason)
 Called when asyn clients call pasynOctet->read(). More...
 
virtual asynStatus writeOctet (asynUser *pasynUser, const char *value, size_t maxChars, size_t *nActual)
 Called when asyn clients call pasynOctet->write(). More...
 
virtual asynStatus flushOctet (asynUser *pasynUser)
 Called when asyn clients call pasynOctet->flush(). More...
 
virtual asynStatus setInputEosOctet (asynUser *pasynUser, const char *eos, int eosLen)
 Called when asyn clients call pasynOctet->setInputEos(). More...
 
virtual asynStatus getInputEosOctet (asynUser *pasynUser, char *eos, int eosSize, int *eosLen)
 Called when asyn clients call pasynOctet->getInputEos(). More...
 
virtual asynStatus setOutputEosOctet (asynUser *pasynUser, const char *eos, int eosLen)
 Called when asyn clients call pasynOctet->setOutputEos(). More...
 
virtual asynStatus getOutputEosOctet (asynUser *pasynUser, char *eos, int eosSize, int *eosLen)
 Called when asyn clients call pasynOctet->getOutputEos(). More...
 
virtual asynStatus readInt8Array (asynUser *pasynUser, epicsInt8 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt8Array->read(). More...
 
virtual asynStatus writeInt8Array (asynUser *pasynUser, epicsInt8 *value, size_t nElements)
 Called when asyn clients call pasynInt8Array->write(). More...
 
virtual asynStatus doCallbacksInt8Array (epicsInt8 *value, size_t nElements, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynInt8Array interface. More...
 
virtual asynStatus readInt16Array (asynUser *pasynUser, epicsInt16 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt16Array->read(). More...
 
virtual asynStatus writeInt16Array (asynUser *pasynUser, epicsInt16 *value, size_t nElements)
 Called when asyn clients call pasynInt16Array->write(). More...
 
virtual asynStatus doCallbacksInt16Array (epicsInt16 *value, size_t nElements, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynInt16Array interface. More...
 
virtual asynStatus readInt32Array (asynUser *pasynUser, epicsInt32 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt32Array->read(). More...
 
virtual asynStatus writeInt32Array (asynUser *pasynUser, epicsInt32 *value, size_t nElements)
 Called when asyn clients call pasynInt32Array->write(). More...
 
virtual asynStatus doCallbacksInt32Array (epicsInt32 *value, size_t nElements, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynInt32Array interface. More...
 
virtual asynStatus readInt64Array (asynUser *pasynUser, epicsInt64 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt64Array->read(). More...
 
virtual asynStatus writeInt64Array (asynUser *pasynUser, epicsInt64 *value, size_t nElements)
 Called when asyn clients call pasynInt64Array->write(). More...
 
virtual asynStatus doCallbacksInt64Array (epicsInt64 *value, size_t nElements, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynInt64Array interface. More...
 
virtual asynStatus readFloat32Array (asynUser *pasynUser, epicsFloat32 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynFloat32Array->read(). More...
 
virtual asynStatus writeFloat32Array (asynUser *pasynUser, epicsFloat32 *value, size_t nElements)
 Called when asyn clients call pasynFloat32Array->write(). More...
 
virtual asynStatus doCallbacksFloat32Array (epicsFloat32 *value, size_t nElements, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynFloat32Array interface. More...
 
virtual asynStatus readFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynFloat64Array->read(). More...
 
virtual asynStatus writeFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements)
 Called when asyn clients call pasynFloat64Array->write(). More...
 
virtual asynStatus doCallbacksFloat64Array (epicsFloat64 *value, size_t nElements, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynFloat64Array interface. More...
 
virtual asynStatus readGenericPointer (asynUser *pasynUser, void *pointer)
 Called when asyn clients call pasynGenericPointer->read(). More...
 
virtual asynStatus writeGenericPointer (asynUser *pasynUser, void *pointer)
 Called when asyn clients call pasynGenericPointer->write(). More...
 
virtual asynStatus doCallbacksGenericPointer (void *pointer, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynGenericPointer interface. More...
 
virtual asynStatus readOption (asynUser *pasynUser, const char *key, char *value, int maxChars)
 Called when asyn clients call pasynOption->read(). More...
 
virtual asynStatus writeOption (asynUser *pasynUser, const char *key, const char *value)
 Called when asyn clients call pasynOption->write(). More...
 
virtual asynStatus readEnum (asynUser *pasynUser, char *strings[], int values[], int severities[], size_t nElements, size_t *nIn)
 Called when asyn clients call pasynEnum->read(). More...
 
virtual asynStatus writeEnum (asynUser *pasynUser, char *strings[], int values[], int severities[], size_t nElements)
 Called when asyn clients call pasynEnum->write(). More...
 
virtual asynStatus doCallbacksEnum (char *strings[], int values[], int severities[], size_t nElements, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynEnum interface. More...
 
virtual asynStatus drvUserCreate (asynUser *pasynUser, const char *drvInfo, const char **pptypeName, size_t *psize)
 Called by asynManager to pass a pasynUser structure and drvInfo string to the driver; Assigns pasynUser->reason based on the value of the drvInfo string. More...
 
virtual asynStatus drvUserGetType (asynUser *pasynUser, const char **pptypeName, size_t *psize)
 Returns strings associated with driver-specific commands. More...
 
virtual asynStatus drvUserDestroy (asynUser *pasynUser)
 Frees any resources allocated by drvUserCreate. More...
 
virtual void report (FILE *fp, int details)
 Reports on status of the driver. More...
 
virtual asynStatus connect (asynUser *pasynUser)
 Connects driver to device; The base class implementation simply calls pasynManager->exceptionConnect if address is valid Derived classes can reimplement this function for real connection management. More...
 
virtual asynStatus disconnect (asynUser *pasynUser)
 Disconnects driver from device; the base class implementation simply calls pasynManager->exceptionDisconnect. More...
 
virtual asynStatus createParam (const char *name, asynParamType type, int *index)
 Creates a parameter in the parameter library. More...
 
virtual asynStatus createParam (int list, const char *name, asynParamType type, int *index)
 Creates a parameter in the parameter library. More...
 
virtual asynStatus createParams ()
 Create any parameters defined in the asynParamSet, if there are any. More...
 
virtual asynStatus getNumParams (int *numParams)
 Returns the number of parameters in the parameter library. More...
 
virtual asynStatus getNumParams (int list, int *numParams)
 Returns the number of parameters in the parameter library. More...
 
virtual asynStatus findParam (const char *name, int *index)
 Finds a parameter in the parameter library. More...
 
virtual asynStatus findParam (int list, const char *name, int *index)
 Finds a parameter in the parameter library. More...
 
virtual asynStatus getParamName (int index, const char **name)
 Returns the name of a parameter in the parameter library. More...
 
virtual asynStatus getParamName (int list, int index, const char **name)
 Returns the name of a parameter in the parameter library. More...
 
virtual asynStatus getParamType (int index, asynParamType *type)
 Returns the asynParamType of a parameter in the parameter library*. More...
 
virtual asynStatus getParamType (int list, int index, asynParamType *type)
 Returns the asynParamType of a parameter in the parameter library. More...
 
virtual asynStatus setParamStatus (int index, asynStatus status)
 Sets the status for a parameter in the parameter library. More...
 
virtual asynStatus setParamStatus (int list, int index, asynStatus status)
 Sets the status for a parameter in the parameter library. More...
 
virtual asynStatus getParamStatus (int index, asynStatus *status)
 Gets the status for a parameter in the parameter library. More...
 
virtual asynStatus getParamStatus (int list, int index, asynStatus *status)
 Gets the status for a parameter in the parameter library. More...
 
virtual asynStatus setParamAlarmStatus (int index, int status)
 Sets the alarmStatus for a parameter in the parameter library. More...
 
virtual asynStatus setParamAlarmStatus (int list, int index, int status)
 Sets the alarmStatus for a parameter in the parameter library. More...
 
virtual asynStatus getParamAlarmStatus (int index, int *status)
 Gets the alarmStatus for a parameter in the parameter library. More...
 
virtual asynStatus getParamAlarmStatus (int list, int index, int *status)
 Gets the alarmStatus for a parameter in the parameter library. More...
 
virtual asynStatus setParamAlarmSeverity (int index, int severity)
 Sets the alarmSeverity for a parameter in the parameter library. More...
 
virtual asynStatus setParamAlarmSeverity (int list, int index, int severity)
 Sets the alarmSeverity for a parameter in the parameter library. More...
 
virtual asynStatus getParamAlarmSeverity (int index, int *severity)
 Gets the alarmSeverity for a parameter in the parameter library. More...
 
virtual asynStatus getParamAlarmSeverity (int list, int index, int *severity)
 Gets the alarmSeverity for a parameter in the parameter library. More...
 
virtual void reportSetParamErrors (asynStatus status, int index, int list, const char *functionName)
 Reports errors when setting parameters. More...
 
virtual void reportGetParamErrors (asynStatus status, int index, int list, const char *functionName)
 Reports errors when getting parameters. More...
 
virtual asynStatus setIntegerParam (int index, int value)
 Sets the value for an integer in the parameter library. More...
 
virtual asynStatus setIntegerParam (int list, int index, int value)
 Sets the value for an integer in the parameter library. More...
 
virtual asynStatus setInteger64Param (int index, epicsInt64 value)
 Sets the value for a 64-bit integer in the parameter library. More...
 
virtual asynStatus setInteger64Param (int list, int index, epicsInt64 value)
 Sets the value for a 64-bit integer in the parameter library. More...
 
virtual asynStatus setUIntDigitalParam (int index, epicsUInt32 value, epicsUInt32 valueMask)
 Sets the value for a UInt32Digital in the parameter library. More...
 
virtual asynStatus setUIntDigitalParam (int list, int index, epicsUInt32 value, epicsUInt32 valueMask)
 Sets the value for a UInt32Digital in the parameter library. More...
 
virtual asynStatus setUIntDigitalParam (int index, epicsUInt32 value, epicsUInt32 valueMask, epicsUInt32 interruptMask)
 Sets the value for a UInt32Digital in the parameter library. More...
 
virtual asynStatus setUIntDigitalParam (int list, int index, epicsUInt32 value, epicsUInt32 valueMask, epicsUInt32 interruptMask)
 Sets the value for a UInt32Digital in the parameter library. More...
 
virtual asynStatus setUInt32DigitalInterrupt (int index, epicsUInt32 mask, interruptReason reason)
 Sets the interrupt mask and reason in the parameter library Calls paramList::setUInt32Interrupt (0, index, mask, reason) i.e. More...
 
virtual asynStatus setUInt32DigitalInterrupt (int list, int index, epicsUInt32 mask, interruptReason reason)
 Sets the interrupt mask and reason in the parameter library Calls paramList::setUInt32Interrupt (index, mask, reason) for the parameter list indexed by list. More...
 
virtual asynStatus clearUInt32DigitalInterrupt (int index, epicsUInt32 mask)
 Clears the interrupt mask in the parameter library Calls paramList::clearUInt32Interrupt (0, index, mask) i.e. More...
 
virtual asynStatus clearUInt32DigitalInterrupt (int list, int index, epicsUInt32 mask)
 Clears the interrupt mask in the parameter library Calls paramList::clearUInt32Interrupt (index, mask) for the parameter list indexed by list. More...
 
virtual asynStatus getUInt32DigitalInterrupt (int index, epicsUInt32 *mask, interruptReason reason)
 Gets the interrupt mask and reason in the parameter library Calls paramList::getUInt32Interrupt (0, index, mask, reason) i.e. More...
 
virtual asynStatus getUInt32DigitalInterrupt (int list, int index, epicsUInt32 *mask, interruptReason reason)
 Gets the interrupt mask and reason in the parameter library Calls paramList::getUInt32Interrupt (index, mask, reason) for the parameter list indexed by list. More...
 
virtual asynStatus setDoubleParam (int index, double value)
 Sets the value for a double in the parameter library. More...
 
virtual asynStatus setDoubleParam (int list, int index, double value)
 Sets the value for a double in the parameter library. More...
 
virtual asynStatus setStringParam (int index, const char *value)
 Sets the value for a string in the parameter library. More...
 
virtual asynStatus setStringParam (int list, int index, const char *value)
 Sets the value for a string in the parameter library. More...
 
virtual asynStatus setStringParam (int index, const std::string &value)
 Sets the value for a string in the parameter library. More...
 
virtual asynStatus setStringParam (int list, int index, const std::string &value)
 Sets the value for a string in the parameter library. More...
 
virtual asynStatus getIntegerParam (int index, epicsInt32 *value)
 Returns the value for an integer from the parameter library. More...
 
virtual asynStatus getIntegerParam (int list, int index, epicsInt32 *value)
 Returns the value for an integer from the parameter library. More...
 
virtual asynStatus getInteger64Param (int index, epicsInt64 *value)
 Returns the value for a 64-bit integer from the parameter library. More...
 
virtual asynStatus getInteger64Param (int list, int index, epicsInt64 *value)
 Returns the value for a 64-bit integer from the parameter library. More...
 
virtual asynStatus getUIntDigitalParam (int index, epicsUInt32 *value, epicsUInt32 mask)
 Returns the value for an UInt32Digital parameter from the parameter library. More...
 
virtual asynStatus getUIntDigitalParam (int list, int index, epicsUInt32 *value, epicsUInt32 mask)
 Returns the value for an UInt32Digital parameter from the parameter library. More...
 
virtual asynStatus getDoubleParam (int index, double *value)
 Returns the value for a double from the parameter library. More...
 
virtual asynStatus getDoubleParam (int list, int index, double *value)
 Returns the value for a double from the parameter library. More...
 
virtual asynStatus getStringParam (int index, int maxChars, char *value)
 Returns the value for a string from the parameter library. More...
 
virtual asynStatus getStringParam (int list, int index, int maxChars, char *value)
 Returns the value for a string from the parameter library. More...
 
virtual asynStatus getStringParam (int index, std::string &value)
 Returns the value for a string from the parameter library. More...
 
virtual asynStatus getStringParam (int list, int index, std::string &value)
 Returns the value for a string from the parameter library. More...
 
virtual asynStatus callParamCallbacks ()
 Calls callParamCallbacks(0, 0) i.e. More...
 
virtual asynStatus callParamCallbacks (int addr)
 Calls callParamCallbacks(addr, addr) i.e. More...
 
virtual asynStatus callParamCallbacks (int list, int addr)
 Calls paramList::callCallbacks(addr) for a specific parameter list. More...
 
virtual asynStatus updateTimeStamp ()
 Updates the timestamp for this port in pasynManager. More...
 
virtual asynStatus updateTimeStamp (epicsTimeStamp *pTimeStamp)
 Updates the timestamp for this port in pasynManager, and returns this timestamp. More...
 
virtual asynStatus getTimeStamp (epicsTimeStamp *pTimeStamp)
 Gets the most recent timestamp for this port from pasynManager. More...
 
virtual asynStatus setTimeStamp (const epicsTimeStamp *pTimeStamp)
 Sets the timestamp for this port in pasynManager. More...
 
asynStandardInterfaces * getAsynStdInterfaces ()
 Returns the asynStdInterfaces structure used by asynPortDriver. More...
 
virtual void reportParams (FILE *fp, int details)
 Calls paramList::report(fp, details) for each parameter list that the driver supports. More...
 
virtual void shutdownPortDriver ()
 Performs cleanup that cannot be done in a destructor. More...
 
bool needsShutdown ()
 Returns true when the port is destructible and shutdown() wasn't run yet. More...
 
void callbackTask ()
 

Public Attributes

char * portName
 The name of this asyn port. More...
 
int maxAddr
 The maximum asyn address (addr) supported by this driver. More...
 

Protected Member Functions

void initialize (const char *portNameIn, int maxAddrIn, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize)
 The following function is required to initialize from two constructors. More...
 

Protected Attributes

asynParamSet * paramSet
 
asynUser * pasynUserSelf
 asynUser connected to ourselves for asynTrace More...
 
asynStandardInterfaces * pasynStdInterfaces
 The asyn interfaces this driver implements. More...
 
asynStandardInterfaces & asynStdInterfaces
 Back-compat alias. More...
 

Friends

class paramList
 
class callbackThread
 

Detailed Description

Base class for asyn port drivers; handles most of the bookkeeping for writing an asyn port driver with standard asyn interfaces and a parameter library.

Destruction and cleanup

Historically, drivers were never destroyed. There are several reasons for this, an important one being that proper cleanup requires cooperation from the underlying system and the entire class hierarchy. That said, releasing resources is important in many cases, and is not too difficult if the rules listed below are followed by classes deriving from asynPortDriver:

  1. Pass the ASYN_DESTRUCTIBLE flag to the constructor of asynPortDriver. This will ensure asynManager destroys your driver on process exit by first calling shutdownPortDriver(), then deleting.
  2. To release resources that are private to your derived class, do so in the destructor. Remember, however, that no code from classes deriving from yours may run at this point, because the object is already partly destroyed. For example, virtual functions will behave as if not overriden, and threads spawned by derived classes must already be stopped.
  3. To use functionality that requires an intact object, release resources by overriding the shutdownPortDriver() function. A possible example is stopping data acquisition, which may involve functionality implemented in a derived class. On process exit, shutdownPortDriver() will be called before the destructors are executed.
  4. Your overriden shutdownPortDriver() must call the base class implementation.
  5. When deleting a driver instance directly (e.g., in your test code), always call shutdownPortDriver() first.

To implement the above rules, you can use the following template:

class myDriver : public asynPortDriver {
public:
    myDriver(const char *portName, ...) :
          asynPortDriver(portName, ..., ASYN_DESTRUCTIBLE, ...) {
        // Your driver code.
    }

    void shutdownPortDriver() {
        // Stop threads, you may use virtual functions.

        // Don't forget to call the base class function.
        baseDriver::shutdownPortDriver();
    }

    ~myDriver() {
        // Deallocate resources, don't use virtual functions.
    }
};

Constructor & Destructor Documentation

◆ asynPortDriver() [1/3]

asynPortDriver::asynPortDriver ( asynParamSet *  paramSet,
const char *  portName,
int  maxAddr,
int  interfaceMask,
int  interruptMask,
int  asynFlags,
int  autoConnect,
int  priority,
int  stackSize 
)

◆ asynPortDriver() [2/3]

asynPortDriver::asynPortDriver ( const char *  portNameIn,
int  maxAddrIn,
int  interfaceMask,
int  interruptMask,
int  asynFlags,
int  autoConnect,
int  priority,
int  stackSize 
)

Constructor for the asynPortDriver class.

Parameters
[in]portNameInThe name of the asyn port driver to be created.
[in]maxAddrInThe maximum number of asyn addr addresses this driver supports. Often it is 1 (which is the minimum), but some drivers, for example a 16-channel D/A or A/D would support values > 1. This controls the number of parameter tables that are created.
[in]interfaceMaskBit mask defining the asyn interfaces that this driver supports. The bit mask values are defined in asynPortDriver.h, e.g. asynInt32Mask.
[in]interruptMaskBit mask definining the asyn interfaces that can generate interrupts (callbacks). The bit mask values are defined in asynPortDriver.h, e.g. asynInt8ArrayMask.
[in]asynFlagsFlags when creating the asyn port driver; includes ASYN_CANBLOCK, ASYN_MULTIDEVICE and ASYN_DESTRUCTIBLE.
[in]autoConnectThe autoConnect flag for the asyn port driver. 1 if the driver should autoconnect.
[in]priorityThe thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. If it is 0 then the default value of epicsThreadPriorityMedium will be assigned by asynManager.
[in]stackSizeThe stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. If it is 0 then the default value of epicsThreadGetStackSize(epicsThreadStackMedium) will be assigned by asynManager.

◆ asynPortDriver() [3/3]

asynPortDriver::asynPortDriver ( const char *  portNameIn,
int  maxAddrIn,
int  paramTableSize,
int  interfaceMask,
int  interruptMask,
int  asynFlags,
int  autoConnect,
int  priority,
int  stackSize 
)

Legacy constructor for the asynPortDriver class (DEPRECATED - please use the one above instead).

asynPortDriver >=R4-32 handles the table size automatically. Thus the paramTableSize parameter has been removed from the constructor. This constructor is provided for backwards compatibility. Users should switch to using the constructor ASAP.

◆ ~asynPortDriver()

asynPortDriver::~asynPortDriver ( )
virtual

Destructor for asynPortDriver class; frees resources allocated when port driver is created.

Member Function Documentation

◆ callbackTask()

void asynPortDriver::callbackTask ( )

◆ callParamCallbacks() [1/3]

asynStatus asynPortDriver::callParamCallbacks ( )
virtual

Calls callParamCallbacks(0, 0) i.e.

with both list and asyn address.

◆ callParamCallbacks() [2/3]

asynStatus asynPortDriver::callParamCallbacks ( int  addr)
virtual

Calls callParamCallbacks(addr, addr) i.e.

with list=addr, which is normal.

◆ callParamCallbacks() [3/3]

asynStatus asynPortDriver::callParamCallbacks ( int  list,
int  addr 
)
virtual

Calls paramList::callCallbacks(addr) for a specific parameter list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]addrThe asyn address to be used in the callback. Typically the same value as list.

◆ clearInterruptUInt32Digital()

asynStatus asynPortDriver::clearInterruptUInt32Digital ( asynUser *  pasynUser,
epicsUInt32  mask 
)
virtual

Called when asyn clients call pasynUInt32Digital->clearInterrupt().

The base class implementation simply sets the value in the parameter library. Derived classes will reimplement this function if they need to perform an action when an clearInterrupt is called.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]maskInterrupt mask.

◆ clearUInt32DigitalInterrupt() [1/2]

asynStatus asynPortDriver::clearUInt32DigitalInterrupt ( int  index,
epicsUInt32  mask 
)
virtual

Clears the interrupt mask in the parameter library Calls paramList::clearUInt32Interrupt (0, index, mask) i.e.

for parameter list 0.

Parameters
[in]indexThe parameter number
[in]maskInterrupt mask.

◆ clearUInt32DigitalInterrupt() [2/2]

asynStatus asynPortDriver::clearUInt32DigitalInterrupt ( int  list,
int  index,
epicsUInt32  mask 
)
virtual

Clears the interrupt mask in the parameter library Calls paramList::clearUInt32Interrupt (index, mask) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]maskInterrupt mask.

◆ connect()

asynStatus asynPortDriver::connect ( asynUser *  pasynUser)
virtual

Connects driver to device; The base class implementation simply calls pasynManager->exceptionConnect if address is valid Derived classes can reimplement this function for real connection management.

Parameters
[in]pasynUserThe pasynUser structure which contains information about the port and address

◆ createParam() [1/2]

asynStatus asynPortDriver::createParam ( const char *  name,
asynParamType  type,
int *  index 
)
virtual

Creates a parameter in the parameter library.

Calls paramList::createParam (list, name, index) for all parameters lists.

Parameters
[in]nameParameter name
[in]typeParameter type
[out]indexParameter number

◆ createParam() [2/2]

asynStatus asynPortDriver::createParam ( int  list,
const char *  name,
asynParamType  type,
int *  index 
)
virtual

Creates a parameter in the parameter library.

Calls paramList::addParam (name, index) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]nameParameter name
[in]typeParameter type
[out]indexParameter number

◆ createParams()

asynStatus asynPortDriver::createParams ( )
virtual

Create any parameters defined in the asynParamSet, if there are any.

◆ disconnect()

asynStatus asynPortDriver::disconnect ( asynUser *  pasynUser)
virtual

Disconnects driver from device; the base class implementation simply calls pasynManager->exceptionDisconnect.

Derived classes can reimplement this function for real connection management.

Parameters
[in]pasynUserThe pasynUser structure which contains information about the port and address

◆ doCallbacksEnum()

asynStatus asynPortDriver::doCallbacksEnum ( char *  strings[],
int  values[],
int  severities[],
size_t  nElements,
int  reason,
int  address 
)
virtual

Called by driver to do the callbacks to registered clients on the asynEnum interface.

Parameters
[in]stringsArray of string pointers.
[in]valuesArray of values
[in]severitiesArray of severities
[in]nElementsSize of value array
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addressA client will be called if address matches the address registered for that client.

◆ doCallbacksFloat32Array()

asynStatus asynPortDriver::doCallbacksFloat32Array ( epicsFloat32 *  value,
size_t  nElements,
int  reason,
int  addr 
)
virtual

Called by driver to do the callbacks to registered clients on the asynFloat32Array interface.

Parameters
[in]valueAddress of the array.
[in]nElementsNumber of elements in the array.
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addrA client will be called if addr matches the asyn address registered for that client.

◆ doCallbacksFloat64Array()

asynStatus asynPortDriver::doCallbacksFloat64Array ( epicsFloat64 *  value,
size_t  nElements,
int  reason,
int  addr 
)
virtual

Called by driver to do the callbacks to registered clients on the asynFloat64Array interface.

Parameters
[in]valueAddress of the array.
[in]nElementsNumber of elements in the array.
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addrA client will be called if addr matches the asyn address registered for that client.

◆ doCallbacksGenericPointer()

asynStatus asynPortDriver::doCallbacksGenericPointer ( void *  genericPointer,
int  reason,
int  address 
)
virtual

Called by driver to do the callbacks to registered clients on the asynGenericPointer interface.

Parameters
[in]genericPointerPointer to the object
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addressA client will be called if address matches the address registered for that client.

◆ doCallbacksInt16Array()

asynStatus asynPortDriver::doCallbacksInt16Array ( epicsInt16 *  value,
size_t  nElements,
int  reason,
int  addr 
)
virtual

Called by driver to do the callbacks to registered clients on the asynInt16Array interface.

Parameters
[in]valueAddress of the array.
[in]nElementsNumber of elements in the array.
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addrA client will be called if addr matches the asyn address registered for that client.

◆ doCallbacksInt32Array()

asynStatus asynPortDriver::doCallbacksInt32Array ( epicsInt32 *  value,
size_t  nElements,
int  reason,
int  addr 
)
virtual

Called by driver to do the callbacks to registered clients on the asynInt32Array interface.

Parameters
[in]valueAddress of the array.
[in]nElementsNumber of elements in the array.
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addrA client will be called if addr matches the asyn address registered for that client.

◆ doCallbacksInt64Array()

asynStatus asynPortDriver::doCallbacksInt64Array ( epicsInt64 *  value,
size_t  nElements,
int  reason,
int  addr 
)
virtual

Called by driver to do the callbacks to registered clients on the asynInt64Array interface.

Parameters
[in]valueAddress of the array.
[in]nElementsNumber of elements in the array.
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addrA client will be called if addr matches the asyn address registered for that client.

◆ doCallbacksInt8Array()

asynStatus asynPortDriver::doCallbacksInt8Array ( epicsInt8 *  value,
size_t  nElements,
int  reason,
int  addr 
)
virtual

Called by driver to do the callbacks to registered clients on the asynInt8Array interface.

Parameters
[in]valueAddress of the array.
[in]nElementsNumber of elements in the array.
[in]reasonA client will be called if reason matches pasynUser->reason registered for that client.
[in]addrA client will be called if addr matches the asyn address registered for that client.

◆ drvUserCreate()

asynStatus asynPortDriver::drvUserCreate ( asynUser *  pasynUser,
const char *  drvInfo,
const char **  pptypeName,
size_t *  psize 
)
virtual

Called by asynManager to pass a pasynUser structure and drvInfo string to the driver; Assigns pasynUser->reason based on the value of the drvInfo string.

This base class implementation looks up the drvInfo string in the parameter list.

Parameters
[in]pasynUserpasynUser structure that driver will modify
[in]drvInfoString containing information about what driver function is being referenced
[out]pptypeNameLocation in which driver can write information.
[out]psizeLocation where driver can write information about size of pptypeName

◆ drvUserDestroy()

asynStatus asynPortDriver::drvUserDestroy ( asynUser *  pasynUser)
virtual

Frees any resources allocated by drvUserCreate.

This base class implementation does nothing. Derived classes could reimplement this function if they allocate any resources in drvUserCreate, but asynPortDriver classes typically do not need to do so.

◆ drvUserGetType()

asynStatus asynPortDriver::drvUserGetType ( asynUser *  pasynUser,
const char **  pptypeName,
size_t *  psize 
)
virtual

Returns strings associated with driver-specific commands.

This base class implementation does nothing. Derived classes could reimplement this function to return the requested information, but most do not reimplement this.

Parameters
[in]pasynUserpasynUser structure that driver will modify
[out]pptypeNameLocation in which driver can write information.
[out]psizeLocation where driver can write information about size of pptypeName

◆ findParam() [1/2]

asynStatus asynPortDriver::findParam ( const char *  name,
int *  index 
)
virtual

Finds a parameter in the parameter library.

Calls findParam(0, name, index), i.e. for parameter list 0.

Parameters
[in]nameParameter name
[out]indexParameter number

◆ findParam() [2/2]

asynStatus asynPortDriver::findParam ( int  list,
const char *  name,
int *  index 
)
virtual

Finds a parameter in the parameter library.

Calls paramList::findParam (name, index) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]nameParameter name
[out]indexParameter number

◆ flushOctet()

asynStatus asynPortDriver::flushOctet ( asynUser *  pasynUser)
virtual

Called when asyn clients call pasynOctet->flush().

The base class implementation duplicates the function in asynOctetBase.c, i.e. it does reads with a timeout of 0.05 seconds until the underlying driver returns no more data. Derived classes will reimplement this function if they desire a different behavior.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.

◆ getAddress()

asynStatus asynPortDriver::getAddress ( asynUser *  pasynUser,
int *  address 
)
virtual

Returns the asyn address associated with a pasynUser structure.

Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]addressReturned address.
Returns
Returns asynError if the address is > maxAddr value passed to asynPortDriver::asynPortDriver.

◆ getAsynStdInterfaces()

asynStandardInterfaces * asynPortDriver::getAsynStdInterfaces ( )

Returns the asynStdInterfaces structure used by asynPortDriver.

◆ getBounds()

asynStatus asynPortDriver::getBounds ( asynUser *  pasynUser,
epicsInt32 *  low,
epicsInt32 *  high 
)
virtual

Called when asyn clients call pasynInt32->getBounds(), returning the bounds on the asynInt32 interface for drivers that use raw units.

Device support uses these values for unit conversion. The base class implementation simply returns low=0, high=65535. Derived classes can reimplement this function if they support raw units with different limits.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]lowAddress of the low limit.
[out]highAddress of the high limit.

◆ getBounds64()

asynStatus asynPortDriver::getBounds64 ( asynUser *  pasynUser,
epicsInt64 *  low,
epicsInt64 *  high 
)
virtual

Called when asyn clients call pasynInt64->getBounds(), returning the bounds on the asynInt64 interface for drivers that use raw units.

Device support uses these values for unit conversion. The base class implementation simply returns low=0, high=65535. Derived classes can reimplement this function if they support raw units with different limits.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]lowAddress of the low limit.
[out]highAddress of the high limit.

◆ getDoubleParam() [1/2]

asynStatus asynPortDriver::getDoubleParam ( int  index,
double *  value 
)
virtual

Returns the value for a double from the parameter library.

Calls getDoubleParam(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]valueAddress of value to get.

◆ getDoubleParam() [2/2]

asynStatus asynPortDriver::getDoubleParam ( int  list,
int  index,
double *  value 
)
virtual

Returns the value for a double from the parameter library.

Calls paramList::getDouble (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]valueAddress of value to get.

◆ getInputEosOctet()

asynStatus asynPortDriver::getInputEosOctet ( asynUser *  pasynUser,
char *  eos,
int  eosSize,
int *  eosLen 
)
virtual

Called when asyn clients call pasynOctet->getInputEos().

The base class implementation simply copies the inputEos from the class private data. Derived classes will reimplement this function if they desire a different behavior.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]eosThe input eos
[in]eosSizeThe number of characters in the eos
[out]eosLenThe returned eos length

◆ getInteger64Param() [1/2]

asynStatus asynPortDriver::getInteger64Param ( int  index,
epicsInt64 *  value 
)
virtual

Returns the value for a 64-bit integer from the parameter library.

Calls getInteger64Param(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]valueAddress of value to get.

◆ getInteger64Param() [2/2]

asynStatus asynPortDriver::getInteger64Param ( int  list,
int  index,
epicsInt64 *  value 
)
virtual

Returns the value for a 64-bit integer from the parameter library.

Calls paramList::getInteger64 (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]valueAddress of value to get.

◆ getIntegerParam() [1/2]

asynStatus asynPortDriver::getIntegerParam ( int  index,
epicsInt32 *  value 
)
virtual

Returns the value for an integer from the parameter library.

Calls getIntegerParam(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]valueAddress of value to get.

◆ getIntegerParam() [2/2]

asynStatus asynPortDriver::getIntegerParam ( int  list,
int  index,
epicsInt32 *  value 
)
virtual

Returns the value for an integer from the parameter library.

Calls paramList::getInteger (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]valueAddress of value to get.

◆ getInterruptUInt32Digital()

asynStatus asynPortDriver::getInterruptUInt32Digital ( asynUser *  pasynUser,
epicsUInt32 *  mask,
interruptReason  reason 
)
virtual

Called when asyn clients call pasynUInt32Digital->getInterrupt().

The base class implementation simply returns the value from the parameter library. Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]maskInterrupt mask address.
[in]reasonInterrupt reason.

◆ getNumParams() [1/2]

asynStatus asynPortDriver::getNumParams ( int *  numParams)
virtual

Returns the number of parameters in the parameter library.

Calls getNumParams(numParams), i.e. for parameter list 0.

Parameters
[out]numParamsNumber of parameters

◆ getNumParams() [2/2]

asynStatus asynPortDriver::getNumParams ( int  list,
int *  numParams 
)
virtual

Returns the number of parameters in the parameter library.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[out]numParamsNumber of parameters

◆ getOutputEosOctet()

asynStatus asynPortDriver::getOutputEosOctet ( asynUser *  pasynUser,
char *  eos,
int  eosSize,
int *  eosLen 
)
virtual

Called when asyn clients call pasynOctet->getOutputEos().

The base class implementation simply copies the outputEos from the class private data. Derived classes will reimplement this function if they desire a different behavior.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]eosThe output eos
[in]eosSizeThe number of characters in the eos
[out]eosLenThe returned eos length

◆ getParamAlarmSeverity() [1/2]

asynStatus asynPortDriver::getParamAlarmSeverity ( int  index,
int *  alarmSeverity 
)
virtual

Gets the alarmSeverity for a parameter in the parameter library.

Calls getParamAlarmSeverity(0, index, status) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]alarmSeverityAddress of alarmSeverity to get.

◆ getParamAlarmSeverity() [2/2]

asynStatus asynPortDriver::getParamAlarmSeverity ( int  list,
int  index,
int *  alarmSeverity 
)
virtual

Gets the alarmSeverity for a parameter in the parameter library.

Calls paramList::getAlarmSeverity(index, status) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]alarmSeverityAddress of status to get.

◆ getParamAlarmStatus() [1/2]

asynStatus asynPortDriver::getParamAlarmStatus ( int  index,
int *  alarmStatus 
)
virtual

Gets the alarmStatus for a parameter in the parameter library.

Calls getParamAlarmStatus(0, index, status) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]alarmStatusAddress of alarmStatus to get.

◆ getParamAlarmStatus() [2/2]

asynStatus asynPortDriver::getParamAlarmStatus ( int  list,
int  index,
int *  alarmStatus 
)
virtual

Gets the alarmStatus for a parameter in the parameter library.

Calls paramList::getAlarmStatus(index, status) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]alarmStatusAddress of status to get.

◆ getParamName() [1/2]

asynStatus asynPortDriver::getParamName ( int  index,
const char **  name 
)
virtual

Returns the name of a parameter in the parameter library.

Calls getParamName(0, index, name) i.e. for parameter list 0.

Parameters
[in]indexParameter number
[out]nameParameter name

◆ getParamName() [2/2]

asynStatus asynPortDriver::getParamName ( int  list,
int  index,
const char **  name 
)
virtual

Returns the name of a parameter in the parameter library.

Calls paramList::getName (index, name) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexParameter number
[out]nameParameter name

◆ getParamStatus() [1/2]

asynStatus asynPortDriver::getParamStatus ( int  index,
asynStatus *  status 
)
virtual

Gets the status for a parameter in the parameter library.

Calls getParamStatus(0, index, status) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]statusAddress of tatus to get.

◆ getParamStatus() [2/2]

asynStatus asynPortDriver::getParamStatus ( int  list,
int  index,
asynStatus *  paramStatus 
)
virtual

Gets the status for a parameter in the parameter library.

Calls paramList::setStatus(index, status) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]paramStatusAddress of status to get.

◆ getParamType() [1/2]

asynStatus asynPortDriver::getParamType ( int  index,
asynParamType type 
)
virtual

Returns the asynParamType of a parameter in the parameter library*.

Parameters
[in]indexParameter number
[out]typeParameter type

◆ getParamType() [2/2]

asynStatus asynPortDriver::getParamType ( int  list,
int  index,
asynParamType type 
)
virtual

Returns the asynParamType of a parameter in the parameter library.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexParameter number
[out]typeParameter type

◆ getStringParam() [1/4]

asynStatus asynPortDriver::getStringParam ( int  index,
int  maxChars,
char *  value 
)
virtual

Returns the value for a string from the parameter library.

Calls getStringParam(0, index, maxChars, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]maxCharsMaximum number of characters to return.
[out]valueAddress of value to get.

◆ getStringParam() [2/4]

asynStatus asynPortDriver::getStringParam ( int  index,
std::string &  value 
)
virtual

Returns the value for a string from the parameter library.

Calls getStringParam(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]valueString value to get.

◆ getStringParam() [3/4]

asynStatus asynPortDriver::getStringParam ( int  list,
int  index,
int  maxChars,
char *  value 
)
virtual

Returns the value for a string from the parameter library.

Calls paramList::getString (index, maxChars, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]maxCharsMaximum number of characters to return.
[out]valueAddress of value to get.

◆ getStringParam() [4/4]

asynStatus asynPortDriver::getStringParam ( int  list,
int  index,
std::string &  value 
)
virtual

Returns the value for a string from the parameter library.

Calls paramList::getString (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]valueString value to get.

◆ getTimeStamp()

asynStatus asynPortDriver::getTimeStamp ( epicsTimeStamp *  pTimeStamp)
virtual

Gets the most recent timestamp for this port from pasynManager.

Parameters
[out]pTimeStampA pointer to an epicsTimeStamp to receive the timestamp.

◆ getUInt32DigitalInterrupt() [1/2]

asynStatus asynPortDriver::getUInt32DigitalInterrupt ( int  index,
epicsUInt32 *  mask,
interruptReason  reason 
)
virtual

Gets the interrupt mask and reason in the parameter library Calls paramList::getUInt32Interrupt (0, index, mask, reason) i.e.

for parameter list 0.

Parameters
[in]indexThe parameter number
[in]maskInterrupt mask.
[in]reasonInterrupt reason.

◆ getUInt32DigitalInterrupt() [2/2]

asynStatus asynPortDriver::getUInt32DigitalInterrupt ( int  list,
int  index,
epicsUInt32 *  mask,
interruptReason  reason 
)
virtual

Gets the interrupt mask and reason in the parameter library Calls paramList::getUInt32Interrupt (index, mask, reason) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]maskInterrupt mask.
[in]reasonInterrupt reason.

◆ getUIntDigitalParam() [1/2]

asynStatus asynPortDriver::getUIntDigitalParam ( int  index,
epicsUInt32 *  value,
epicsUInt32  mask 
)
virtual

Returns the value for an UInt32Digital parameter from the parameter library.

Calls getUIntDigitalParam(0, index, value, mask) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[out]valueAddress of value to get.
[in]maskThe mask to apply when getting the value

◆ getUIntDigitalParam() [2/2]

asynStatus asynPortDriver::getUIntDigitalParam ( int  list,
int  index,
epicsUInt32 *  value,
epicsUInt32  mask 
)
virtual

Returns the value for an UInt32Digital parameter from the parameter library.

Calls paramList::getUInt32 (index, value, mask) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[out]valueAddress of value to get.
[in]maskThe mask to apply when getting the value.

◆ initialize()

void asynPortDriver::initialize ( const char *  portNameIn,
int  maxAddrIn,
int  interfaceMask,
int  interruptMask,
int  asynFlags,
int  autoConnect,
int  priority,
int  stackSize 
)
protected

The following function is required to initialize from two constructors.

Once we can rely on C++11 this code can be moved back into the primary constructor. The secondary constructor can then be converted into a delegating constructor.

◆ lock()

asynStatus asynPortDriver::lock ( )
virtual

Locks the driver to prevent multiple threads from accessing memory at the same time.

This function is called whenever asyn clients call the functions on the asyn interfaces. Drivers with their own background threads must call lock() to protect conflicts with asyn clients. They can call unlock() to permit asyn clients to run during times that the driver thread is idle or is performing compute bound work that does not access memory also accessible by other threads.

◆ needsShutdown()

bool asynPortDriver::needsShutdown ( )

Returns true when the port is destructible and shutdown() wasn't run yet.

◆ parseAsynUser()

asynStatus asynPortDriver::parseAsynUser ( asynUser *  pasynUser,
int *  reason,
int *  address,
const char **  paramName 
)
virtual

Returns the asyn reason, address, and parameter name associated with a pasynUser structure.

Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]reasonReturned reason (pasynUser->reason)
[out]addressReturned address (this->getAddress())
[out]paramNameReturned parameter name (this->getParamName())
Returns
Returns asynError if the address is < 0 or > maxAddr value passed to asynPortDriver::asynPortDriver.

◆ readEnum()

asynStatus asynPortDriver::readEnum ( asynUser *  pasynUser,
char *  strings[],
int  values[],
int  severities[],
size_t  nElements,
size_t *  nIn 
)
virtual

Called when asyn clients call pasynEnum->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]stringsArray of string pointers.
[in]valuesArray of values
[in]severitiesArray of severities
[in]nElementsSize of value array
[out]nInNumber of elements actually returned

Reimplemented in testAsynPortDriver.

◆ readFloat32Array()

asynStatus asynPortDriver::readFloat32Array ( asynUser *  pasynUser,
epicsFloat32 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Called when asyn clients call pasynFloat32Array->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to read.
[in]nElementsNumber of elements to read.
[out]nInNumber of elements actually read.

◆ readFloat64()

asynStatus asynPortDriver::readFloat64 ( asynUser *  pasynUser,
epicsFloat64 *  value 
)
virtual

Called when asyn clients call pasynFloat64->read().

The base class implementation simply returns the value from the parameter library. Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueAddress of the value to read.

◆ readFloat64Array()

asynStatus asynPortDriver::readFloat64Array ( asynUser *  pasynUser,
epicsFloat64 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Called when asyn clients call pasynFloat64Array->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to read.
[in]nElementsNumber of elements to read.
[out]nInNumber of elements actually read.

Reimplemented in testAsynPortDriver.

◆ readGenericPointer()

asynStatus asynPortDriver::readGenericPointer ( asynUser *  pasynUser,
void *  genericPointer 
)
virtual

Called when asyn clients call pasynGenericPointer->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]genericPointerPointer to the object to read.

◆ readInt16Array()

asynStatus asynPortDriver::readInt16Array ( asynUser *  pasynUser,
epicsInt16 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Called when asyn clients call pasynInt16Array->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to read.
[in]nElementsNumber of elements to read.
[out]nInNumber of elements actually read.

◆ readInt32()

asynStatus asynPortDriver::readInt32 ( asynUser *  pasynUser,
epicsInt32 *  value 
)
virtual

Called when asyn clients call pasynInt32->read().

The base class implementation simply returns the value from the parameter library. Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]valueAddress of the value to read.

◆ readInt32Array()

asynStatus asynPortDriver::readInt32Array ( asynUser *  pasynUser,
epicsInt32 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Called when asyn clients call pasynInt32Array->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to read.
[in]nElementsNumber of elements to read.
[out]nInNumber of elements actually read.

◆ readInt64()

asynStatus asynPortDriver::readInt64 ( asynUser *  pasynUser,
epicsInt64 *  value 
)
virtual

Called when asyn clients call pasynInt64->read().

The base class implementation simply returns the value from the parameter library. Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]valueAddress of the value to read.

◆ readInt64Array()

asynStatus asynPortDriver::readInt64Array ( asynUser *  pasynUser,
epicsInt64 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Called when asyn clients call pasynInt64Array->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to read.
[in]nElementsNumber of elements to read.
[out]nInNumber of elements actually read.

◆ readInt8Array()

asynStatus asynPortDriver::readInt8Array ( asynUser *  pasynUser,
epicsInt8 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Called when asyn clients call pasynInt8Array->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to read.
[in]nElementsNumber of elements to read.
[out]nInNumber of elements actually read.

◆ readOctet()

asynStatus asynPortDriver::readOctet ( asynUser *  pasynUser,
char *  value,
size_t  maxChars,
size_t *  nActual,
int *  eomReason 
)
virtual

Called when asyn clients call pasynOctet->read().

The base class implementation simply returns the value from the parameter library. Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueAddress of the string to read.
[in]maxCharsMaximum number of characters to read.
[out]nActualNumber of characters actually read. Base class sets this to strlen(value).
[out]eomReasonReason that read terminated. Base class sets this to ASYN_EOM_END.

◆ readOption()

asynStatus asynPortDriver::readOption ( asynUser *  pasynUser,
const char *  key,
char *  value,
int  maxChars 
)
virtual

Called when asyn clients call pasynOption->read().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]keyOption key string.
[in]valueAddress of value string to be returned
[in]maxCharsSize of value string

◆ readUInt32Digital()

asynStatus asynPortDriver::readUInt32Digital ( asynUser *  pasynUser,
epicsUInt32 *  value,
epicsUInt32  mask 
)
virtual

Called when asyn clients call pasynUInt32Digital->read().

The base class implementation simply returns the value from the parameter library. Derived classes rarely need to reimplement this function.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[out]valueAddress of the value to read.
[in]maskMask value to use when reading the value.

◆ report()

void asynPortDriver::report ( FILE *  fp,
int  details 
)
virtual

Reports on status of the driver.

Parameters
[in]fpThe file pointer on which report information will be written
[in]detailsThe level of report detail desired; If details >= 1 then information is printed about the contents of the parameter library for address 0 If details >= 2 then information is printed about the contents of the parameter library for all addresses If details >= 3 then information is printed about all of the interrupt callbacks registered. Derived classes typically reimplement this function to print driver-specific details and then call this base class function.

◆ reportGetParamErrors()

void asynPortDriver::reportGetParamErrors ( asynStatus  status,
int  index,
int  list,
const char *  functionName 
)
virtual

Reports errors when getting parameters.

asynParamBadIndex and asynParamWrongType are printed with ASYN_TRACE_ERROR because they should never happen. asynParamUndefined is printed with ASYN_TRACE_FLOW because it is an expected error if the value is read before it is defined, which device support can do.

Parameters
[in]statusThe error status.
[in]indexThe parameter number
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]functionNameThe name of the function that generated the error

◆ reportParams()

void asynPortDriver::reportParams ( FILE *  fp,
int  details 
)
virtual

Calls paramList::report(fp, details) for each parameter list that the driver supports.

Parameters
[in]fpThe file pointer on which report information will be written
[in]detailsThe level of report detail desired; always report details on address 0; >=2 report all addresses

◆ reportSetParamErrors()

void asynPortDriver::reportSetParamErrors ( asynStatus  status,
int  index,
int  list,
const char *  functionName 
)
virtual

Reports errors when setting parameters.

Parameters
[in]statusThe error status.
[in]indexThe parameter number
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]functionNameThe name of the function that generated the error

◆ setDoubleParam() [1/2]

asynStatus asynPortDriver::setDoubleParam ( int  index,
double  value 
)
virtual

Sets the value for a double in the parameter library.

Calls setDoubleParam(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]valueValue to set.

◆ setDoubleParam() [2/2]

asynStatus asynPortDriver::setDoubleParam ( int  list,
int  index,
double  value 
)
virtual

Sets the value for a double in the parameter library.

Calls paramList::setDouble (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]valueValue to set.

◆ setInputEosOctet()

asynStatus asynPortDriver::setInputEosOctet ( asynUser *  pasynUser,
const char *  eos,
int  eosLen 
)
virtual

Called when asyn clients call pasynOctet->setInputEos().

The base class implementation simply copies the inputEos to the class private data. Derived classes will reimplement this function if they desire a different behavior.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]eosThe input eos
[in]eosLenThe number of characters in the eos

◆ setInteger64Param() [1/2]

asynStatus asynPortDriver::setInteger64Param ( int  index,
epicsInt64  value 
)
virtual

Sets the value for a 64-bit integer in the parameter library.

Calls setInteger64Param(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]valueValue to set.

◆ setInteger64Param() [2/2]

asynStatus asynPortDriver::setInteger64Param ( int  list,
int  index,
epicsInt64  value 
)
virtual

Sets the value for a 64-bit integer in the parameter library.

Calls paramList::setInteger64 (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]valueValue to set.

◆ setIntegerParam() [1/2]

asynStatus asynPortDriver::setIntegerParam ( int  index,
int  value 
)
virtual

Sets the value for an integer in the parameter library.

Calls setIntegerParam(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]valueValue to set.

◆ setIntegerParam() [2/2]

asynStatus asynPortDriver::setIntegerParam ( int  list,
int  index,
int  value 
)
virtual

Sets the value for an integer in the parameter library.

Calls paramList::setInteger (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]valueValue to set.

◆ setInterruptUInt32Digital()

asynStatus asynPortDriver::setInterruptUInt32Digital ( asynUser *  pasynUser,
epicsUInt32  mask,
interruptReason  reason 
)
virtual

Called when asyn clients call pasynUInt32Digital->setInterrupt().

The base class implementation simply sets the value in the parameter library. Derived classes will reimplement this function if they need to perform an action when an setInterrupt is called.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]maskInterrupt mask.
[in]reasonInterrupt reason.

◆ setOutputEosOctet()

asynStatus asynPortDriver::setOutputEosOctet ( asynUser *  pasynUser,
const char *  eos,
int  eosLen 
)
virtual

Called when asyn clients call pasynOctet->setOutputEos().

The base class implementation simply copies the outputEos to the class private data. Derived classes will reimplement this function if they desire a different behavior.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]eosThe output eos
[in]eosLenThe number of characters in the eos

◆ setParamAlarmSeverity() [1/2]

asynStatus asynPortDriver::setParamAlarmSeverity ( int  index,
int  alarmSeverity 
)
virtual

Sets the alarmSeverity for a parameter in the parameter library.

Calls setParamAlarmSeverity(0, index, status) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]alarmSeveritySeverity to set.

◆ setParamAlarmSeverity() [2/2]

asynStatus asynPortDriver::setParamAlarmSeverity ( int  list,
int  index,
int  alarmSeverity 
)
virtual

Sets the alarmSeverity for a parameter in the parameter library.

Calls paramList::setAlarmSeverity(index, status) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]alarmSeveritySeverity to set.

◆ setParamAlarmStatus() [1/2]

asynStatus asynPortDriver::setParamAlarmStatus ( int  index,
int  alarmStatus 
)
virtual

Sets the alarmStatus for a parameter in the parameter library.

Calls setParamAlarmStatus(0, index, status) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]alarmStatusStatus to set.

◆ setParamAlarmStatus() [2/2]

asynStatus asynPortDriver::setParamAlarmStatus ( int  list,
int  index,
int  alarmStatus 
)
virtual

Sets the alarmStatus for a parameter in the parameter library.

Calls paramList::setAlarmStatus(index, status) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]alarmStatusStatus to set.

◆ setParamStatus() [1/2]

asynStatus asynPortDriver::setParamStatus ( int  index,
asynStatus  status 
)
virtual

Sets the status for a parameter in the parameter library.

Calls setParamStatus(0, index, status) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]statusStatus to set.

◆ setParamStatus() [2/2]

asynStatus asynPortDriver::setParamStatus ( int  list,
int  index,
asynStatus  paramStatus 
)
virtual

Sets the status for a parameter in the parameter library.

Calls paramList::setStatus(index, status) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]paramStatusStatus to set.

◆ setStringParam() [1/4]

asynStatus asynPortDriver::setStringParam ( int  index,
const char *  value 
)
virtual

Sets the value for a string in the parameter library.

Calls setStringParam(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]valueAddress of value to set.

◆ setStringParam() [2/4]

asynStatus asynPortDriver::setStringParam ( int  index,
const std::string &  value 
)
virtual

Sets the value for a string in the parameter library.

Calls setStringParam(0, index, value) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]valueString value to set.

◆ setStringParam() [3/4]

asynStatus asynPortDriver::setStringParam ( int  list,
int  index,
const char *  value 
)
virtual

Sets the value for a string in the parameter library.

Calls paramList::setString (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]valueAddress of value to set.

◆ setStringParam() [4/4]

asynStatus asynPortDriver::setStringParam ( int  list,
int  index,
const std::string &  value 
)
virtual

Sets the value for a string in the parameter library.

Calls paramList::setString (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]valueString value to set.

◆ setTimeStamp()

asynStatus asynPortDriver::setTimeStamp ( const epicsTimeStamp *  pTimeStamp)
virtual

Sets the timestamp for this port in pasynManager.

Parameters
[in]pTimeStampA pointer to the epicsTimeStamp to set.

◆ setUInt32DigitalInterrupt() [1/2]

asynStatus asynPortDriver::setUInt32DigitalInterrupt ( int  index,
epicsUInt32  mask,
interruptReason  reason 
)
virtual

Sets the interrupt mask and reason in the parameter library Calls paramList::setUInt32Interrupt (0, index, mask, reason) i.e.

for parameter list 0.

Parameters
[in]indexThe parameter number
[in]maskInterrupt mask.
[in]reasonInterrupt reason.

◆ setUInt32DigitalInterrupt() [2/2]

asynStatus asynPortDriver::setUInt32DigitalInterrupt ( int  list,
int  index,
epicsUInt32  mask,
interruptReason  reason 
)
virtual

Sets the interrupt mask and reason in the parameter library Calls paramList::setUInt32Interrupt (index, mask, reason) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]maskInterrupt mask.
[in]reasonInterrupt reason.

◆ setUIntDigitalParam() [1/4]

asynStatus asynPortDriver::setUIntDigitalParam ( int  index,
epicsUInt32  value,
epicsUInt32  valueMask 
)
virtual

Sets the value for a UInt32Digital in the parameter library.

Calls setUIntDigitalParam(0, index, value, valueMask, 0) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]valueValue to set.
[in]valueMaskThe mask to use when setting the value.

◆ setUIntDigitalParam() [2/4]

asynStatus asynPortDriver::setUIntDigitalParam ( int  index,
epicsUInt32  value,
epicsUInt32  valueMask,
epicsUInt32  interruptMask 
)
virtual

Sets the value for a UInt32Digital in the parameter library.

Calls setUIntDigitalParam(0, index, value, valueMask, interruptMask) i.e. for parameter list 0.

Parameters
[in]indexThe parameter number
[in]valueValue to set.
[in]valueMaskThe mask to use when setting the value.
[in]interruptMaskA mask that indicates which bits have changed even if the value is the same, so callbacks will be done

◆ setUIntDigitalParam() [3/4]

asynStatus asynPortDriver::setUIntDigitalParam ( int  list,
int  index,
epicsUInt32  value,
epicsUInt32  valueMask 
)
virtual

Sets the value for a UInt32Digital in the parameter library.

Calls paramList::setUIntDigitalParam(list, index, value, valueMask, 0) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]valueValue to set.
[in]valueMaskThe mask to use when setting the value.

◆ setUIntDigitalParam() [4/4]

asynStatus asynPortDriver::setUIntDigitalParam ( int  list,
int  index,
epicsUInt32  value,
epicsUInt32  valueMask,
epicsUInt32  interruptMask 
)
virtual

Sets the value for a UInt32Digital in the parameter library.

Calls paramList::setUInt32 (index, value) for the parameter list indexed by list.

Parameters
[in]listThe parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in]indexThe parameter number
[in]valueValue to set
[in]valueMaskThe mask to use when setting the value.
[in]interruptMaskA mask that indicates which bits have changed even if the value is the same, so callbacks will be done

◆ shutdownPortDriver()

void asynPortDriver::shutdownPortDriver ( )
virtual

Performs cleanup that cannot be done in a destructor.

The destructor is limited in what it can do because the object is already partially destroyed. This function has no such limitation. However, it is not a destructor, and must not leave dangling references; the driver must be left in a consistent state, allowing the destructor to run.

When overridden, this function must call the base class implementation.

This function is called with the driver unlocked. When overriding it, take care to lock it as necessary.

◆ unlock()

asynStatus asynPortDriver::unlock ( )
virtual

Unlocks the driver; called when an asyn client or driver is done accessing common memory.

◆ updateTimeStamp() [1/2]

asynStatus asynPortDriver::updateTimeStamp ( )
virtual

Updates the timestamp for this port in pasynManager.

Drivers typically call this function when they receive new data and want records with TSE=-2 to use this time as their timestamp.

◆ updateTimeStamp() [2/2]

asynStatus asynPortDriver::updateTimeStamp ( epicsTimeStamp *  pTimeStamp)
virtual

Updates the timestamp for this port in pasynManager, and returns this timestamp.

Drivers typically call this function when they receive new data and want records with TSE=-2 to use this time as their timestamp.

Parameters
[out]pTimeStampA pointer to an epicsTimeStamp to receive the new timestamp.

◆ writeEnum()

asynStatus asynPortDriver::writeEnum ( asynUser *  pasynUser,
char *  strings[],
int  values[],
int  severities[],
size_t  nElements 
)
virtual

Called when asyn clients call pasynEnum->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]stringsArray of string pointers.
[in]valuesArray of values
[in]severitiesArray of severities
[in]nElementsSize of value array

◆ writeFloat32Array()

asynStatus asynPortDriver::writeFloat32Array ( asynUser *  pasynUser,
epicsFloat32 *  value,
size_t  nElements 
)
virtual

Called when asyn clients call pasynFloat32Array->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to write.
[in]nElementsNumber of elements to write.

◆ writeFloat64()

asynStatus asynPortDriver::writeFloat64 ( asynUser *  pasynUser,
epicsFloat64  value 
)
virtual

Called when asyn clients call pasynFloat64->write().

The base class implementation simply sets the value in the parameter library and calls any registered callbacks for this pasynUser->reason and address. Derived classes will reimplement this function if they need to perform an action when an asynFloat64 value is written.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueValue to write.

Reimplemented in testAsynPortDriver.

◆ writeFloat64Array()

asynStatus asynPortDriver::writeFloat64Array ( asynUser *  pasynUser,
epicsFloat64 *  value,
size_t  nElements 
)
virtual

Called when asyn clients call pasynFloat64Array->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to write.
[in]nElementsNumber of elements to write.

◆ writeGenericPointer()

asynStatus asynPortDriver::writeGenericPointer ( asynUser *  pasynUser,
void *  genericPointer 
)
virtual

Called when asyn clients call pasynGenericPointer->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]genericPointerPointer to the object to write.

◆ writeInt16Array()

asynStatus asynPortDriver::writeInt16Array ( asynUser *  pasynUser,
epicsInt16 *  value,
size_t  nElements 
)
virtual

Called when asyn clients call pasynInt16Array->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to write.
[in]nElementsNumber of elements to write.

◆ writeInt32()

asynStatus asynPortDriver::writeInt32 ( asynUser *  pasynUser,
epicsInt32  value 
)
virtual

Called when asyn clients call pasynInt32->write().

The base class implementation simply sets the value in the parameter library and calls any registered callbacks for this pasynUser->reason and address. Derived classes will reimplement this function if they need to perform an action when an asynInt32 value is written.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueValue to write.

Reimplemented in testAsynPortDriver.

◆ writeInt32Array()

asynStatus asynPortDriver::writeInt32Array ( asynUser *  pasynUser,
epicsInt32 *  value,
size_t  nElements 
)
virtual

Called when asyn clients call pasynInt32Array->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to write.
[in]nElementsNumber of elements to write.

◆ writeInt64()

asynStatus asynPortDriver::writeInt64 ( asynUser *  pasynUser,
epicsInt64  value 
)
virtual

Called when asyn clients call pasynInt64->write().

The base class implementation simply sets the value in the parameter library and calls any registered callbacks for this pasynUser->reason and address. Derived classes will reimplement this function if they need to perform an action when an asynInt64 value is written.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueValue to write.

◆ writeInt64Array()

asynStatus asynPortDriver::writeInt64Array ( asynUser *  pasynUser,
epicsInt64 *  value,
size_t  nElements 
)
virtual

Called when asyn clients call pasynInt64Array->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to write.
[in]nElementsNumber of elements to write.

◆ writeInt8Array()

asynStatus asynPortDriver::writeInt8Array ( asynUser *  pasynUser,
epicsInt8 *  value,
size_t  nElements 
)
virtual

Called when asyn clients call pasynInt8Array->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valuePointer to the array to write.
[in]nElementsNumber of elements to write.

◆ writeOctet()

asynStatus asynPortDriver::writeOctet ( asynUser *  pasynUser,
const char *  value,
size_t  nChars,
size_t *  nActual 
)
virtual

Called when asyn clients call pasynOctet->write().

The base class implementation simply sets the value in the parameter library and calls any registered callbacks for this pasynUser->reason and address. Derived classes will reimplement this function if they need to perform an action when an asynOctet value is written.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueAddress of the string to write.
[in]nCharsNumber of characters to write.
[out]nActualNumber of characters actually written.

◆ writeOption()

asynStatus asynPortDriver::writeOption ( asynUser *  pasynUser,
const char *  key,
const char *  value 
)
virtual

Called when asyn clients call pasynOption->write().

The base class implementation simply prints an error message. Derived classes may reimplement this function if required.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]keyOption key string.
[in]valueValue string.

◆ writeUInt32Digital()

asynStatus asynPortDriver::writeUInt32Digital ( asynUser *  pasynUser,
epicsUInt32  value,
epicsUInt32  mask 
)
virtual

Called when asyn clients call pasynUInt32Digital->write().

The base class implementation simply sets the value in the parameter library and calls any registered callbacks for this pasynUser->reason and address. Derived classes will reimplement this function if they need to perform an action when an asynInt32 value is written.

Parameters
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueValue to write.
[in]maskMask value to use when writinging the value.

Friends And Related Function Documentation

◆ callbackThread

friend class callbackThread
friend

◆ paramList

friend class paramList
friend

Member Data Documentation

◆ asynStdInterfaces

asynStandardInterfaces& asynPortDriver::asynStdInterfaces
protected

Back-compat alias.

◆ maxAddr

int asynPortDriver::maxAddr

The maximum asyn address (addr) supported by this driver.

◆ paramSet

asynParamSet* asynPortDriver::paramSet
protected

◆ pasynStdInterfaces

asynStandardInterfaces* asynPortDriver::pasynStdInterfaces
protected

The asyn interfaces this driver implements.

◆ pasynUserSelf

asynUser* asynPortDriver::pasynUserSelf
protected

asynUser connected to ourselves for asynTrace

◆ portName

char* asynPortDriver::portName

The name of this asyn port.


The documentation for this class was generated from the following files: