Merge lp:~matej-sekoranja/epics-base/pcas-variable-length-arrays into lp:~epics-core/epics-base/3.16
Status: | Rejected |
---|---|
Rejected by: | Andrew Johnson |
Proposed branch: | lp:~matej-sekoranja/epics-base/pcas-variable-length-arrays |
Merge into: | lp:~epics-core/epics-base/3.16 |
Diff against target: |
228 lines (+39/-26) 3 files modified
src/ca/legacy/pcas/generic/caHdrLargeArray.h (+1/-1) src/ca/legacy/pcas/generic/casStrmClient.cc (+37/-24) src/ca/legacy/pcas/generic/casStrmClient.h (+1/-1) |
To merge this branch: | bzr merge lp:~matej-sekoranja/epics-base/pcas-variable-length-arrays |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
EPICS Core Developers | Pending | ||
Review via email: mp+256123@code.launchpad.net |
Description of the change
This branch adds variable length array support to pcas. Changes are mostly trivial - just replace msgHeader’s count with actual getElementCount(). Fine for monitors, however
read and readNotify (and first monitor event, that calls read) need additional code in the casPV::read(const casCtx &, gdd & protoIn) method, the method pCAS programmer needs to implement.
In order to do a “read” operation a DBR is created first (protoIn variable) and then the value is then copied into the “protoIn”. “protoIn” GDD structure contains “bounds” structure that specifies array size. If “bounds” are not specified, then scalar value is assumed.
If “0” count is given by the CA client then the GDD created has no “bounds” specified and this implies a scalar GDD. Consequently “read” will always return only one element.
So, the implementation of casPV::read(const casCtx &, gdd & protoIn) needs to check if “bounds” exists and create one if necessary (getBounds() == 0 && element count > 1):
if (!protoIn.
{
// convert to atomic
gddBounds bds;
bds.setSize ( this->info.
bds.setFirst ( 0u );
protoIn.
}
This check cannot be done in casStrmClient.cc since only the casPV implementation knows that the value actually is.
I think this is acceptable design: if “bounds” is not provided then casPV::read implementation needs to set one (to reflect current value “bounds”) - as shown above.
Unmerged revisions
- 12662. By Matej Sekoranja
-
added support for variable array length to read/readNotify and addEvent
What will happen if an unmodified application gets built against this version of the pcas code and a client subscribes (or does a ca_get_callback() ) to it with zero size?
This change will need documenting in the documentation/ RELEASE_ NOTES.html file. Since there isn't a document that describes the pcas API, all the detail of the necessary application changes should go there.