Kevin Rhyne / Whiffy

Dependencies:   4DGL-uLCD-SE mbed

src/main.cpp

Committer:
kevinrhyne
Date:
2015-10-20
Revision:
16:491e2336bb95
Parent:
15:469db0f84fd5
Child:
17:4d0e180cde20

File content as of revision 16:491e2336bb95:

#include "mbed.h"
#include "Whiffy.h"
#include "LEDControl.h"
#include "TestSuite.h"
#include <string>
#include "APVectorBuilder.h"


//Test cases for all functions
void test(){
    
    Serial pc(USBTX, USBRX);

    pc.baud(115200);  // set what you want here depending on your terminal program speed
    pc.printf("---TESTING---\r\n");
    
    Whiffy whiffy();
    pc.printf("Whiffy obj created\r\n");
    
    TestSuite tester;
    pc.printf("Tester created\r\n");
    
    pc.printf("VectorBuilder test");
    tester.vectorTest();
    
    pc.printf("START ReporterTest()\r\n");
    tester.ReporterTest();
    pc.printf("END ReporterTest()\r\n");

    tester.LCDTest();
    pc.printf("LCDTest done.\r\n");
    
    tester.LEDTest();
    pc.printf("LEDTest done.\r\n");

    tester.WifiTest();
    pc.printf("WifiTest done.\r\n");

}



int main(){
    Serial pc(USBTX, USBRX);
    pc.baud(115200);
    //Open serial
    //vectortest();
    
    WifiControl wifi;
    
    //wifi.ESPconfig();

    
    string real(wifi.pollAP());
    pc.printf("Access points found: \r\n");
    pc.printf("%s", real.c_str());
    APVectorBuilder apBuilder;
    vector<AccessPoint> swag(apBuilder.build(real));
    pc.printf("\r\n\r\n Access Point information ------------- \r\n\r\n");
    
    for (int i = 0; i < swag.size(); i++){
        pc.printf("\r\nList Element: %s, %d", swag[i].getSSID(), swag[i].getStrength());
    }
    
    

    
    // test();
}