factory resets

Dependencies:   WiflyInterface mbed

Fork of Wifly_UpdateFirmware by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
ddollar
Date:
Tue Aug 06 02:21:57 2013 +0000
Parent:
2:78b3ac0cd2a7
Commit message:
factory resets

Changed in this revision

WiflyInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 78b3ac0cd2a7 -r 5f4c91e62eea WiflyInterface.lib
--- a/WiflyInterface.lib	Sat Nov 24 20:16:17 2012 +0000
+++ b/WiflyInterface.lib	Tue Aug 06 02:21:57 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/WiflyInterface/#8e54830d0df7
+http://mbed.org/users/ddollar/code/WiflyInterface/#5c9c3fdd67fb
diff -r 78b3ac0cd2a7 -r 5f4c91e62eea main.cpp
--- a/main.cpp	Sat Nov 24 20:16:17 2012 +0000
+++ b/main.cpp	Tue Aug 06 02:21:57 2013 +0000
@@ -3,25 +3,35 @@
 #include "mbed.h"
 #include "WiflyInterface.h"
 
-WiflyInterface wifly(p9, p10, p30, p29, "mbed", "password", WPA);
+WiflyInterface wifly(p9, p10, p30, p29, "periodic.lab", "", NONE);
 
 int main() {
+    bool success = true;
 
+    printf("wifly init\r\n");
     wifly.init(); //Use DHCP
-    while(!wifly.connect());
+
+    while(!wifly.connect()) {
+        printf("wifly connecting (%s)...\r\n", wifly.getIPAddress());
+    }
     
-    bool success = true;
-    // once connected, send command to update firmware
+    // once connected, send command to update firmware    
+    printf("set ftp address\r\n");
     if (!wifly.sendCommand("set ftp address 0\r", "AOK"))
         success = false;
+    printf("set dns name\r\n");
     if (!wifly.sendCommand("set dns name rn.microchip.com\r", "AOK"))
         success = false;
+    printf("save\r\n");
     if (!wifly.sendCommand("save\r", "Stor"))
         success = false;
-    if (!wifly.sendCommand("ftp update\r", "FTP OK", NULL, 30000))
+    printf("ftp update\r\n");
+    if (!wifly.sendCommand("ftp update \r", "FTP OK", NULL, 30000))
         success = false;
+    printf("factory reset\r\n");
     if (!wifly.sendCommand("factory RESET\r"))
         success = false;
+    printf("reboot\r\n");
     if (!wifly.sendCommand("reboot\r"))
         success = false;