Proj 324 Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Revision:
22:eb4cc12087b2
Parent:
21:3c078c799caa
Child:
23:3c85d7f657a2
--- a/main.cpp	Fri Dec 29 21:21:46 2017 +0000
+++ b/main.cpp	Fri Dec 29 21:46:49 2017 +0000
@@ -26,8 +26,7 @@
 #define EDGE_RISEN 1
 #define EDGE_FALLEN 0
 #define mailsize 5
-
-
+#include <iostream>
 Serial pc(USBTX, USBRX);
 //SW1+SW2 are declared as interrupt ins in sample hardware.cpp
 
@@ -73,6 +72,10 @@
 void SW1FallingEdge();
 void SW1TimeOutHandler();
 
+
+
+using namespace std;
+
 int mode = 0;
 
 Mail<DATA, mailsize> mail_box;       //Mail Queue, Type DATA, Capacity mailsize(defined above), name mail_box
@@ -187,9 +190,65 @@
         }
     }
 }
-
+void Serial_Commands()
+{
+    string Serial_Input;
+    while(1)
+    {   
+        cout << "Please type in a command" << endl;
+       
+        cin >> Serial_Input;
+        
+        if (Serial_Input == "Test")
+        {
+            
+        }
+        else if(Serial_Input == "READ ALL")
+        {
+        
+        }
+        else if(Serial_Input == "DELETE ALL")
+        {
+        
+        }
+        else if(Serial_Input == "READ <n>")
+        {
+        
+        }
+        else if(Serial_Input == "DELETE <n>")
+        {
+        
+        }
+        else if(Serial_Input == "SETDATE <dd> <mm> <yyyy>")
+        {
+        
+        }
+        else if(Serial_Input == "SETT <T>")
+        {
+        
+        }
+        else if(Serial_Input == "STATE <x>")
+        {
+        
+        }
+        else if(Serial_Input == "LOGGING <x>")
+        {
+        
+        }
+        else if(Serial_Input == "HELP")// Use this to display all of the availble commands   
+        {
+            cout << "Avalible Commands are: "<< endl;
+            cout << "READ ALL , DELETE ALL READ<n> ,DELETE<n> , SETDATE<dd> <mm> <yyyy> , SETTIME <hh> <mm> <ss>, SETT <T> , STATE <x>, LOGGING <x>, HELP"<< endl;
+        }    
+        else
+        {
+            cout << "Please enter a acceptable command" << endl;    
+        }
+    }
+}
 void Serial_Comms()//Thread for Serial Communications
 {
+    cout << "In Serial Comms" << endl;
     while(1)
     {
         osEvent evt_serial = mail_box.get();                                   //Get the latest entry from "mail_box"
@@ -258,6 +317,7 @@
 } 
 int main() 
 {  
+    
 
     
     //Greeting