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

List of all members.

Public Member Functions

 asynPortDriver (const char *portName, int maxAddr, int paramTableSize, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize)
 Constructor for the asynPortDriver class.
virtual ~asynPortDriver ()
 Destructor for asynPortDriver class; frees resources allocated when port driver is created.
virtual asynStatus lock ()
 Locks the driver to prevent multiple threads from accessing memory at the same time.
virtual asynStatus unlock ()
 Unocks the driver; called when an asyn client or driver is done accessing common memory.
virtual asynStatus getAddress (asynUser *pasynUser, const char *functionName, int *address)
 Returns the asyn address associated with a pasynUser structure.
virtual asynStatus readInt32 (asynUser *pasynUser, epicsInt32 *value)
 Called when asyn clients call pasynInt32->read().
virtual asynStatus writeInt32 (asynUser *pasynUser, epicsInt32 value)
 Called when asyn clients call pasynInt32->write().
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.
virtual asynStatus readFloat64 (asynUser *pasynUser, epicsFloat64 *value)
 Called when asyn clients call pasynFloat64->read().
virtual asynStatus writeFloat64 (asynUser *pasynUser, epicsFloat64 value)
 Called when asyn clients call pasynFloat64->write().
virtual asynStatus readOctet (asynUser *pasynUser, char *value, size_t maxChars, size_t *nActual, int *eomReason)
 Called when asyn clients call pasynOctet->read().
virtual asynStatus writeOctet (asynUser *pasynUser, const char *value, size_t maxChars, size_t *nActual)
 Called when asyn clients call pasynOctet->write().
