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/VarItems.h	Mon Aug 25 08:43:23 2014 +0000
@@ -0,0 +1,38 @@
+#ifndef VARITEMS_H
+#define VARITEMS_H
+#define NULL 0
+#define ERR -1
+
+// #define VARITEMS_DEBUG 1
+
+#define VAR_NAME_LEN 20
+
+enum VarTypes {T_int,T_float};
+
+
+class VarItem
+{
+public:
+    VarItem();
+    virtual ~VarItem();
+
+    void SetVar(VarTypes VT,void* VarPtr);
+    int SetVal(char *Val);
+ //   void  SetVarType(VarTypes VarType);
+    void SetVarArraySize(int Size);
+    void SetVarName(char *Name);
+    char *Dump();
+    char *GetVarName();
+
+protected:
+private:
+
+    char VarName[VAR_NAME_LEN];
+
+    int   *ValInt;
+    float *ValFloat;
+    VarTypes VarType;
+    unsigned int ArraySize;
+};
+
+#endif // VARITEMS_H