From 82396ee3ef1ae1dcf64dffb731b354c273dede66 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Fri, 5 May 2017 12:48:31 +0200 Subject: [PATCH] fix data size of gdd container type getDataSizeElement of gdd container returns the number of sub fields. It has to be called on the "value" field. This fix has already been done in monitorReponse. --- src/cas/generic/casStrmClient.cc | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/cas/generic/casStrmClient.cc b/src/cas/generic/casStrmClient.cc index c18e5bfa4..58f89425d 100644 --- a/src/cas/generic/casStrmClient.cc +++ b/src/cas/generic/casStrmClient.cc @@ -530,8 +530,20 @@ caStatus casStrmClient::readResponse ( epicsGuard < casClientMutex > & guard, pChan->getCID(), status, ECA_GETFAIL ); } + aitUint32 elementCount = 0; + if (desc.isContainer()) { + aitUint32 index; + int gdds = gddApplicationTypeTable::app_table.mapAppToIndex + ( desc.applicationType(), gddAppType_value, index ); + if ( gdds ) { + return S_cas_badType; + } + elementCount = desc.getDD(index)->getDataSizeElements(); + } else { + elementCount = desc.getDataSizeElements(); + } ca_uint32_t count = (msg.m_count == 0) ? - (ca_uint32_t)desc.getDataSizeElements() : + (ca_uint32_t)elementCount : msg.m_count; void * pPayload; @@ -659,8 +671,20 @@ caStatus casStrmClient::readNotifyResponse ( epicsGuard < casClientMutex > & gua return ecaStatus; } + aitUint32 elementCount = 0; + if (desc.isContainer()) { + aitUint32 index; + int gdds = gddApplicationTypeTable::app_table.mapAppToIndex + ( desc.applicationType(), gddAppType_value, index ); + if ( gdds ) { + return S_cas_badType; + } + elementCount = desc.getDD(index)->getDataSizeElements(); + } else { + elementCount = desc.getDataSizeElements(); + } ca_uint32_t count = (msg.m_count == 0) ? - (ca_uint32_t)desc.getDataSizeElements() : + (ca_uint32_t)elementCount : msg.m_count; void *pPayload;