Skip to content

Commit 55b33e3

Browse files
committed
Make pv logging compatible with EPICS 3.15 and above
In EPICS 3.15 the interface to caput event hooking was changed. We need to detect the correct EPICS version and handle the update accordingly.
1 parent 7cb8890 commit 55b33e3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

softIocApp/PythonSupport.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
#include <dbFldTypes.h>
1010
#include <dbStaticLib.h>
1111
#include <asTrapWrite.h>
12+
#include <epicsVersion.h>
13+
14+
15+
/* The interface to the caput event callback has changed as of EPICS 3.15, and
16+
* we need to compile as appropriate. */
17+
#define BASE_3_15 (EPICS_VERSION * 100 + EPICS_REVISION >= 315)
18+
#if BASE_3_15
19+
#include <dbChannel.h>
20+
#endif
1221

1322

1423

@@ -169,7 +178,12 @@ static void PrintValue(struct formatted *formatted)
169178

170179
void EpicsPvPutHook(struct asTrapWriteMessage *pmessage, int after)
171180
{
172-
struct dbAddr *dbaddr = pmessage->serverSpecific;
181+
#if BASE_3_15
182+
struct dbChannel *pchan = pmessage->serverSpecific;
183+
dbAddr *dbaddr = &pchan->addr;
184+
#else
185+
dbAddr *dbaddr = pmessage->serverSpecific;
186+
#endif
173187
struct formatted *value = FormatValue(dbaddr);
174188

175189
if (after)

0 commit comments

Comments
 (0)