From 3f892610b8b955abb8079e3ebe012a436ae4bd30 Mon Sep 17 00:00:00 2001
From: meini <meini@meini-desktop.ARBEITSGRUPPE>
Date: Tue, 17 Mar 2009 11:10:39 +0100
Subject: several bugfixes

---
 src/Makefile.am      |   13 ++--
 src/configVariable.h |   51 +++++++++----
 src/remoteConfig.cc  |  200 +++++++++++++++++++++++++++++++++++++++-----------
 src/testmodul.cc     |   10 +-
 src/testmodul.h      |   61 +++++++++++++++
 5 files changed, 265 insertions(+), 70 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 26609f7eecdfea0a748a04184a11ba78f720d90b..b47951e87eaf07971fd3407be8a1d7b09b25343c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,9 +30,8 @@ pkglib_LTLIBRARIES = \
 	src_filter.la \
 	traffic.la \
 	spp.la\
-	remoteConfig.la \
 	testModul.la
-
+#	remoteConfig.la \
 #	tapiface_crypto.la \
 #
 
@@ -103,17 +102,17 @@ topowatch_la_CPPFLAGS = -DMODULE_NAME=topowatch $(COMMON_CPPFLAGS)
 topowatch_la_LDFLAGS  = $(module_flags)
 topowatch_la_LIBADD = -lgea3 -lgea3-posix
 
-remoteConfig_la_SOURCES  = remoteConfig.cc remoteConfig.h configVariable.h
-remoteConfig_la_CPPFLAGS = -DMODULE_NAME=remoteConfig $(COMMON_CPPFLAGS)
-remoteConfig_la_LDFLAGS  = $(module_flags)
-remoteConfig_la_LIBADD = -lgea3 -lgea3-posix
+#remoteConfig_la_SOURCES  = remoteConfig.cc remoteConfig.h configVariable.h
+#remoteConfig_la_CPPFLAGS = -DMODULE_NAME=remoteConfig $(COMMON_CPPFLAGS)
+#remoteConfig_la_LDFLAGS  = $(module_flags)
+#remoteConfig_la_LIBADD = -lgea3 -lgea3-posix
 
 spp_la_SOURCES  = SPP.cc SPP.h SPP2.h History.h
 spp_la_CPPFLAGS = -DMODULE_NAME=spp $(COMMON_CPPFLAGS)
 spp_la_LDFLAGS  = $(module_flags)
 spp_la_LIBADD = -lgea3 -lgea3-posix 
 
-testModul_la_SOURCES  = testmodul.cc testmodul.h remoteConfig.cc
+testModul_la_SOURCES  = testmodul.cc testmodul.h remoteConfig.cc remoteConfig.h
 testModul_la_CPPFLAGS = -DMODULE_NAME=testModul $(COMMON_CPPFLAGS)
 testModul_la_LDFLAGS  = $(module_flags)
 testModul_la_LIBADD = -lgea3 -lgea3-posix
diff --git a/src/configVariable.h b/src/configVariable.h
index 95a0d16ce886891066a885a4df0d9dd97df6ad9c..5abcb01a923e7b0a9fb6ff7e539a3bbcb588045d 100644
--- a/src/configVariable.h
+++ b/src/configVariable.h
@@ -89,7 +89,7 @@ class ConfigVariable
 		}
 
 		virtual char* toString(char* &buffer)=0;
-		virtual void fromString(const char * value)=0;
+		virtual int fromString(const char * value)=0;
 
 		char* getName(){return m_name;}
 };
@@ -127,14 +127,22 @@ class ConfigVariableInt : public ConfigVariable
 			//char buffer[256];
 			memset(buffer,0,256);
 			int value=0;
-			m_vgh(m_thisref,&value);
-			int retval = sprintf(buffer,"%i",value);
+			int retval = m_vgh(m_thisref,&value);
+			if(retval==CONFIG_VARIABLE_SUCCESS)
+				retval = sprintf(buffer,"%i",value);
+			else
+			{
+				retval = sprintf(buffer,"%s","CONFIG_VARIABLE_FAILURE");
+			}
 			return buffer;
 		}
