Simple program to update the firmware of a wifly module

Dependencies:   WiflyInterface mbed

Files at this revision

API Documentation at this revision

Comitter:
samux
Date:
Sat Nov 24 17:04:27 2012 +0000
Child:
1:15ea8cdb6a39
Commit message:
program to update the firmware of a wifly module

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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WiflyInterface.lib	Sat Nov 24 17:04:27 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/WiflyInterface/#8e54830d0df7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Nov 24 17:04:27 2012 +0000
@@ -0,0 +1,21 @@
+// this program updates to the latest firmware a wifly module
+
+#include "mbed.h"
+#include "WiflyInterface.h"
+
+WiflyInterface wifly(p9, p10, p30, p29, "8cb19na", "vokeralineaplus", WPA);
+
+int main() {
+    wifly.init(); //Use DHCP
+    while(!wifly.connect());
+    
+    // once connected, send command to update firmware
+    wifly.sendCommand("set ftp address 0\r", "AOK");
+    wifly.sendCommand("set dns name rn.microchip.com\r", "AOK");
+    wifly.sendCommand("save\r", "Stor");
+    wifly.sendCommand("ftp update\r", "FTP OK", NULL, 30000);
+    wifly.sendCommand("factory RESET\r");
+    wifly.sendCommand("reboot\r");
+    
+    while(1);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Nov 24 17:04:27 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/3d775a932e1d
\ No newline at end of file