virtual asynStatus readInt8Array (asynUser *pasynUser, epicsInt8 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt8Array->read().
virtual asynStatus writeInt8Array (asynUser *pasynUser, epicsInt8 *value, size_t nElements)
 Called when asyn clients call pasynInt8Array->write().
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.
virtual asynStatus readInt16Array (asynUser *pasynUser, epicsInt16 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt16Array->read().
virtual asynStatus writeInt16Array (asynUser *pasynUser, epicsInt16 *value, size_t nElements)
 Called when asyn clients call pasynInt16Array->write().
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.
virtual asynStatus readInt32Array (asynUser *pasynUser, epicsInt32 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt32Array->read().
virtual asynStatus writeInt32Array (asynUser *pasynUser, epicsInt32 *value, size_t nElements)
 Called when asyn clients call pasynInt32Array->write().
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.
virtual asynStatus readFloat32Array (asynUser *pasynUser, epicsFloat32 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynFloat32Array->read().
virtual asynStatus writeFloat32Array (asynUser *pasynUser, epicsFloat32 *value, size_t nElements)
 Called when asyn clients call pasynFloat32Array->write().
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.
virtual asynStatus readFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynFloat64Array->read().
virtual asynStatus writeFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements)
 Called when asyn clients call pasynFloat64Array->write().
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.
virtual asynStatus readGenericPointer (asynUser *pasynUser, void *pointer)
 Called when asyn clients call pasynGenericPointer->read().
virtual asynStatus writeGenericPointer (asynUser *pasynUser, void *pointer)
 Called when asyn clients call pasynGenericPointer->write().
virtual asynStatus doCallbacksGenericPointer (void *pointer, int reason, int addr)
 Called by driver to do the callbacks to registered clients on the asynGenericPointer interface.
virtual asynStatus findParam (asynParamString_t *paramTable, int numParams, const char *paramName, int *param)
 Convenience function to search through an array of asynParamString_t structures looking for a case-insensitive match with an input string, which is normally a drvInfo string that was passed to asynPortDriver::drvUserCreate.
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; driver typically then assigns pasynUser->reason based on the value of the drvInfo string.
virtual asynStatus drvUserCreateParam (asynUser *pasynUser, const char *drvInfo, const char **pptypeName, size_t *psize, asynParamString_t *paramTable, int numParams)
 Convenience function typically called by derived classes from their drvUserCreate method; assigns pasynUser->reason based on the value of the drvInfo string.
virtual asynStatus drvUserGetType (asynUser *pasynUser, const char **pptypeName, size_t *psize)
 Returns strings associated with driver-specific commands.
virtual asynStatus drvUserDestroy (asynUser *pasynUser)
 Frees any resources allocated by drvUserCreate.
virtual void report (FILE *fp, int details)
 Reports on status of the driver.
virtual asynStatus connect (asynUser *pasynUser)
 Connects driver to device; the base class implementation simply calls pasynManager->exceptionConnect.
virtual asynStatus disconnect (asynUser *pasynUser)
 Disconnects driver from device; the base class implementation simply calls pasynManager->exceptionDisconnect.
virtual asynStatus setIntegerParam (int index, int value)
 Sets the value for an integer in the parameter library.
virtual asynStatus setIntegerParam (int list, int index, int value)
 Sets the value for an integer in the parameter library.
virtual asynStatus setDoubleParam (int index, double value)
 Sets the value for a double in the parameter library.
virtual asynStatus setDoubleParam (int list, int index, double value)
 Sets the value for a double in the parameter library.
virtual asynStatus setStringParam (int index, const char *value)
 Sets the value for a string in the parameter library.
virtual asynStatus setStringParam (int list, int index, const char *value)
 Sets the value for a string in the parameter library.
virtual asynStatus getIntegerParam (int index, int *value)
 Returns the value for an integer from the parameter library.
virtual asynStatus getIntegerParam (int list, int index, int *value)
 Returns the value for an integer from the parameter library.
virtual asynStatus getDoubleParam (int index, double *value)
 Returns the value for a double from the parameter library.
virtual asynStatus getDoubleParam (int list, int index, double *value)
 Returns the value for a double from the parameter library.
virtual asynStatus getStringParam (int index, int maxChars, char *value)
 Returns the value for a string from the parameter library.
virtual asynStatus getStringParam (int list, int index, int maxChars, char *value)
 Returns the value for a string from the parameter library.
virtual asynStatus callParamCallbacks ()
 Calls paramList::callCallbacks() with no list and asyn address arguments, which uses 0 for both.
virtual asynStatus callParamCallbacks (int list, int addr)
 Calls paramList::callCallbacks (list, addr) for a specific parameter list and asyn address.
virtual void reportParams ()
 Calls paramList::report for each asyn address that the driver supports.
void callbackTask ()
 TEMPORARY FIX: waits for interruptAccept and then does all the parameter library callbacks once.

Public Attributes

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

Protected Attributes

asynUser * pasynUserSelf
 asynUser connected to ourselves for asynTrace
asynStandardInterfaces asynStdInterfaces
 The asyn interfaces this driver implements.


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.


Constructor & Destructor Documentation

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

Constructor for the asynPortDriver class.

Parameters:
[in] portName The name of the asyn port driver to be created.
[in] maxAddr The 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] paramTableSize The number of parameters that this driver supports. This controls the size of the parameter tables.
[in] interfaceMask Bit mask defining the asyn interfaces that this driver supports. The bit mask values are defined in asynPortDriver.h, e.g. asynInt32Mask.
[in] interruptMask Bit mask definining the asyn interfaces that can generate interrupts (callbacks). The bit mask values are defined in asynPortDriver.h, e.g. asynInt8ArrayMask.
[in] asynFlags Flags when creating the asyn port driver; includes ASYN_CANBLOCK and ASYN_MULTIDEVICE.
[in] autoConnect The autoConnect flag for the asyn port driver. 1 if the driver should autoconnect.
[in] priority The 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] stackSize The 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::~asynPortDriver (  )  [virtual]

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


Member Function Documentation

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 access by clients.

asynStatus asynPortDriver::unlock (  )  [virtual]

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

asynStatus asynPortDriver::getAddress ( asynUser *  pasynUser,
const char *  functionName,
int *  address 
) [virtual]

Returns the asyn address associated with a pasynUser structure.

Derived classes rarely need to reimplement this function.

Parameters:
[in] pasynUser pasynUser structure that encodes the reason and address.
[in] functionName Function name of called, used for printing error message if address not found.
[out] address Returned address.
Returns:
Returns asynError if the address is > maxAddr value passed to asynPortDriver::asynPortDriver.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Address of the value to read.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Value to write.

Reimplemented in testAsynPortDriver.

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] pasynUser pasynUser structure that encodes the reason and address.
[out] low Address of the low limit.
[out] high Address of the high limit.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Address of the value to read.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Value to write.

