EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Attributes | List of all members
lset Struct Reference

Link Support Entry Table. More...

#include <dbLink.h>

Public Attributes

const unsigned isConstant:1
 link constancy More...
 
const unsigned isVolatile:1
 link volatility More...
 
void(* openLink )(struct link *plink)
 activate link More...
 
void(* removeLink )(struct dbLocker *locker, struct link *plink)
 deactivate link More...
 
long(* loadScalar )(struct link *plink, short dbrType, void *pbuffer)
 load constant scalar from link type More...
 
long(* loadLS )(struct link *plink, char *pbuffer, epicsUInt32 size, epicsUInt32 *plen)
 load constant long string from link type More...
 
long(* loadArray )(struct link *plink, short dbrType, void *pbuffer, long *pnRequest)
 load constant array from link type More...
 
int(* isConnected )(const struct link *plink)
 return link connection status More...
 
int(* getDBFtype )(const struct link *plink)
 get data type of link destination More...
 
long(* getElements )(const struct link *plink, long *pnElements)
 get array size of an input link More...
 
long(* getValue )(struct link *plink, short dbrType, void *pbuffer, long *pnRequest)
 get value from an input link More...
 
long(* getControlLimits )(const struct link *plink, double *lo, double *hi)
 get the control range for an output link More...
 
long(* getGraphicLimits )(const struct link *plink, double *lo, double *hi)
 get the display range from an input link More...
 
long(* getAlarmLimits )(const struct link *plink, double *lolo, double *lo, double *hi, double *hihi)
 get the alarm limits from an input link More...
 
long(* getPrecision )(const struct link *plink, short *precision)
 get the precision from an input link More...
 
long(* getUnits )(const struct link *plink, char *units, int unitsSize)
 get the units string from an input link More...
 
long(* getAlarm )(const struct link *plink, epicsEnum16 *status, epicsEnum16 *severity)
 get the alarm condition from an input link More...
 
long(* getTimeStamp )(const struct link *plink, epicsTimeStamp *pstamp)
 get the time-stamp from an input link More...
 
long(* putValue )(struct link *plink, short dbrType, const void *pbuffer, long nRequest)
 put a value to an output link More...
 
long(* putAsync )(struct link *plink, short dbrType, const void *pbuffer, long nRequest)
 put a value to an output link with asynchronous completion More...
 
void(* scanForward )(struct link *plink)
 trigger processing of a forward link More...
 
long(* doLocked )(struct link *plink, dbLinkUserCallback rtn, void *priv)
 execute a callback routine with link locked More...
 
long(* getAlarmMsg )(const struct link *plink, epicsEnum16 *status, epicsEnum16 *severity, char *msgbuf, size_t msgbuflen)
 Extended version of getAlarm. More...
 
long(* getTimeStampTag )(const struct link *plink, epicsTimeStamp *pstamp, epicsUTag *ptag)
 Extended version of getTimeStamp. More...
 

Detailed Description

This structure provides information about and methods for an individual link type. A pointer to this structure is included in every link's lset field, and is used to perform operations on the link. For JSON links the pointer is obtained by calling pjlink->pif->get_lset() at link initialization time, immediately before calling dbLinkOpen() to activate the link.

Definition at line 59 of file dbLink.h.

Member Data Documentation

const unsigned lset::isConstant

1 means this is a constant link type whose value doesn't change. The link's value will be obtained using one of the methods loadScalar, loadLS or loadArray.

Definition at line 68 of file dbLink.h.

const unsigned lset::isVolatile

0 means the link is always connected.

Definition at line 74 of file dbLink.h.

void(* lset::openLink)(struct link *plink)

Optional, called whenever a JSON link is initialized or added at runtime.

Parameters
plinkthe link

Definition at line 82 of file dbLink.h.

void(* lset::removeLink)(struct dbLocker *locker, struct link *plink)

Optional, called whenever a link address is changed at runtime, or the IOC is shutting down.

Parameters
locker
plinkthe link

Definition at line 92 of file dbLink.h.

long(* lset::loadScalar)(struct link *plink, short dbrType, void *pbuffer)

Usually called during IOC initialization, constant link types must copy a scalar value of the indicated data type to the buffer provided and return 0. A non-constant link type can use this method call as an early hint that subsequent calls to dbGetLink() will request scalar data of the indicated type, although the type might change.

