EPICS Base  7.0.5.1
dbLink.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2010 The UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 /* dbLink.h
11  *
12  * Created on: Mar 21, 2010
13  * Author: Andrew Johnson
14  */
15 
16 #ifndef INC_dbLink_H
17 #define INC_dbLink_H
18 
19 #include "link.h"
20 #include "shareLib.h"
21 #include "epicsTypes.h"
22 #include "epicsTime.h"
23 #include "dbAddr.h"
24 #include "dbChannel.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct dbLocker;
31 
49 typedef long (*dbLinkUserCallback)(struct link *plink, void *priv);
50 
59 typedef struct lset {
60  /* Characteristics of the link type */
61 
68  const unsigned isConstant:1;
69 
74  const unsigned isVolatile:1;
75 
82  void (*openLink)(struct link *plink);
83 
92  void (*removeLink)(struct dbLocker *locker, struct link *plink);
93 
94  /* Constant link initialization and data type hinting */
95 
109  long (*loadScalar)(struct link *plink, short dbrType, void *pbuffer);
110 
125  long (*loadLS)(struct link *plink, char *pbuffer, epicsUInt32 size,
126  epicsUInt32 *plen);
127 
143  long (*loadArray)(struct link *plink, short dbrType, void *pbuffer,
144  long *pnRequest);
145 
146  /* Metadata */
147 
157  int (*isConnected)(const struct link *plink);
158 
170  int (*getDBFtype)(const struct link *plink);
171 
172  /* Get data */
173 
184  long (*getElements)(const struct link *plink, long *pnElements);
185 
201  long (*getValue)(struct link *plink, short dbrType, void *pbuffer,
202  long *pnRequest);
203 
216  long (*getControlLimits)(const struct link *plink, double *lo, double *hi);
217 
230  long (*getGraphicLimits)(const struct link *plink, double *lo, double *hi);
231 
246  long (*getAlarmLimits)(const struct link *plink, double *lolo, double *lo,
247  double *hi, double *hihi);
248 
259  long (*getPrecision)(const struct link *plink, short *precision);
260 
272  long (*getUnits)(const struct link *plink, char *units, int unitsSize);
273 
286  long (*getAlarm)(const struct link *plink, epicsEnum16 *status,
287  epicsEnum16 *severity);
288 
299  long (*getTimeStamp)(const struct link *plink, epicsTimeStamp *pstamp);
300 
301  /* Put data */
302 
314  long (*putValue)(struct link *plink, short dbrType,
315  const void *pbuffer, long nRequest);
316 
331  long (*putAsync)(struct link *plink, short dbrType,
332  const void *pbuffer, long nRequest);
333 
334  /* Process */
335 
346  void (*scanForward)(struct link *plink);
347 
348  /* Atomicity */
349 
363  long (*doLocked)(struct link *plink, dbLinkUserCallback rtn, void *priv);
364 } lset;
365 
366 #define dbGetSevr(link, sevr) \
367  dbGetAlarm(link, NULL, sevr)
368 
369 epicsShareFunc const char * dbLinkFieldName(const struct link *plink);
370 
371 epicsShareFunc void dbInitLink(struct link *plink, short dbfType);
372 epicsShareFunc void dbAddLink(struct dbLocker *locker, struct link *plink,
373  short dbfType, dbChannel *ptarget);
374 
375 epicsShareFunc void dbLinkOpen(struct link *plink);
376 epicsShareFunc void dbRemoveLink(struct dbLocker *locker, struct link *plink);
377 
378 epicsShareFunc int dbLinkIsDefined(const struct link *plink); /* 0 or 1 */
379 epicsShareFunc int dbLinkIsConstant(const struct link *plink); /* 0 or 1 */
380 epicsShareFunc int dbLinkIsVolatile(const struct link *plink); /* 0 or 1 */
381 
382 epicsShareFunc long dbLoadLink(struct link *plink, short dbrType,
383  void *pbuffer);
384 epicsShareFunc long dbLoadLinkArray(struct link *, short dbrType, void *pbuffer,
385  long *pnRequest);
386 
387 epicsShareFunc long dbGetNelements(const struct link *plink, long *pnElements);
388 epicsShareFunc int dbIsLinkConnected(const struct link *plink); /* 0 or 1 */
389 epicsShareFunc int dbGetLinkDBFtype(const struct link *plink);
390 epicsShareFunc long dbTryGetLink(struct link *, short dbrType, void *pbuffer,
391  long *nRequest);
392 epicsShareFunc long dbGetLink(struct link *, short dbrType, void *pbuffer,
393  long *options, long *nRequest);
394 epicsShareFunc long dbGetControlLimits(const struct link *plink, double *low,
395  double *high);
396 epicsShareFunc long dbGetGraphicLimits(const struct link *plink, double *low,
397  double *high);
398 epicsShareFunc long dbGetAlarmLimits(const struct link *plink, double *lolo,
399  double *low, double *high, double *hihi);
400 epicsShareFunc long dbGetPrecision(const struct link *plink, short *precision);
401 epicsShareFunc long dbGetUnits(const struct link *plink, char *units,
402  int unitsSize);
403 epicsShareFunc long dbGetAlarm(const struct link *plink, epicsEnum16 *status,
404  epicsEnum16 *severity);
405 epicsShareFunc long dbGetTimeStamp(const struct link *plink,
406  epicsTimeStamp *pstamp);
407 epicsShareFunc long dbPutLink(struct link *plink, short dbrType,
408  const void *pbuffer, long nRequest);
409 epicsShareFunc void dbLinkAsyncComplete(struct link *plink);
410 epicsShareFunc long dbPutLinkAsync(struct link *plink, short dbrType,
411  const void *pbuffer, long nRequest);
412 epicsShareFunc void dbScanFwdLink(struct link *plink);
413 
414 epicsShareFunc long dbLinkDoLocked(struct link *plink, dbLinkUserCallback rtn,
415  void *priv);
416 
417 epicsShareFunc long dbLoadLinkLS(struct link *plink, char *pbuffer,
418  epicsUInt32 size, epicsUInt32 *plen);
419 epicsShareFunc long dbGetLinkLS(struct link *plink, char *pbuffer,
420  epicsUInt32 buffer_size, epicsUInt32 *plen);
421 epicsShareFunc long dbPutLinkLS(struct link *plink, char *pbuffer,
422  epicsUInt32 len);
423 
424 #ifdef __cplusplus
425 }
426 #endif
427 
428 #endif /* INC_dbLink_H */
long(* getUnits)(const struct link *plink, char *units, int unitsSize)
get the units string from an input link
Definition: dbLink.h:272
long(* getTimeStamp)(const struct link *plink, epicsTimeStamp *pstamp)
get the time-stamp from an input link
Definition: dbLink.h:299
long(* loadLS)(struct link *plink, char *pbuffer, epicsUInt32 size, epicsUInt32 *plen)
load constant long string from link type
Definition: dbLink.h:125
long(* putValue)(struct link *plink, short dbrType, const void *pbuffer, long nRequest)
put a value to an output link
Definition: dbLink.h:314
The core data types used by epics.
const unsigned isVolatile
link volatility
Definition: dbLink.h:74
long(* getPrecision)(const struct link *plink, short *precision)
get the precision from an input link
Definition: dbLink.h:259
long(* getAlarmLimits)(const struct link *plink, double *lolo, double *lo, double *hi, double *hihi)
get the alarm limits from an input link
Definition: dbLink.h:246
long(* getAlarm)(const struct link *plink, epicsEnum16 *status, epicsEnum16 *severity)
get the alarm condition from an input link
Definition: dbLink.h:286
void(* scanForward)(struct link *plink)
trigger processing of a forward link
Definition: dbLink.h:346
EPICS time stamp, for use from C code.
Definition: epicsTime.h:34
long(* loadScalar)(struct link *plink, short dbrType, void *pbuffer)
load constant scalar from link type
Definition: dbLink.h:109
long(* loadArray)(struct link *plink, short dbrType, void *pbuffer, long *pnRequest)
load constant array from link type
Definition: dbLink.h:143
long(* getElements)(const struct link *plink, long *pnElements)
get array size of an input link
Definition: dbLink.h:184
long(* getControlLimits)(const struct link *plink, double *lo, double *hi)
get the control range for an output link
Definition: dbLink.h:216
long(* getValue)(struct link *plink, short dbrType, void *pbuffer, long *pnRequest)
get value from an input link
Definition: dbLink.h:201
long(* getGraphicLimits)(const struct link *plink, double *lo, double *hi)
get the display range from an input link
Definition: dbLink.h:230
void(* removeLink)(struct dbLocker *locker, struct link *plink)
deactivate link
Definition: dbLink.h:92
long(* putAsync)(struct link *plink, short dbrType, const void *pbuffer, long nRequest)
put a value to an output link with asynchronous completion
Definition: dbLink.h:331
Mark external symbols and entry points for shared libraries.
Link Support Entry Table.
Definition: dbLink.h:59
EPICS time-stamps (epicsTimeStamp), epicsTime C++ class and C functions for handling wall-clock times...
long(* doLocked)(struct link *plink, dbLinkUserCallback rtn, void *priv)
execute a callback routine with link locked
Definition: dbLink.h:363
int(* getDBFtype)(const struct link *plink)
get data type of link destination
Definition: dbLink.h:170
const unsigned isConstant
link constancy
Definition: dbLink.h:68
void(* openLink)(struct link *plink)
activate link
Definition: dbLink.h:82
int(* isConnected)(const struct link *plink)
return link connection status
Definition: dbLink.h:157