Connect to SSID, get ip by dhcp, ping google.com, display statistics
Dependencies: NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed
Diff: main.cpp
- Revision:
- 4:52e1684bf322
- Parent:
- 3:f38499c4000e
- Child:
- 5:864a193bd778
--- a/main.cpp Thu Oct 03 18:03:05 2013 +0200 +++ b/main.cpp Thu Oct 03 16:06:37 2013 +0000 @@ -149,7 +149,7 @@ uint32_t ip; uint8_t *site = (uint8_t *)"google.com"; printf("Get an IP address of %s \r\n",site); - if (wigo._socket.gethostbyname(site,strlen((const char *)site), &ip)) { + if (wifi._socket.gethostbyname(site,strlen((const char *)site), &ip)) { uint8_t add0 = (ip >> 24); uint8_t add1 = (ip >> 16); uint8_t add2 = (ip >> 8); @@ -160,8 +160,8 @@ } printf("Starting sending ping. \r\n"); - uint32_t reply_count = wigo.ping(ip, 5, 500, 32); + uint32_t reply_count = wifi.ping(ip, 5, 500, 32); printf("Received %d replies. \r\n", reply_count); printf("Ping demo completed. \r\n"); - wigo.disconnect(); + wifi.disconnect(); }