Parameters
plinkthe link
dbrTypedata type code
pbufferwhere to put the value
Returns
0 if a value was loaded, non-zero otherwise

Definition at line 109 of file dbLink.h.

long(* lset::loadLS)(struct link *plink, char *pbuffer, epicsUInt32 size, epicsUInt32 *plen)

Usually called during IOC initialization, constant link types must copy a nil-terminated string up to size characters long to the buffer provided, and write the length of that string to the plen location. A non-constant link type can use this as an early hint that subsequent calls to dbGetLink() will request long string data, although this might change.

Parameters
plinkthe link
pbufferwhere to put the string
sizelength of pbuffer in chars
plenset to number of chars written
Returns
status value

Definition at line 125 of file dbLink.h.

long(* lset::loadArray)(struct link *plink, short dbrType, void *pbuffer, long *pnRequest)

Usually called during IOC initialization, constant link types must copy an array value of the indicated data type to the buffer provided, update the pnRequest location to indicate how many elements were loaded, and return 0. A non-constant link type can use this method call as an early hint that subsequent calls to dbGetLink() will request array data of the indicated type and max size, although the request might change.

Parameters
plinkthe link
dbrTypedata type code
pbufferwhere to put the value
pnRequestMax elements on entry, actual on exit
Returns
0 if elements were loaded, non-zero otherwise

Definition at line 143 of file dbLink.h.

int(* lset::isConnected)(const struct link *plink)

Return an indication whether this link is connected or not. This routine is polled by the calcout and some external record types. Not required for non-volatile link types, which are by definition always connected.

Parameters
plinkthe link
Returns
1 if connected, 0 if disconnected

Definition at line 157 of file dbLink.h.

int(* lset::getDBFtype)(const struct link *plink)

Called on both input and output links by long string support code to decide whether to use DBR_CHAR/DBR_UCHAR or DBR_STRING for a subsequent dbPutLink() or dbGetLink() call. Optional, but if not provided long strings cannot be transported over this link type, and no warning or error will appear to explain why. Not required for constant link types.

Parameters
plinkthe link
Returns
DBF_* type code, or -1 on error/disconnected link

Definition at line 170 of file dbLink.h.

long(* lset::getElements)(const struct link *plink, long *pnElements)

Called on input links by the compress record type for memory allocation purposes, before using the dbGetLink() routine to fetch the actual array data.

Parameters
plinkthe link
pnElementswhere to put the answer
Returns
status value

Definition at line 184 of file dbLink.h.

long(* lset::getValue)(struct link *plink, short dbrType, void *pbuffer, long *pnRequest)

Called to fetch data from the link, which must be converted into the given data type and placed in the buffer indicated. The actual number of elements retrieved should be updated in the pnRequest location. If this method returns an error status value, the link's record will be placed into an Invalid severity / Link Alarm state by the dbGetLink() routine that calls this method.

Parameters
plinkthe link
dbrTypedata type code
pbufferwhere to put the value
pnRequestmax elements on entry, actual on exit
Returns
status value

Definition at line 201 of file dbLink.h.

long(* lset::getControlLimits)(const struct link *plink, double *lo, double *hi)

Called to fetch the control range for the link target, as a pair of double values for the lowest and highest values that the target will accept. This method is not used at all by the IOC or built-in record types, although external record types may require it.

Parameters
plinkthe link
lolowest accepted value
hihighest accepted value
Returns
status value

Definition at line 216 of file dbLink.h.

long(* lset::getGraphicLimits)(const struct link *plink, double *lo, double *hi)

Called to fetch the display range for an input link target, as a pair of double values for the lowest and highest values that the PV expects to return. This method is used by several built-in record types to obtain the display range for their generic input links.

Parameters
plinkthe link
lolowest accepted value
hihighest accepted value
Returns
status value

Definition at line 230 of file dbLink.h.

long(* lset::getAlarmLimits)(const struct link *plink, double *lolo, double *lo, double *hi, double *hihi)

Called to fetch the alarm limits for an input link target, as four double values for the warning and alarm levels that the PV checks its value against. This method is used by several built-in record types to obtain the alarm limits for their generic input links.