-		virtual void fromString(const char * value)
+		virtual int fromString(const char * value)
 		{
+			printf("so dann machen wir mal nen test\n");fflush(stdout);
 			int mvalue=atoi(value);
+			printf("<%i> <%s>\n",mvalue,value);fflush(stdout);
 			m_vsh(m_thisref,&mvalue);
+			printf("na nanana?\n");fflush(stdout);
 		}
 
 };
@@ -213,7 +221,7 @@ class ConfigVariableString : public ConfigVariable
 			m_vgh(m_thisref,buffer);
 			return buffer;
 		}
-		virtual void fromString(const char * value)
+		virtual int fromString(const char * value)
 		{
 			int valueLength = strlen(value);
 			
@@ -265,9 +273,9 @@ class ConfigVariableBool : public ConfigVariable
 		{
 			//char buffer[256];
 			
-			buffer = new char[16];
+			//buffer = new char[16];
 			//memcpy(buffer,m_value,m_valueLength);
-			memset(buffer,0,16);
+			memset(buffer,0,1024);
 			bool value=false;
 			m_vgh(m_thisref,&value);
 			if(value)
@@ -277,10 +285,19 @@ class ConfigVariableBool : public ConfigVariable
 			return buffer;
 		}
 
-		virtual void fromString(const char * value)
+		virtual int fromString(const char * value)
 		{
-			if(!strcmp("true",value))m_value=true;
-			else if(!strcmp("false",value))m_value=false;
+			
+			if(!strcmp("true",value))
+			{
+				bool mvalue=true;
+				m_vsh(m_thisref,&mvalue);
+			}
+			else if(!strcmp("false",value))
+			{
+				bool mvalue=false;
+				m_vsh(m_thisref,&mvalue);
+			}
 			else GEA.dbg() << "ConfigVariableBool: unknown value: "<< value << endl;
 		}
 };
@@ -320,13 +337,13 @@ class ConfigVariableFloat : public ConfigVariable
 			//char buffer[256];
 			float value;
 			m_vgh(m_thisref,&value);
-			buffer = new char[1024];
+			//buffer = new char[1024];
 			memset(buffer,0,1024);
 			
 			sprintf(buffer,"%f",value);
 			return buffer;
 		}
-		virtual void fromString(const char * value)
+		virtual int fromString(const char * value)
 		{
 			float mvalue = atof(value);
 			m_vsh(m_thisref,&mvalue);
@@ -366,12 +383,16 @@ class ConfigVariableDouble : public ConfigVariable
 		{
 			//char buffer[256];
 			memset(buffer,0,256);
-			sprintf(buffer,"%lf",m_value);
+			double value;
+			m_vgh(m_thisref,&value);
+			sprintf(buffer,"%lf",value);
 			return buffer;
 		}
-		virtual void fromString(const char * value)
+		virtual int fromString(const char * value)
 		{
-			m_value = atof(value);
+			//m_value = atof(value);
+			double mvalue = atof(value);
+			m_vsh(m_thisref,&mvalue);
 		}
 };
 
diff --git a/src/remoteConfig.cc b/src/remoteConfig.cc
index 1c478b04cbaa76e1b99b788d10fedeb32aeb74c3..82c994de8f541aeb5b9caac7e974102620f4ccef 100644
--- a/src/remoteConfig.cc
+++ b/src/remoteConfig.cc
@@ -40,20 +40,42 @@ void RemoteConfig::requestCreator (void *data, WriteMarshalStream* msOut)
 	unsigned int len1=*pidata;
 	unsigned int len2=*(++pidata);
 	unsigned int len3=*(++pidata);
+	if(len1<1&&len2<1&&len3<1)
+	{
+	int length=0;
+	*msOut << (uint32_t) length;
+	return;
+	}
+	//TODO einzelne laengen abfangen
 	unsigned char uc=' ';
 	char* pcdata = (char*)(((char*)data)+sizeof(len1)+sizeof(len2)+sizeof(len3));
 	
 	int length=len1+len2+len3+2;
