library to modify and read program variable in runtime from a serial console. You can reset as well the mbed from the console without pushing buttons. Handy for debugging from the online compiler as you can change the behavior of the program without need to recompile each time.

Revision:
0:85afbf3c9fad
Child:
2:a59207652720
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VarStore.h	Mon Aug 25 08:43:23 2014 +0000
@@ -0,0 +1,77 @@
+#ifndef VARSTORE_H
+#define VARSTORE_H
+
+#include "mbed.h"
+#include "VarItems.h"
+
+
+#define SZ 10
+
+class VarStore
+{
+public:
+/*******************************
+*
+*Constructor
+********************************/
+
+    VarStore(Serial *ser);
+/*******************************
+*
+*Destructor
+********************************/
+
+    virtual ~VarStore();
+/*******************************
+*
+*asigna valor a una variable/array o retorna ERR
+********************************/
+
+    int Set(char *Input);
+
+/*******************************
+* 
+*devuelve en un string el contenido de una variable
+********************************/
+
+    char*  Get(char *Name);
+
+/*******************************
+*carga en el store una variable
+*
+********************************/
+
+    int Load(char *Name, void *VarPtr,VarTypes VarType );
+    
+/*******************************
+*
+*carga en el store una variable/array
+********************************/
+
+    int Load(char *Name, void *VarPtr,VarTypes VarType, int Size );
+
+/*******************************
+* Proceso que less del un serial para modificar
+* los valores de las variables.
+*
+********************************/
+
+static    void Worker(void const *args);
+
+
+protected:
+private:
+/*******************************
+* Busca una variable con nombre name.
+*
+********************************/
+
+    VarItem *GetVar(char *name);
+
+    VarItem Store[SZ];
+    int VarCounter;
+    Serial *pc;
+
+};
+
+#endif // VARSTORE_H