Fixed epicsadpater to deal with waveform char strings
This commit is contained in:
@ -10,6 +10,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sics.h>
|
#include <sics.h>
|
||||||
#include <sicshipadaba.h>
|
#include <sicshipadaba.h>
|
||||||
|
#undef INLINE /* already defined bz tcl.h, breaks EPICS includes */
|
||||||
#include <cadef.h>
|
#include <cadef.h>
|
||||||
#include <epicsMessageQueue.h>
|
#include <epicsMessageQueue.h>
|
||||||
#include <epicsThread.h>
|
#include <epicsThread.h>
|
||||||
@ -123,7 +124,11 @@ static void epicsDataCallback(struct event_handler_args args)
|
|||||||
switch(priv->node->value.dataType){
|
switch(priv->node->value.dataType){
|
||||||
case HIPTEXT:
|
case HIPTEXT:
|
||||||
free(priv->node->value.v.text);
|
free(priv->node->value.v.text);
|
||||||
|
if(args.type == DBR_STRING){
|
||||||
priv->node->value.v.text = strdup((char *)args.dbr);
|
priv->node->value.v.text = strdup((char *)args.dbr);
|
||||||
|
} else if(args.type == DBR_CHAR) {
|
||||||
|
priv->node->value.v.text = strndup((char *)args.dbr,args.count);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case HIPINT:
|
case HIPINT:
|
||||||
priv->node->value.v.intValue = *(int *)args.dbr;
|
priv->node->value.v.intValue = *(int *)args.dbr;
|
||||||
@ -162,7 +167,11 @@ static int epicsSubscribePV(void *message, void *userData)
|
|||||||
priv = (pEpicsPriv)message;
|
priv = (pEpicsPriv)message;
|
||||||
switch(priv->node->value.dataType){
|
switch(priv->node->value.dataType){
|
||||||
case HIPTEXT:
|
case HIPTEXT:
|
||||||
|
if(ca_field_type(priv->pvchid) == DBR_CHAR){
|
||||||
|
subType = DBR_CHAR;
|
||||||
|
} else {
|
||||||
subType = DBR_STRING;
|
subType = DBR_STRING;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case HIPINT:
|
case HIPINT:
|
||||||
case HIPINTAR:
|
case HIPINTAR:
|
||||||
@ -381,7 +390,9 @@ static void EpicsWriteFunc(void *param)
|
|||||||
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
cleanup:
|
cleanup:
|
||||||
|
if(wp->pCon != NULL){
|
||||||
SCDeleteConnection(wp->pCon);
|
SCDeleteConnection(wp->pCon);
|
||||||
|
}
|
||||||
ReleaseHdbValue(&wp->v);
|
ReleaseHdbValue(&wp->v);
|
||||||
free(wp);
|
free(wp);
|
||||||
free(pv);
|
free(pv);
|
||||||
|
Reference in New Issue
Block a user