The MGC3130 is the world’s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller

Dependencies:   BufferedArray

Dependents:   NucleoMGC3130 i2c_master

Revision:
0:92f17b057d6b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GestICMsg.cpp	Tue Oct 06 22:35:38 2015 +0000
@@ -0,0 +1,62 @@
+#include "GestICMsg.h"
+
+GestICMsg::GestICMsg() {}
+
+GestICMsg::GestICMsg(int size)
+{
+    data = new char[size];
+}
+
+GestICMsg::~GestICMsg()
+{
+    if (data != NULL)
+        delete[] data;
+}
+
+void GestICMsg::reset()
+{
+    position = 0;
+}
+
+void GestICMsg::set(char value)
+{
+    if (position >= 255)
+        return;
+
+    data[position++] = value;
+}
+
+char GestICMsg::get(int index)
+{
+    return data[index];
+}
+
+char * GestICMsg::gets(int index)
+{
+    return &data[index];
+}
+
+int GestICMsg::getPosition()
+{
+    return position;
+}
+
+int GestICMsg::getMsgSize()
+{
+    return data[0];
+}
+
+int GestICMsg::getFlags()
+{
+    return data[1];
+}
+
+int GestICMsg::getSeq()
+{
+    return data[2];
+}
+
+int GestICMsg::getID()
+{
+    return data[3];
+}