This is Unofficial EPICS BASE Doxygen Site
devLsoSoftCallback.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  * Author: Andrew Johnson
9  * Date: 30 Nov 2012
10  */
11 
12 #include "alarm.h"
13 #include "dbAccess.h"
14 #include "recGbl.h"
15 #include "lsoRecord.h"
16 #include "epicsExport.h"
17 
18 static long write_string(lsoRecord *prec)
19 {
20  struct link *plink = &prec->out;
21  int dtyp = dbGetLinkDBFtype(plink);
22  long len = prec->len;
23  long status;
24 
25  if (prec->pact || dtyp < 0)
26  return 0;
27 
28  if (dtyp != DBR_CHAR && dtyp != DBF_UCHAR) {
29  dtyp = DBR_STRING;
30  len = 1;
31  }
32 
33  status = dbPutLinkAsync(plink, dtyp, prec->val, len);
34  if (!status)
35  prec->pact = TRUE;
36  else if (status == S_db_noLSET)
37  status = dbPutLink(plink, dtyp, prec->val, len);
38 
39  return status;
40 }
41 
42 lsodset devLsoSoftCallback = {
43  { 5, NULL, NULL, NULL, NULL }, write_string
44 };
45 epicsExportAddress(dset, devLsoSoftCallback);
46 
#define DBR_CHAR
Definition: db_access.h:74
#define DBR_STRING
Definition: db_access.h:69
pvd::Status status
lsodset devLsoSoftCallback
#define NULL
Definition: catime.c:38
Definition: devSup.h:140
epicsExportAddress(dset, devLsoSoftCallback)
#define TRUE
Definition: dbDefs.h:27
int prec
Definition: reader.c:29
Exporting IOC objects.