-	*msOut << (uint32_t) length;		
-
+	*msOut << (uint32_t) length;
+/*	printf("length: %i\n",length);
+		
+	printf("pcdata1: ");
+	for(int i=0;i<len1;i++)printf("%c",pcdata[i]);
+	printf("\n");	
+*/	
 	std::pair<void *, unsigned int> v1(pcdata,len1);
 	*msOut << v1;
 	*msOut << uc;
 	std::pair<void *, unsigned int> v2(pcdata+len1,len2);
+/*	
+	printf("pcdata2: ");
+	for(int i=0;i<len2;i++)printf("%c",(pcdata+len1)[i]);
+	printf("\n");
+*/	
 	*msOut << v2;
 	*msOut << uc;
 	if(len3>0)
 	{
+
+		printf("pcdata1: ");
+		for(int i=0;i<len3;i++)printf("%c",(pcdata+len1+len2)[i]);
+		printf("\n");
+
 		std::pair<void *, unsigned int> v3(pcdata+len1+len2,len3);
 		*msOut << v3;
 	}
@@ -79,7 +101,7 @@ int RemoteConfig::remoteConfigAddCommand() {
 	return -1;
 
     shell->add_command("rc", remoteconfig_command_fn, this,
-		       "remote manipulation of all topologies",
+		       "remote manipulation of all configurations",
 		       config_cmd_usage);
 
     return 0;
@@ -89,16 +111,21 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 {
 	REP_MAP_OBJ(SppManager2 *,sppManager);
     	int cmd;
-    	if ( (argc >= 2) && !strcmp(argv[1], "set")) //TODO das set entfernen!
+    	if ( (argc >= 2) )
 	{
 		cmd = 1;
-		if(!strcmp(argv[2], "[..]")) // FUER ALLE KNOTEN
+		//groesse abfragen
+		if(!strcmp(argv[1], "[..]")) // FUER ALLE KNOTEN
 		{
-			if(argc>=4)
+			if(argc>=3)
 			{	
-				int length=strlen(argv[3]);
-				int length1=strlen(argv[4]);
-				if(argc==5)
+
+				for(int i=0;i<argc;i++)
+					printf("%i %s\n",i,argv[i]);
+
+				int length=strlen(argv[2]);
+				int length1=strlen(argv[3]);
+				if(argc==4)
 				{
 					int i=0;
 					char* buffer = new char[3*sizeof(unsigned int)+length+length1];
@@ -106,29 +133,41 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 					memcpy(buffer,&length,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
 					memcpy(pbuffer,&length1,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
 					memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,argv[3],length);pbuffer+=length;
-					memcpy(pbuffer,argv[4],length1);pbuffer+=length1;
+					memcpy(pbuffer,argv[2],length);pbuffer+=length;
+					memcpy(pbuffer,argv[3],length1);pbuffer+=length1;
 
 					gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
 					sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
 				}
-				if(argc==6)
+				if(argc==5)
 				{
-					int length2=strlen(argv[5]);
+					printf("hier?\n");
+					int length2=strlen(argv[4]);
 					char* buffer = new char[3*sizeof(unsigned int)+length+length1+length2];
 					char* pbuffer = buffer;
 					memcpy(buffer,&length,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
 					memcpy(pbuffer,&length1,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
 					memcpy(pbuffer,&length2,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
-					memcpy(pbuffer,argv[3],length);pbuffer+=length;
-					memcpy(pbuffer,argv[4],length1);pbuffer+=length1;
-					memcpy(pbuffer,argv[5],length2);pbuffer+=length2;
+					memcpy(pbuffer,argv[2],length);pbuffer+=length;
+					memcpy(pbuffer,argv[3],length1);pbuffer+=length1;
+					memcpy(pbuffer,argv[4],length2);pbuffer+=length2;
 					gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
 					sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
 				}
 
 				//sppManager->sendRequestAll( 9761, &v, create_req, t_start, get_response);
 			}
+			else
+			{
+				char* buffer = new char[3*sizeof(unsigned int)];
+				char* pbuffer = buffer;
+				int i=0;
+				memcpy(buffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
+				memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
+				memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
+				gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
+				sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
+			}
 			
 		}
 		else // einzeln parsen
@@ -151,31 +190,78 @@ void RemoteConfig::finishedHandler (void *data)
 }
 int RemoteConfig::responseHandler (void *data, ReadMarshalStream*  msIn, const awds::NodeId& src) 
 {
-	//TODO zusammen mit dem einzelnen Knoten zum senden neu implementieren
-    return 0;
+	uint32_t status;
+	*msIn >> status;
+	uint32_t length;
+	*msIn >> length;
+	if(status)
+	{
+		GEA.dbg() << "Response from " << src <<" with length "<< length << ". Obviously there was an error!" << std::endl;
+		return CONFIG_VARIABLE_FAILURE;
+	}
+	char* retval;
+	if(length>0)
+	{
+		retval = new char[length+1];
+		memset(retval,0,length+1);
+		std::pair<void *, unsigned> v(retval,length);
+		*msIn >> v;
+		GEA.dbg() << "Response from " << src <<" with length "<< length <<"content in <> is: <" << retval <<">" << std::endl;
+	}
+	else
+		GEA.dbg() << "Response from " << src <<" with length "<< length << ". Strange but there was no error!" << std::endl;
+	return CONFIG_VARIABLE_SUCCESS;
 }
 
 int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMarshalStream* msOut, const awds::NodeId& src) 
 {
 	uint32_t length;
 	*msIn >> length;
+	REP_MAP_OBJ(RemoteConfig *,remoteConfig);
+	if(!remoteConfig)
+		return -1;
+	if(length<1)
+	{
+		int len=0;
+		for(std::map<char*,ConfigVariable*>::iterator it2=remoteConfig->remoteVariables.begin();it2!=remoteConfig->remoteVariables.end();it2++)
+		{
+			len+=strlen(it2->first)+1;
+		}
+		uint32_t lout = len;
+		uint32_t status = 0;
+		*msOut << status;
+		*msOut << lout;
+		for(std::map<char*,ConfigVariable*>::iterator it2=remoteConfig->remoteVariables.begin();it2!=remoteConfig->remoteVariables.end();it2++)
+		{
+			std::pair<void *, unsigned> vOut(it2->first,strlen(it2->first));
+			*msOut << vOut;
+			unsigned char uc='\n';
+			*msOut << uc;
+		}
+		return CONFIG_VARIABLE_SUCCESS;
+	}
 	char* names;
 	char* modulename[3];
-
+	printf("length:%i\n",length);
 	names = new char[length+1];
+	memset(names,0,length+1);
 	std::pair<void *, unsigned> v(names,length);
 	*msIn >> v;
+	printf("names1: %s\n",names);
 	names[length]=0;
-
+	printf("names2: %s\n",names);
 	char * pch;
 	int i=0;
 	for(int i=0;i<3;i++)modulename[i]=NULL;
 	//TODO mehrere streams auslesen? allerdings muessten dann mehrere ints übertragen werden wegen der länge?
 	pch = strtok (&(names[0])," ");
+	//GEA.dbg() << "strange things happen here!"<< endl;
 	while (pch != NULL&&i<3)
 	{
-		modulename[i] = new char[strlen(pch)];
+		modulename[i] = new char[strlen(pch)+1];
+		memset(modulename[i],0,strlen(pch)+1);
 		memcpy(modulename[i],pch,strlen(pch));
+		//modulename[i][strlen(pch)]=0;
 		pch = strtok (NULL, " ");
 		i++;
 	}
@@ -183,35 +269,63 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 	{
 		int len1=strlen(modulename[0]);
 		int len2=strlen(modulename[1]);
+		if(len1<1||len2<1) return CONFIG_VARIABLE_FAILURE;
 		char* fullname = new char[len1+len2+2];
+		memset(fullname,0,len1+len2+2);
 		memcpy(fullname,modulename[0],len1);
 		fullname[len1]=' ';
-		memcpy(fullname+len1+1,modulename[0],strlen(modulename[0]));
-		fullname[len1+len2+1]=0;
-		REP_MAP_OBJ(RemoteConfig *,remoteConfig);
-		if (!remoteConfig)
+		printf("%s\n",modulename[0]);fflush(stdout);
+		printf("%s\n",modulename[1]);fflush(stdout);
+		memcpy(fullname+len1+1,modulename[1],len2);
+		//fullname[len1+len2+1]=0;
+		if (remoteConfig)
 		{
-			std::map<char*,ConfigVariable*>::iterator it = remoteConfig->remoteVariables.find(fullname);
-			if(it!=remoteConfig->remoteVariables.end())
+			bool found=false;
+			std::map<char*,ConfigVariable*>::iterator it = remoteConfig->remoteVariables.find(fullname);// das geht so leider nicht? Oo
+			printf("fullname: <%s>\n",fullname);fflush(stdout);
+			for(std::map<char*,ConfigVariable*>::iterator it2=remoteConfig->remoteVariables.begin();it2!=remoteConfig->remoteVariables.end();it2++)
 			{
-				if(modulename[3]!=NULL)
-				{
-					(it->second)->setFromString(modulename[3]);
-					//(it->second)->set(modulename[3]); //ConfigVariable
-					//TODO WriteMarshalStream fuellen!
-
-					*msOut << v;
-				}
-				else
+			//		printf("true::::<%s>\n",it2->first);
+			//	else printf("false::::<%s>\n",it2->first);
+			
+				//if(it!=remoteConfig->remoteVariables.end())
+				if(!strcmp(it2->first,fullname))
 				{
-					char* buffer = new char[1024];
-					memset(buffer,0,1024);
-					(it->second)->toString(buffer); //ConfigVariable
-					int length=strlen(buffer);
-					std::pair<void *, unsigned> v(buffer,length);
-					*msOut << v;
+					printf("fullname: <%s>\n",fullname);fflush(stdout);
+					found=true;
+					if(modulename[2]!=NULL)
+					{
+						(it2->second)->fromString(modulename[2]);
+						//(it->second)->set(modulename[3]); //ConfigVariable
+						//TODO WriteMarshalStream fuellen!
+						uint32_t lout = 0;
+						*msOut << lout;
+						*msOut << lout;
+					}
+					else
+					{
+						printf("testausgabe1\n");fflush(stdout);
+						char* buffer = new char[1024];
+						memset(buffer,0,1024);
+						(it2->second)->toString(buffer); //ConfigVariable
+						int length=strlen(buffer);
+						uint32_t lout = length;
+						uint32_t status = 0;
+						*msOut << status;
+						*msOut << lout;
+						std::pair<void *, unsigned> vOut(buffer,length);
+						*msOut << vOut;
+						delete buffer;
+					}
 				}
-
+			}
+			if(!found)
+			{
+				printf("oooops\n");fflush(stdout);
+				uint32_t lout = 1;
+				*msOut << lout;
+				lout=0;
+				*msOut << lout;
 			}
 		}
 		else
diff --git a/src/testmodul.cc b/src/testmodul.cc
index 5ea65f2bfb823da809e9af6303d6033e168b259e..d880c3ad89c6e67049d1dd7a9a8095bd8ab903d7 100644
--- a/src/testmodul.cc
+++ b/src/testmodul.cc
@@ -23,7 +23,11 @@ RemoteConfigTestModule::RemoteConfigTestModule()
 	this->testbool=false;
 
 	//ConfigVariableInt(const char* name, const int value, variableGetHandler vgh,variableSetHandler vsh,void* classref):
-	remoteConfig->remoteConfigAnnounce((char*)"testint",new ConfigVariableInt("testint",10,getint,setint,this));
+	remoteConfig->remoteConfigAnnounce((char*)"testmodul testint",new ConfigVariableInt("testmodul testint",10,getint,setint,this));
+	remoteConfig->remoteConfigAnnounce((char*)"testmodul testdouble",new ConfigVariableDouble("testmodul testdouble",10,getdouble,setdouble,this));
+	remoteConfig->remoteConfigAnnounce((char*)"testmodul testfloat",new ConfigVariableFloat("testmodul testfloat",10,getfloat,setfloat,this));
+	remoteConfig->remoteConfigAnnounce((char*)"testmodul testbool",new ConfigVariableBool("testmodul testbool",true,getbool,setbool,this));
+	remoteConfig->remoteConfigAnnounce((char*)"testmodul testchar",new ConfigVariableString("testmodul testchar","test",getchar,setchar,this));
 
 }
 
@@ -55,12 +59,8 @@ int RemoteConfigTestModule::addRemoteConfigTestModulCmd()
 }
 void RemoteConfigTestModule::print()
 {
-	printf("test3!!\n");fflush(stdout);
-	
-	GEA.dbg() << "testdouble" <<testdouble<<"\n"; 
 	if(testbool==true)
 	{
-	GEA.dbg() << "testdouble2" <<testdouble<<"\n"; 
 		printf("testint: %li testdouble: %lf testfloat: %f testchar:<%s> testbool: true\n",testint,testdouble,testfloat,this->testchar);
 	}
 	else
diff --git a/src/testmodul.h b/src/testmodul.h
index 464dbca121bf51f1f10d21d598e507797bf28453..9d89dbe530697ca362aa7ee9200efafaabf72e73 100644
--- a/src/testmodul.h
+++ b/src/testmodul.h
@@ -29,7 +29,10 @@ public:
 
 	static int setint( void* thisref,const void* value)
 	{
+		printf("so hierrrrr?\n");fflush(stdout);
+		printf("1<%i> <%i>\n",((RemoteConfigTestModule*)thisref)->testint,*((int*)value));
 		((RemoteConfigTestModule*)thisref)->testint=*((int*)value);
+		printf("2<%i> <%i>\n",((RemoteConfigTestModule*)thisref)->testint,*((int*)value));
 		return CONFIG_VARIABLE_SUCCESS;
 	}
 	static int getint (void* thisref,void* value)
@@ -38,6 +41,64 @@ public:
 		return CONFIG_VARIABLE_SUCCESS;
 	}
 
+	static int setfloat( void* thisref,const void* value)
+	{
+		
+		((RemoteConfigTestModule*)thisref)->testfloat=*((float*)value);
+		return CONFIG_VARIABLE_SUCCESS;
+	}
+	static int getfloat (void* thisref,void* value)
+	{
+		*((float*)value)=((RemoteConfigTestModule*)thisref)->testfloat;
+		return CONFIG_VARIABLE_SUCCESS;
+	}
+
+	static int setdouble( void* thisref,const void* value)
+	{
+		
+		((RemoteConfigTestModule*)thisref)->testdouble=*((double*)value);
+		return CONFIG_VARIABLE_SUCCESS;
+	}
+	static int getdouble (void* thisref,void* value)
+	{
+		*((double*)value)=((RemoteConfigTestModule*)thisref)->testdouble;
+		return CONFIG_VARIABLE_SUCCESS;
+	}
+
+	static int setchar( void* thisref,const void* value)
+	{
+		if(((RemoteConfigTestModule*)thisref)->testchar)
+		{
+			delete ((RemoteConfigTestModule*)thisref)->testchar;
+			((RemoteConfigTestModule*)thisref)->testchar=NULL;
+		}
+		int length=strlen(((char*)value));
+		if(length>0)
+		{
+			((RemoteConfigTestModule*)thisref)->testchar=new char[length+1]; //*((int*)value);
+			memset(((RemoteConfigTestModule*)thisref)->testchar,0,length+1);
+			memcpy(((RemoteConfigTestModule*)thisref)->testchar,((char*)value),length);
+			return CONFIG_VARIABLE_SUCCESS;
+		}
+		return CONFIG_VARIABLE_FAILURE;
+	}
+	static int getchar (void* thisref,void* value)
+	{
+		memcpy(value,((RemoteConfigTestModule*)thisref)->testchar,strlen(((RemoteConfigTestModule*)thisref)->testchar));
+		return CONFIG_VARIABLE_SUCCESS;
+	}
+
+	static int setbool( void* thisref,const void* value)
+	{
+		
+		((RemoteConfigTestModule*)thisref)->testbool=*((bool*)value);
+		return CONFIG_VARIABLE_SUCCESS;
+	}
+	static int getbool(void* thisref,void* value)
+	{
+		*((bool*)value)=((RemoteConfigTestModule*)thisref)->testbool;
+		return CONFIG_VARIABLE_SUCCESS;
+	}
 
 };
 
-- 
1.6.2.1