Reimplemented in testAsynPortDriver.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Address of the string to read.
[in] maxChars Maximum number of characters to read.
[out] nActual Number of characters actually read. Base class sets this to strlen(value).
[out] eomReason Reason that read terminated. Base class sets this to ASYN_EOM_END.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Address of the string to write.
[in] nChars Number of characters to write.
[out] nActual Number of characters actually written.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to write.
[in] nElements Number of elements to write.

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] value Address of the array.
[in] nElements Number of elements in the array.
[in] reason A client will be called if reason matches pasynUser->reason registered for that client.
[in] addr A client will be called if addr matches the asyn address registered for that client.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to write.
[in] nElements Number of elements to write.

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] value Address of the array.
[in] nElements Number of elements in the array.
[in] reason A client will be called if reason matches pasynUser->reason registered for that client.
[in] addr A client will be called if addr matches the asyn address registered for that client.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to write.
[in] nElements Number of elements to write.

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] value Address of the array.
[in] nElements Number of elements in the array.
[in] reason A client will be called if reason matches pasynUser->reason registered for that client.
[in] addr A client will be called if addr matches the asyn address registered for that client.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to write.
[in] nElements Number of elements to write.

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] value Address of the array.
[in] nElements Number of elements in the array.
[in] reason A client will be called if reason matches pasynUser->reason registered for that client.
[in] addr A client will be called if addr matches the asyn address registered for that client.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

Reimplemented in testAsynPortDriver.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to write.
[in] nElements Number of elements to write.

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] value Address of the array.
[in] nElements Number of elements in the array.
[in] reason A client will be called if reason matches pasynUser->reason registered for that client.
[in] addr A client will be called if addr matches the asyn address registered for that client.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] genericPointer Pointer to the object to read.

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] pasynUser pasynUser structure that encodes the reason and address.
[in] genericPointer Pointer to the object to write.

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] genericPointer Pointer to the object
[in] reason A client will be called if reason matches pasynUser->reason registered for that client.
[in] address A client will be called if address matches the address registered for that client.

asynStatus asynPortDriver::findParam ( asynParamString_t paramTable,
int  numParams,
const char *  paramName,
int *  param 
) [virtual]

Convenience function to search through an array of asynParamString_t structures looking for a case-insensitive match with an input string, which is normally a drvInfo string that was passed to asynPortDriver::drvUserCreate.

Parameters:
[in] paramTable Pointer to an array of asynParamString_t structures defining the enum values (pasynUser->reason) and command strings (drvInfo) that this driver supports.
[in] numParams Number of elements in paramTable array.
[in] paramName The string (drvInfo) to be search for.
[out] param Location index of the matching parameter will be written
Returns:
Returns asynSuccess if a matching string was found, asynError if not found.

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; driver typically then assigns pasynUser->reason based on the value of the drvInfo string.

This base class implementation does nothing. Derived classes normally must reimplement this function to associate the pasynUser with the drvInfo.

Parameters:
[in] pasynUser pasynUser structure that driver will modify
[in] drvInfo String containing information about what driver function is being referenced
[out] pptypeName Location in which driver can write information.
[out] psize Location where driver can write information about size of pptypeName

Reimplemented in testAsynPortDriver.

asynStatus asynPortDriver::drvUserCreateParam ( asynUser *  pasynUser,
const char *  drvInfo,
const char **  pptypeName,
size_t *  psize,
asynParamString_t paramTable,
int  numParams 
) [virtual]

Convenience function typically called by derived classes from their drvUserCreate method; assigns pasynUser->reason based on the value of the drvInfo string.

