diff --git a/caPutLogApp/CONFIG_CAPUTLOG b/caPutLogApp/CONFIG_CAPUTLOG deleted file mode 100644 index 0724706..0000000 --- a/caPutLogApp/CONFIG_CAPUTLOG +++ /dev/null @@ -1,18 +0,0 @@ -# caPutLog Configuration for user applications -#============================================= - -# include guard -ifeq (,$(_CONFIG_CAPUTLOG_INCLUDED)) -_CONFIG_CAPUTLOG_INCLUDED := YES - -ifdef T_A - -# On EPICS 7, enable the JSON & Array support - -ifdef BASE_7_0 -USR_CPPFLAGS += -DJSON_AND_ARRAYS_SUPPORTED -endif - -endif # T_A - -endif # _CONFIG_CAPUTLOG_INCLUDED diff --git a/caPutLogApp/Makefile b/caPutLogApp/Makefile index 440f24e..5cc7580 100644 --- a/caPutLogApp/Makefile +++ b/caPutLogApp/Makefile @@ -28,17 +28,14 @@ INC += caPutLogAs.h DBD += caPutLog.dbd # Add support for json format and arrays -# This requires EPICS base version 7.0.1 or higher +# This requires EPICS 7 ifdef BASE_7_0 -USR_CPPFLAGS += -DJSON_AND_ARRAYS_SUPPORTED caPutLog_SRCS += caPutJsonLogTask.cpp caPutLog_SRCS += caPutJsonLogShellCommands.cpp INC += caPutJsonLogTask.h DBD += caPutJsonLog.dbd endif -# Install config file for applications -CFG += CONFIG_CAPUTLOG caPutLog_LIBS += $(EPICS_BASE_IOC_LIBS) caPutLog_SYS_LIBS_WIN32 += ws2_32 diff --git a/caPutLogApp/caPutLogAs.c b/caPutLogApp/caPutLogAs.c index 4f604af..e424551 100644 --- a/caPutLogApp/caPutLogAs.c +++ b/caPutLogApp/caPutLogAs.c @@ -51,11 +51,7 @@ #include #include -#define BASE_3_14 (EPICS_VERSION * 100 + EPICS_REVISION < 315) - -#if !(BASE_3_14) #include "dbChannel.h" -#endif #define epicsExportSharedSymbols #include "caPutLog.h" @@ -114,13 +110,9 @@ void caPutLogAsStop() static void caPutLogAs(asTrapWriteMessage *pmessage, int afterPut) { -#if BASE_3_14 - dbAddr *paddr = pmessage->serverSpecific; -#else struct dbChannel *pchan = pmessage->serverSpecific; dbAddr *paddr = &pchan->addr; const char *pv_name = pchan->name; -#endif LOGDATA *plogData; long options, num_elm; long status; @@ -143,11 +135,7 @@ static void caPutLogAs(asTrapWriteMessage *pmessage, int afterPut) epicsSnprintf(plogData->userid, MAX_USERID_SIZE, "%s", pmessage->userid); epicsSnprintf(plogData->hostid, MAX_HOSTID_SIZE, "%s", pmessage->hostid); -#if BASE_3_14 - dbNameOfPV(paddr, plogData->pv_name, PVNAME_STRINGSZ); -#else epicsSnprintf(plogData->pv_name, PVNAME_STRINGSZ, "%s", pv_name); -#endif if (VALID_DB_REQ(paddr->field_type)) { plogData->type = paddr->field_type; @@ -201,9 +189,7 @@ static void caPutLogAs(asTrapWriteMessage *pmessage, int afterPut) int caPutLogMaxArraySize(short type) { -#if !JSON_AND_ARRAYS_SUPPORTED - return 1; -#else +#if EPICS_VERSION >= 7 static int const arraySizeLookUpTable [] = { MAX_ARRAY_SIZE_BYTES/MAX_STRING_SIZE, /* DBR_STRING */ MAX_ARRAY_SIZE_BYTES/sizeof(epicsInt8), /* DBR_CHAR */ @@ -222,9 +208,11 @@ int caPutLogMaxArraySize(short type) if (type >= DBR_STRING || type <= DBR_ENUM){ return arraySizeLookUpTable[type]; } else { - errlogSevPrintf(errlogMajor, "caPutLogAs: Array size for type %d can not be determind\n", type); + errlogSevPrintf(errlogMajor, "caPutLogAs: Array size for type %d can not be determined\n", type); return 1; } +#else + return 1; #endif } diff --git a/caPutLogApp/caPutLogTask.h b/caPutLogApp/caPutLogTask.h index 94da6a9..a197b34 100644 --- a/caPutLogApp/caPutLogTask.h +++ b/caPutLogApp/caPutLogTask.h @@ -4,6 +4,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -12,7 +13,7 @@ extern "C" { #define MAX_USERID_SIZE 32 #define MAX_HOSTID_SIZE 256 -#if JSON_AND_ARRAYS_SUPPORTED +#if EPICS_VERSION >= 7 #define MAX_ARRAY_SIZE_BYTES 400 #else #define MAX_ARRAY_SIZE_BYTES 0 @@ -35,7 +36,7 @@ typedef union { epicsFloat64 v_double; char v_string[MAX_STRING_SIZE]; -#if JSON_AND_ARRAYS_SUPPORTED +#if EPICS_VERSION >= 7 epicsInt8 a_int8[MAX_ARRAY_SIZE_BYTES/sizeof(epicsInt8)]; epicsUInt8 a_uint8[MAX_ARRAY_SIZE_BYTES/sizeof(epicsUInt8)]; epicsInt16 a_int16[MAX_ARRAY_SIZE_BYTES/sizeof(epicsInt16)];