Connected switch with wifi for Project Trenton (weather control switch!). Targets NXP LPC1768 device with WiFly connectivity module.
Dependencies: WiflyInterface mbed nanoservice_client_1_12
Fork of cc3000_simple_socket_demo by
Diff: main.cpp
- Revision:
- 10:09a1dd3fbd3d
- Parent:
- 8:be68e827aa53
- Child:
- 11:991f6c2444e9
--- a/main.cpp Wed Oct 09 19:43:06 2013 +0000 +++ b/main.cpp Thu Oct 10 07:17:17 2013 +0200 @@ -140,30 +140,23 @@ switch (c) { case '0': - if (!user_info.FTC) - { + if (!user_info.FTC) { do_FTC(); wifi._wlan.stop(); + } else { + wifi._wlan.ioctl_set_connection_policy(0, 1, 1); } break; case '1': printf("Attempting SSID Connection. \r\n"); wifi._wlan.ioctl_set_connection_policy(0, 0, 0); - wait(1); - wifi.stop(); - wait(1); - wifi.start(0); connect_to_ssid(SSID); break; case '2': printf("Attempting SSID Connection. \r\n"); wifi._wlan.ioctl_set_connection_policy(0, 0, 0); - wait(1); - wifi.stop(); - wait(1); - wifi.start(0); #ifndef CC3000_TINY_DRIVER connect_to_ssid(SSID, AP_KEY, AP_SECURITY); #else