- improvements in protocols and drivers

This commit is contained in:
zolliker
2012-06-19 07:19:03 +00:00
parent 6c69b59fce
commit 86d225a714
13 changed files with 243 additions and 95 deletions

View File

@ -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) {