Parameters:
[out] pasynUser pasynUser structure in which this function modifies reason field
[in] drvInfo String containing information about what driver function is being referenced
[out] pptypeName Location in which driver can write information.
[out] psize Location where driver can write information about size of pptypeName
[in] paramTable Pointer to an array of asynParamString_t structures defining the enum values (pasynUser->reason) and command strings (drvInfo) that this driver supports.
[in] numParams Number of elements in paramTable array.
Returns:
Returns asynSuccess if a matching string was found, asynError if not found.

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] pasynUser pasynUser structure that driver will modify
[out] pptypeName Location in which driver can write information.
[out] psize Location where driver can write information about size of pptypeName

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.

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

Reports on status of the driver.

Parameters:
[in] fp The file pointer on which report information will be written
[in] details The level of report detail desired
If details > 1 then information is printed about all of the interrupt callbacks registered. If details > 5 then information is printed about the contents of the parameter library. Derived classes typically reimplement this function to print driver-specific details and then call this base class function.

asynStatus asynPortDriver::connect ( asynUser *  pasynUser  )  [virtual]

Connects driver to device; the base class implementation simply calls pasynManager->exceptionConnect.

Derived classes can reimplement this function for real connection management.

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

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] pasynUser The pasynUser structure which contains information about the port and address

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

Sets the value for an integer in the parameter library.

Calls paramList::setInteger (index, value) for parameter list 0.

Parameters:
[in] index The parameter number
[in] value Value to set.

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 parameter list 0.

Parameters:
[in] list The parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in] index The parameter number
[in] value Value to set.

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

Sets the value for a double in the parameter library.

Calls paramList::setDouble (index, value) for parameter list 0.

Parameters:
[in] index The parameter number
[in] value Value to set.

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 parameter list 0.

Parameters:
[in] list The parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in] index The parameter number
[in] value Value to set.

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

Sets the value for a string in the parameter library.

Calls paramList::setString (index, value) for parameter list 0.

Parameters:
[in] index The parameter number
[in] value Address of value to set.

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 parameter list 0.

Parameters:
[in] list The parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in] index The parameter number
[in] value Address of value to set.

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

Returns the value for an integer from the parameter library.

Calls paramList::getInteger (index, value) for parameter list 0.

Parameters:
[in] index The parameter number
[out] value Address of value to get.

asynStatus asynPortDriver::getIntegerParam ( int  list,
int  index,
int *  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] list The parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in] index The parameter number
[out] value Address of value to get.

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

Returns the value for a double from the parameter library.

Calls paramList::getDouble (index, value) for parameter list 0.

Parameters:
[in] index The parameter number
[out] value Address of value to get.

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] list The parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in] index The parameter number
[out] value Address of value to get.

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

Returns the value for a string from the parameter library.

Calls paramList::getString (index, maxChars, value) for parameter list 0.

Parameters:
[in] index The parameter number
[in] maxChars Maximum number of characters to return.
[out] value Address of value to get.

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] list The parameter list number. Must be < maxAddr passed to asynPortDriver::asynPortDriver.
[in] index The parameter number
[in] maxChars Maximum number of characters to return.
[out] value Address of value to get.

asynStatus asynPortDriver::callParamCallbacks (  )  [virtual]

Calls paramList::callCallbacks() with no list and asyn address arguments, which uses 0 for both.

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

Calls paramList::callCallbacks (list, addr) for a specific parameter list and asyn address.

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

void asynPortDriver::reportParams (  )  [virtual]

Calls paramList::report for each asyn address that the driver supports.

void asynPortDriver::callbackTask (  ) 

TEMPORARY FIX: waits for interruptAccept and then does all the parameter library callbacks once.

THIS SHOULD BE A TEMPORARY FIX until EPICS supports PINI after interruptAccept


Member Data Documentation

The name of this asyn port.

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

asynUser* asynPortDriver::pasynUserSelf [protected]

asynUser connected to ourselves for asynTrace

asynStandardInterfaces asynPortDriver::asynStdInterfaces [protected]

The asyn interfaces this driver implements.


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

Generated on Wed Aug 19 15:50:33 2009 for asyn by  doxygen 1.5.6