Parameters
plinkthe link
lololow alarm value
lolow warning value
hihigh warning value
hihihigh alarm value
Returns
status value

Definition at line 246 of file dbLink.h.

long(* lset::getPrecision)(const struct link *plink, short *precision)

Called to fetch the precision for an input link target. This method is used by several built-in record types to obtain the precision for their generic input links.

Parameters
plinkthe link
precisionwhere to put the answer
Returns
status value

Definition at line 259 of file dbLink.h.

long(* lset::getUnits)(const struct link *plink, char *units, int unitsSize)

Called to fetch the units string for an input link target. This method is used by several built-in record types to obtain the units string for their generic input links.

Parameters
plinkthe link
unitswhere to put the answer
unitsSizebuffer size for the answer
Returns
status value

Definition at line 272 of file dbLink.h.

long(* lset::getAlarm)(const struct link *plink, epicsEnum16 *status, epicsEnum16 *severity)

Called to fetch the alarm status and severity for an input link target. Either status or severity pointers may be NULL when that value is not needed by the calling code. This method is used by several built-in record types to obtain the alarm condition for their generic input links.

Parameters
plinkthe link
statuswhere to put the alarm status (or NULL)
severitywhere to put the severity (or NULL)
Returns
status value

Definition at line 286 of file dbLink.h.

long(* lset::getTimeStamp)(const struct link *plink, epicsTimeStamp *pstamp)

Called to fetch the time-stamp for an input link target. This method is used by many built-in device supports to obtain the precision for their generic input links.

Parameters
plinkthe link
pstampwhere to put the answer
Returns
status value

Definition at line 299 of file dbLink.h.

long(* lset::putValue)(struct link *plink, short dbrType, const void *pbuffer, long nRequest)

Called to send nRequest elements of type dbrType found at pbuffer to an output link target.

Parameters
plinkthe link
dbrTypedata type code
pbufferwhere to put the value
nRequestnumber of elements to send
Returns
status value

Definition at line 314 of file dbLink.h.

long(* lset::putAsync)(struct link *plink, short dbrType, const void *pbuffer, long nRequest)

Called to send nRequest elements of type dbrType found at pbuffer to an output link target. If the return status is zero, the link type will later indicate the put has completed by calling dbLinkAsyncComplete() from a background thread, which will be used to continue the record process operation from where it left off.

Parameters
plinkthe link
dbrTypedata type code
pbufferwhere to put the value
nRequestnumber of elements to send
Returns
status value

Definition at line 331 of file dbLink.h.

void(* lset::scanForward)(struct link *plink)

Called to trigger processing of the record pointed to by a forward link. This routine is optional, but if not provided no warning message will be shown when called by dbScanFwdLink(). JSON link types that do not support this operation should return NULL from their jlif::alloc_jlink() method if it gets called with a dbfType of DBF_FWDLINK.

Parameters
plinkthe link

Definition at line 346 of file dbLink.h.

long(* lset::doLocked)(struct link *plink, dbLinkUserCallback rtn, void *priv)

Called on an input link when multiple link attributes need to be fetched in an atomic fashion. The link type must call the callback routine and prevent any background I/O from updating any cached link data until that routine returns. This method is used by most input device support to fetch the timestamp along with the value when the record's TSE field is set to epicsTimeEventDeviceTime.

Parameters
plinkthe link
rtnroutine to execute
Returns
status value

Definition at line 363 of file dbLink.h.

long(* lset::getAlarmMsg)(const struct link *plink, epicsEnum16 *status, epicsEnum16 *severity, char *msgbuf, size_t msgbuflen)

Equivalent of getAlarm() and also copy out alarm message string. The msgbuf argument may be NULL and/or msgbuflen==0, in which case the effect must be the same as a call to getAlarm().

Implementations must write a trailing nil to msgbuf whenever

msgbuf!=NULL && msgbuflen>0

.

Since
7.0.6

Definition at line 376 of file dbLink.h.

long(* lset::getTimeStampTag)(const struct link *plink, epicsTimeStamp *pstamp, epicsUTag *ptag)

Equivalent of getTimeStamp() and also copy out time tag. ptag may be NULL.

Since
Added after 7.0.6

Definition at line 386 of file dbLink.h.


The documentation for this struct was generated from the following file: