- improvements in protocols and drivers
This commit is contained in:
10
dumprot.c
10
dumprot.c
@ -2,7 +2,7 @@
|
||||
#include "ascon.i"
|
||||
|
||||
/*
|
||||
* this is a scriptcontext driver connecting to its own sics server
|
||||
* this is a scriptcontext driver connecting to its own sics server.
|
||||
* after a send command the configured polling script is called repeatedly
|
||||
* with the sent command as argument until it returns something else than 0
|
||||
*
|
||||
@ -12,8 +12,9 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int DumProtHandler(Ascon *a)
|
||||
{
|
||||
Tcl_Interp *pTcl = InterpGetTcl(pServ->pSics);
|
||||
int ret, l = -1;
|
||||
Tcl_Interp *pTcl;
|
||||
int ret;
|
||||
|
||||
char *result = NULL;
|
||||
int iRet = 1;
|
||||
|
||||
@ -30,7 +31,8 @@ int DumProtHandler(Ascon *a)
|
||||
break;
|
||||
case AsconReadStart:
|
||||
case AsconReading:
|
||||
ret = Tcl_EvalEx(pTcl, GetCharArray(a->wrBuffer), l, 0);
|
||||
pTcl = InterpGetTcl(pServ->pSics);
|
||||
ret = Tcl_EvalEx(pTcl, GetCharArray(a->wrBuffer), GetDynStringLength(a->wrBuffer), 0);
|
||||
result = (char *) Tcl_GetStringResult(pTcl);
|
||||
DynStringCopy(a->rdBuffer, result);
|
||||
if (ret != TCL_OK || strcmp(result, "0") != 0) {
|
||||
|
Reference in New Issue
Block a user