Hi Michael,
On 2012-11-29 Michael Davidsaver wrote:
> The problem was observed when attempting to use a use CAJ (via CSS) to
> monitor a PV through a CA gateway. The situation as I remember it was:
>
> 1) CAJ client sends message to create a new monitor with DBE_PROPERTY mask.
> 2) CA gateway fails this request and returns a CA error message
> indicating invalid DBE mask.
The underlying cas code has event masks registered for DBE_VALUE, DBE_LOG and
DBE_ALARM but not for DBE_PROPERTY. It appears to be fairly trivial to add
the missing code to the cas, see the attached patch which I'm considering
committing to 3.14.12.3 (comments welcome). However I believe the gateway
code will need more complex changes to handle property events.
> There are several behaviors here which seem suspect to me. Changing any
> one would, I think, avoid the problem.
>
> 1) Should the CA gateway white list certain DBE mask bits? It seems
> like a more future proof behavior is to just pass them through.
Unfortunately it looks to be more complicated than that, it seems to separate
the different events out and handle them individually or in combination.
AFAICT it ends up calling postEvent() with several different event masks.
Someone will probably have to spend some time understanding how it works in a
bit more detail before developing the necessary changes.
Note that the gateway is on Launchpad at https://launchpad.net/epics-gateway
and using Bazaar the project trunk is lp:epics-gateway (check this out under
your extensions/src directory). Let me know if you want to work on this.
> 4) Why does CSS delete the monitor before issuing a put?
That is an interesting question...
- Andrew
--
Computer science is as much about computers as astronomy is about
telescopes. -- Edsger Dijkstra
=== modified file 'src/cas/generic/caServer.cc'
--- src/cas/generic/caServer.cc 2010-10-05 19:27:37 +0000
+++ src/cas/generic/caServer.cc 2012-11-30 15:50:38 +0000
@@ -141,6 +141,17 @@
}
}
+casEventMask caServer::propertyEventMask () const
+{
+ if (pCAS) {
+ return this->pCAS->propertyEventMask();
+ }
+ else {
+ printf("caServer:: no server internals attached\n");
+ return casEventMask();
+ }
+}
+
class epicsTimer & caServer::createTimer ()
{
return fileDescriptorManager.createTimer ();
=== modified file 'src/cas/generic/caServerI.cc'
--- src/cas/generic/caServerI.cc 2010-10-05 19:27:37 +0000
+++ src/cas/generic/caServerI.cc 2012-11-30 15:51:31 +0000
@@ -53,6 +53,7 @@
this->valueEvent = registerEvent ( "value" );
this->logEvent = registerEvent ( "log" );
this->alarmEvent = registerEvent ( "alarm" );
+ this->propertyEvent = registerEvent ( "property" );
this->locateInterfaces ();
=== modified file 'src/cas/generic/caServerI.h'
--- src/cas/generic/caServerI.h 2009-08-13 23:38:41 +0000
+++ src/cas/generic/caServerI.h 2012-11-30 15:53:18 +0000
@@ -61,6 +61,7 @@
casEventMask valueEventMask () const; // DBE_VALUE registerEvent("value")
casEventMask logEventMask () const; // DBE_LOG registerEvent("log")
casEventMask alarmEventMask () const; // DBE_ALARM registerEvent("alarm")
+ casEventMask propertyEventMask () const; // DBE_PROPERTY registerEvent("property")
unsigned subscriptionEventsProcessed () const;
void incrEventsProcessedCounter ();
unsigned subscriptionEventsPosted () const;
@@ -97,6 +98,7 @@
casEventMask valueEvent; // DBE_VALUE registerEvent("value")
casEventMask logEvent; // DBE_LOG registerEvent("log")
casEventMask alarmEvent; // DBE_ALARM registerEvent("alarm")
+ casEventMask propertyEvent; // DBE_PROPERTY registerEvent("property")
caStatus attachInterface ( const caNetAddr & addr, bool autoBeaconAddr,
bool addConfigAddr );
@@ -141,6 +143,11 @@
return this->alarmEvent;
}
+inline casEventMask caServerI::propertyEventMask() const
+{
+ return this->propertyEvent;
+}
+
inline bool caServerI :: ioIsPending () const
{
return ( ioInProgressCount > 0u );
=== modified file 'src/cas/generic/casStrmClient.cc'
--- src/cas/generic/casStrmClient.cc 2010-09-29 05:44:47 +0000
+++ src/cas/generic/casStrmClient.cc 2012-11-30 15:49:52 +0000
@@ -1987,6 +1987,9 @@
if (caProtoMask&DBE_ALARM) {
mask |= this->getCAS().alarmEventMask();
}
+ if (caProtoMask&DBE_PROPERTY) {
+ mask |= this->getCAS().propertyEventMask();
+ }
if (mask.noEventsSelected()) {
char errStr[40];
=== modified file 'src/cas/generic/casdef.h'
--- src/cas/generic/casdef.h 2009-08-06 01:36:30 +0000
+++ src/cas/generic/casdef.h 2012-11-30 15:47:32 +0000
@@ -245,6 +245,7 @@
epicsShareFunc casEventMask valueEventMask () const; // DBE_VALUE
epicsShareFunc casEventMask logEventMask () const; // DBE_LOG
epicsShareFunc casEventMask alarmEventMask () const; // DBE_ALARM
+ epicsShareFunc casEventMask propertyEventMask () const; // DBE_PROPERTY
epicsShareFunc void setDebugLevel ( unsigned level );
epicsShareFunc unsigned getDebugLevel () const;
- Replies:
- DBE_PROPERTY and CSS Re: Using CAJ in production (DBE_PROPERTY and CA gateway) Kasemir, Kay
- References:
- Using CAJ in production Shankar, Murali
- Re: Using CAJ in production (DBE_PROPERTY and CA gateway) Michael Davidsaver
- Navigate by Date:
- Prev:
RE: CSS BOY left-mouse event Chen, Xihui
- Next:
DBE_PROPERTY and CSS Re: Using CAJ in production (DBE_PROPERTY and CA gateway) Kasemir, Kay
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Using CAJ in production (DBE_PROPERTY and CA gateway) Michael Davidsaver
- Next:
DBE_PROPERTY and CSS Re: Using CAJ in production (DBE_PROPERTY and CA gateway) Kasemir, Kay
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|