Skeleton program for Federico's 4YP project.

Dependencies:   WebSocketClient WiflyInterface mbed messages

Fork of IoT_Ex by Damien Frost

Revision:
0:c5607b31fb07
Child:
6:424e225d2a91
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/source/StatusReg.cpp	Tue Oct 04 11:34:47 2016 +0000
@@ -0,0 +1,49 @@
+// ********************
+// * iQ_StatusReg.cpp *
+// ********************
+//
+// Created: 2016/03/24
+// By: Damien Frost
+
+
+#include "StatusReg.h"
+
+StatusReg::StatusReg()
+{
+    _reg = 0;
+    return;
+}
+
+// Set a flag:
+void StatusReg::SetFlag(unsigned int flag){
+    _reg |= flag;
+    return;
+}
+
+// Clear a flag:
+void StatusReg::ClearFlag(unsigned int flag){
+    _reg &= (~flag);
+    return;
+}
+
+// Check for flag
+bool StatusReg::CheckFlag(unsigned int flag){
+    if((_reg & flag) > 0){
+        return true;
+    }else{
+        return false;
+    }
+}
+
+// Check for no flags
+bool StatusReg::AllClear(void){
+    if(_reg == 0){
+        return true;
+    }else{
+        return false;
+    }
+}
+
+unsigned int StatusReg::GetReg(void){
+    return _reg;
+}