Commit ec94ba7e authored by koennecke's avatar koennecke
Browse files

Fixed epicsadpater to deal with waveform char strings

parent 58a8bd00
......@@ -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);
priv->node->value.v.text = strdup((char *)args.dbr);
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:
subType = DBR_STRING;
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:
SCDeleteConnection(wp->pCon);
if(wp->pCon != NULL){
SCDeleteConnection(wp->pCon);
}
ReleaseHdbValue(&wp->v);
free(wp);
free(pv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment