Kevin Rhyne / Whiffy

Dependencies:   4DGL-uLCD-SE mbed

Revision:
17:4d0e180cde20
Parent:
13:ef68cbcb4e9a
Child:
18:94536dca963c
diff -r 491e2336bb95 -r 4d0e180cde20 src/Whiffy.cpp
--- a/src/Whiffy.cpp	Tue Oct 20 09:32:35 2015 +0000
+++ b/src/Whiffy.cpp	Tue Oct 20 12:38:02 2015 +0000
@@ -3,12 +3,54 @@
 
 Whiffy::Whiffy() : wifi(), reporter(){
     
+    Serial pc(USBTX, USBRX);
+    pc.baud(115200);
+    pc.printf("\r\nReporter & WifiControl created\r\n");
+    
     
     
 };
 
 void Whiffy::update() {
     
+    Serial pc(USBTX, USBRX);
+    pc.baud(115200);
+    wait(2);
+    pc.printf("\r\n\r\nCreating APVectorBuilder\r\n");
+    wait(2);
+    APVectorBuilder apBuilder;
+    wait(2);
+    while(true) {
+        pc.printf("\r\nGetting AP list\r\n");
+        wait(2);
+        string real(wifi.pollAP()); //Get list of APs
+        wait(2);
+        pc.printf("\r\nVectorizing AP list\r\n");
+        wait(2);
+        vector<AccessPoint> APList(apBuilder.build(real)); //Finish building AP list
+        wait(2);
+        pc.printf("\r\nSending AP list to reporter\r\n");
+        wait(1);
+        pc.printf("5th element: %s\r\n", APList[5].getSSID().c_str());
+        wait(2);
+        reporter.update(APList);
+    }
+    
+    
+    
+    
+
+    //pc.printf("Access points found: \r\n");
+    //pc.printf("%s", real.c_str());
+
+    
+    
+    
+    //pc.printf("\r\n\r\n Access Point information ------------- \r\n\r\n");
+    // Print elements
+    //for (int i = 0; i < APList.size(); i++){
+    //    pc.printf("\r\nList Element: %s, %d", APList[i].getSSID(), APList[i].getStrength());
+    //}
     
 }