Merged Dirk Zimoch's named-soft-events branch

Added the iocsh command postEvent
Marked a couple of char * args as const
This commit is contained in:
Andrew Johnson
2012-04-10 17:10:50 -05:00
10 changed files with 199 additions and 109 deletions

View File

@@ -51,7 +51,7 @@ static long init_record(eventRecord *prec)
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
switch (prec->inp.type) {
case CONSTANT:
if (recGblInitConstantLink(&prec->inp, DBF_USHORT, &prec->val))
if (recGblInitConstantLink(&prec->inp, DBF_STRING, &prec->val))
prec->udf = FALSE;
break;
case PV_LINK:
@@ -69,13 +69,20 @@ static long init_record(eventRecord *prec)
static long read_event(eventRecord *prec)
{
long status;
char newEvent[MAX_STRING_SIZE];
status = dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0);
if (!status) {
prec->udf = FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
if (prec->inp.type != CONSTANT)
{
status = dbGetLinkValue(&prec->inp, DBR_STRING, newEvent, 0, 0);
if (status) return status;
if (strcmp(newEvent, prec->val) != 0) {
strcpy(prec->val, newEvent);
prec->epvt = eventNameToHandle(prec->val);
}
}
return status;
prec->udf = FALSE;
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
return 0;
}