This is Unofficial EPICS BASE Doxygen Site
devLsiSoft.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * EPICS BASE is distributed subject to a Software License Agreement found
5 * in file LICENSE that is included with this distribution.
6 \*************************************************************************/
7 
8 /* Long String Input soft device support
9  *
10  * Author: Andrew Johnson
11  * Date: 2012-11-28
12  */
13 
14 #include "dbAccess.h"
15 #include "epicsTime.h"
16 #include "link.h"
17 #include "lsiRecord.h"
18 #include "epicsExport.h"
19 
20 static long init_record(dbCommon *common)
21 {
22  lsiRecord *prec = (lsiRecord *)common;
23  dbLoadLinkLS(&prec->inp, prec->val, prec->sizv, &prec->len);
24 
25  return 0;
26 }
27 
28 static long readLocked(struct link *pinp, void *dummy)
29 {
30  lsiRecord *prec = (lsiRecord *) pinp->precord;
31  long status = dbGetLinkLS(pinp, prec->val, prec->sizv, &prec->len);
32 
33  if (status) return status;
34 
35  if (dbLinkIsConstant(&prec->tsel) &&
36  prec->tse == epicsTimeEventDeviceTime)
37  dbGetTimeStamp(pinp, &prec->time);
38 
39  return status;
40 }
41 
42 static long read_string(lsiRecord *prec)
43 {
44  long status = dbLinkDoLocked(&prec->inp, readLocked, NULL);
45 
46  if (status == S_db_noLSET)
47  status = readLocked(&prec->inp, NULL);
48 
49  return status;
50 }
51 
52 lsidset devLsiSoft = {
53  { 5, NULL, NULL, init_record, NULL }, read_string
54 };
55 epicsExportAddress(dset, devLsiSoft);
pvd::Status status
#define init_record
#define NULL
Definition: catime.c:38
Definition: devSup.h:140
#define epicsTimeEventDeviceTime
Definition: epicsTime.h:362
epics::pvData::PVStructurePtr dummy
Definition: pvAccess.cpp:72
epicsExportAddress(dset, devLsiSoft)
lsidset devLsiSoft
Definition: devLsiSoft.c:52
EPICS time-stamps (epicsTimeStamp), epicsTime C++ class and C functions for handling wall-clock times...
int prec
Definition: reader.c:29
Exporting IOC objects.