/* devErrlogSoft.c */ /* Example device support module */ #include #include #include #include #include "alarm.h" #include "cvtTable.h" #include "dbDefs.h" #include "dbAccess.h" #include "recGbl.h" #include "recSup.h" #include "devSup.h" #include "link.h" #include "xxxRecord.h" #include "epicsExport.h" #include "stringoutRecord.h" #include "errlog.h" /*Create the dset for devErrlogSoft */ static long init_record(); static long read_message(); struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN get_ioint_info; DEVSUPFUN read_message; }devErrlogSoft={ 5, NULL, NULL, init_record, NULL, read_message, }; epicsExportAddress(dset,devErrlogSoft); static long init_record(pRecord) struct stringoutRecord *pRecord; { if (strncmp(pRecord->out.value.instio.string, "INFO", 4) == 0) { pRecord->dpvt = errlogInfo; } if (strncmp(pRecord->out.value.instio.string, "MINOR", 5) == 0) { pRecord->dpvt = errlogMinor; } if (strncmp(pRecord->out.value.instio.string, "MAJOR", 5) == 0) { pRecord->dpvt = errlogMajor; } if (strncmp(pRecord->out.value.instio.string, "FATAL", 5) == 0) { pRecord->dpvt = errlogFatal; } return(0); } static long read_message(pRecord) struct stringoutRecord *pRecord; { errlogSevPrintf((errlogSevEnum) pRecord->dpvt, pRecord->val); return(0); }