Merge branch '7.0' of https://git.launchpad.net/epics-base into PSI-7.0
This commit is contained in:
@@ -736,6 +736,8 @@ long dbValueSize(short dbr_type)
|
||||
sizeof(epicsFloat64), /* DOUBLE */
|
||||
sizeof(epicsEnum16)}; /* ENUM */
|
||||
|
||||
if(dbr_type>=NELEMENTS(size))
|
||||
return 0;
|
||||
return(size[dbr_type]);
|
||||
}
|
||||
|
||||
@@ -796,15 +798,12 @@ int dbLoadRecords(const char* file, const char* subs)
|
||||
static long getLinkValue(DBADDR *paddr, short dbrType,
|
||||
char *pbuf, long *nRequest)
|
||||
{
|
||||
dbCommon *precord = paddr->precord;
|
||||
dbFldDes *pfldDes = paddr->pfldDes;
|
||||
/* size of pbuf storage in bytes, including space for trailing nil */
|
||||
int maxlen;
|
||||
DBENTRY dbEntry;
|
||||
long status;
|
||||
long nReq = nRequest ? *nRequest : 1;
|
||||
|
||||
/* dbFindRecord() below will always succeed as we have a
|
||||
/* below will always succeed as we have a
|
||||
* valid DBADDR, so no point to check again.
|
||||
* Request for zero elements always succeeds
|
||||
*/
|
||||
@@ -830,10 +829,8 @@ static long getLinkValue(DBADDR *paddr, short dbrType,
|
||||
return S_db_badDbrtype;
|
||||
}
|
||||
|
||||
dbInitEntry(pdbbase, &dbEntry);
|
||||
status = dbFindRecord(&dbEntry, precord->name);
|
||||
if (!status) status = dbFindField(&dbEntry, pfldDes->name);
|
||||
if (!status) {
|
||||
dbInitEntryFromAddr(paddr, &dbEntry);
|
||||
{
|
||||
const char *rtnString = dbGetString(&dbEntry);
|
||||
|
||||
strncpy(pbuf, rtnString, maxlen-1);
|
||||
@@ -843,7 +840,7 @@ static long getLinkValue(DBADDR *paddr, short dbrType,
|
||||
if(nRequest) *nRequest = nReq;
|
||||
}
|
||||
dbFinishEntry(&dbEntry);
|
||||
return status;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long getAttrValue(DBADDR *paddr, short dbrType,
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
#include "recGbl.h"
|
||||
#include "recSup.h"
|
||||
|
||||
/* from dbAccessDefs.h which can't be included here */
|
||||
#define S_db_badDbrtype (M_dbAccess| 3)
|
||||
|
||||
/* defined in dbContext.cpp
|
||||
* Setup local CA access
|
||||
*/
|
||||
@@ -457,6 +460,9 @@ long dbCaPutLinkCallback(struct link *plink,short dbrType,
|
||||
long status = 0;
|
||||
short link_action = 0;
|
||||
|
||||
if(INVALID_DB_REQ(dbrType))
|
||||
return S_db_badDbrtype;
|
||||
|
||||
assert(pca);
|
||||
/* put the new value in */
|
||||
epicsMutexMustLock(pca->lock);
|
||||
|
||||
@@ -382,7 +382,7 @@ The B<DPVT> field is is for private use of the device support modules.
|
||||
prompt("DSET address")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("unambiguous_dset *dset")
|
||||
extra("unambiguous_dset *dset")
|
||||
}
|
||||
field(DPVT,DBF_NOACCESS) {
|
||||
prompt("Device Private")
|
||||
@@ -491,7 +491,7 @@ field which is then used to acquire a timestamp.
|
||||
prompt("Break Point")
|
||||
special(SPC_NOMOD)
|
||||
interest(1)
|
||||
extra("char bkpt")
|
||||
extra("epicsUInt8 bkpt")
|
||||
}
|
||||
field(UDF,DBF_UCHAR) {
|
||||
prompt("Undefined")
|
||||
|
||||
@@ -159,6 +159,9 @@ long dbPutConvertJSON(const char *json, short dbrType,
|
||||
size_t jlen = strlen(json);
|
||||
long status;
|
||||
|
||||
if(INVALID_DB_REQ(dbrType))
|
||||
return S_db_badDbrtype;
|
||||
|
||||
parser->depth = 0;
|
||||
parser->dbrType = dbrType;
|
||||
parser->dbrSize = dbValueSize(dbrType);
|
||||
|
||||
@@ -553,7 +553,12 @@ static long lnkCalc_getValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
dbCommon *prec = plink->precord;
|
||||
int i;
|
||||
long status;
|
||||
FASTCONVERT conv = dbFastPutConvertRoutine[DBR_DOUBLE][dbrType];
|
||||
FASTCONVERT conv;
|
||||
|
||||
if(INVALID_DB_REQ(dbrType))
|
||||
return S_db_badDbrtype;
|
||||
|
||||
conv = dbFastPutConvertRoutine[DBR_DOUBLE][dbrType];
|
||||
|
||||
/* Any link errors will trigger a LINK/INVALID alarm in the child link */
|
||||
for (i = 0; i < clink->nArgs; i++) {
|
||||
@@ -624,7 +629,12 @@ static long lnkCalc_putValue(struct link *plink, short dbrType,
|
||||
dbCommon *prec = plink->precord;
|
||||
int i;
|
||||
long status;
|
||||
FASTCONVERT conv = dbFastGetConvertRoutine[dbrType][DBR_DOUBLE];
|
||||
FASTCONVERT conv;
|
||||
|
||||
if(INVALID_DB_REQ(dbrType))
|
||||
return S_db_badDbrtype;
|
||||
|
||||
conv = dbFastGetConvertRoutine[dbrType][DBR_DOUBLE];
|
||||
|
||||
/* Any link errors will trigger a LINK/INVALID alarm in the child link */
|
||||
for (i = 0; i < clink->nArgs; i++) {
|
||||
|
||||
@@ -361,6 +361,9 @@ static long lnkConst_loadScalar(struct link *plink, short dbrType, void *pbuffer
|
||||
const_link *clink = CONTAINER(plink->value.json.jlink, const_link, jlink);
|
||||
long status;
|
||||
|
||||
if(INVALID_DB_REQ(dbrType))
|
||||
return S_db_badDbrtype;
|
||||
|
||||
switch (clink->type) {
|
||||
case si64:
|
||||
if (clink->jlink.debug)
|
||||
@@ -451,12 +454,17 @@ static long lnkConst_loadArray(struct link *plink, short dbrType, void *pbuffer,
|
||||
long *pnReq)
|
||||
{
|
||||
const_link *clink = CONTAINER(plink->value.json.jlink, const_link, jlink);
|
||||
short dbrSize = dbValueSize(dbrType);
|
||||
short dbrSize;
|
||||
char *pdest = pbuffer;
|
||||
int nElems = clink->nElems;
|
||||
FASTCONVERT conv;
|
||||
long status;
|
||||
|
||||
if(INVALID_DB_REQ(dbrType))
|
||||
return S_db_badDbrtype;
|
||||
|
||||
dbrSize = dbValueSize(dbrType);
|
||||
|
||||
if (nElems > *pnReq)
|
||||
nElems = *pnReq;
|
||||
|
||||
|
||||
@@ -142,7 +142,12 @@ static long lnkState_getValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
{
|
||||
state_link *slink = CONTAINER(plink->value.json.jlink,
|
||||
struct state_link, jlink);
|
||||
FASTCONVERT conv = dbFastPutConvertRoutine[DBR_SHORT][dbrType];
|
||||
FASTCONVERT conv;
|
||||
|
||||
if(INVALID_DB_REQ(dbrType))
|
||||
return S_db_badDbrtype;
|
||||
|
||||
conv = dbFastPutConvertRoutine[DBR_SHORT][dbrType];
|
||||
|
||||
slink->val = slink->invert ^ dbStateGet(slink->state);
|
||||
return conv(&slink->val, pbuffer, NULL);
|
||||
|
||||
Reference in New Issue
Block a user