PES 4 - Smart Medication Dispenser / PES4_ProgrammeforDesignReview2

Dependencies:   SDFileSystem mbed

Fork of PES4_Programme by PES 4 - Smart Medication Dispenser

Revision:
91:443b0ac21de0
Parent:
87:a0b824c35b1b
Parent:
90:d0805b58b0ae
Child:
92:96ad0a9ff337
--- a/source/main.cpp	Mon Apr 09 15:55:03 2018 +0000
+++ b/source/main.cpp	Tue Apr 10 06:58:41 2018 +0000
@@ -91,8 +91,21 @@
                 printf("Hello World");
                 state = 47;
                 break;
+                
             case 1:
+                char command;
+                if(pc.readable()) {
+                    command = pc.getc();
+                } else if(command == 'w') {
+                    if(pc.writeable()) {
+                        printf("%s", send);
+                    }
+                } else {
+                    state = 47;
+                }
+
                 break;
+
             case 2:
                 break;
             case 3:
@@ -437,6 +450,14 @@
 
                 break;
 
+            case 68:
+                printf("read_Inventory\n\r");
+                send = read_Inventory();
+                printf("%s", send);
+                state = 47;
+
+                break;
+
             default:
                 state = 47; /* Go to State Switch */
                 break;