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