Christopher Foley
/
ESE519_WIFI_CONTROLLER
a
Fork of ESE519_Lab6_part1_skeleton by
Diff: wifiGETWrapper.cpp
- Revision:
- 9:b8801ba7d7c2
- Parent:
- 7:ca226305d28b
diff -r cc7eb86a4b2f -r b8801ba7d7c2 wifiGETWrapper.cpp --- a/wifiGETWrapper.cpp Wed Oct 24 21:02:19 2018 +0000 +++ b/wifiGETWrapper.cpp Thu Oct 25 02:36:38 2018 +0000 @@ -20,7 +20,7 @@ #define WIFI_SSID "Hydroguy45" #define WIFI_PASSWORD "segfault" -#define PORT 8080 +#define PORT 8081 ESP8266Interface wifi(p13, p14); /*void startHTTPServer(ESP8266Interface * wifi){ @@ -131,13 +131,14 @@ socket.connect(address, 8081); // Send a simple http request - char sbuffer[] = "GET / HTTP/1.1\r\nHost: \r\n\r\n"; - strcat(sbuffer, address); - strcat(sbuffer, ":8081/"); - strcat(sbuffer, argument); + char sbuffer[1024]; //= "GET /?result=1 HTTP/1.1\r\nHost: upenn.pennpacapp.com\r\n\r\n"); + sprintf(sbuffer, "GET /?result=%s HTTP/1.1\r\nHost: %s\r\n\r\n", argument, address); + //strcat(sbuffer, "upenn.pennpacapp.com"); + //strcat(sbuffer, "\r\n\r\n"); + //strcat(sbuffer, address); int scount = socket.send(sbuffer, sizeof sbuffer); printf("sent %d [%.*s]\r\n", scount, strstr(sbuffer, "\r\n")-sbuffer, sbuffer); - + printf("-->%s\r\n", sbuffer); // Recieve a simple http response and print out the response line char rbuffer[1024]; int rcount = socket.recv(rbuffer, sizeof rbuffer); @@ -167,7 +168,8 @@ printf("Gateway: %s\r\n", wifi.get_gateway()); printf("RSSI: %d\r\n\r\n", wifi.get_rssi()); - GET(&wifi, "192.168.8.1", "Testing|testing|1|2|3"); + //GET(&wifi, "upenn.pennpacapp.com", "1"); + //GET(&wifi, "192.168.8.1", "Testing|testing|1|2|3"); } int sendGET(const char * args){ GET(&wifi, "192.168.8.1", args);