A simple WIP that logs data from a Grove sensor, and can send and receive information over USB and SMS.

Dependencies:   DHT DS_1337 SDFileSystem USBDevice mbed

Revision:
0:2df78a4443cd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Handlers/AbstractHandler.h	Sun Apr 10 15:47:33 2016 +1000
@@ -0,0 +1,34 @@
+#ifndef __ABSTRACT_HANDLER_H__
+#define __ABSTRACT_HANDLER_H__
+
+#include "../timers.h"
+
+/*!
+ * \brief The AbstractHandler class is inherited by all handlers. It forms the basis of any handler, by having
+ * a simple \a run function, called in main.cpp, and a \a setRequest function which is used to set a request
+ * specific to the reimplemented class.
+ */
+class AbstractHandler
+{
+public:
+    AbstractHandler(MyTimers *_timer) : m_timer(_timer) {}
+    ~AbstractHandler() {}
+
+    /*!
+     * \brief run is inherited by each Handler class. It is called from the main while loop in main.cpp.
+     * It runs through the state machine, specific to each Handler class.
+     */
+    virtual void run() = 0; // run the handler
+
+    /*!
+     * \brief setRequest sets a request that the handler will complete when it is able to
+     * \param request unique to the reimplemented class (an enum) that will be completed in the state machine
+     * \param message an optional array of information relevant to the \a request
+     */
+    virtual void setRequest(int request, void *data = 0) = 0;
+
+protected:
+    MyTimers *m_timer;  ///< Handler classes use timers to pause in the state machine, and continue after delay has finished
+};
+
+#endif // __ABSTRACT_HANDLER_H__