factory resets
Dependencies: WiflyInterface mbed
Fork of Wifly_UpdateFirmware by
main.cpp@1:15ea8cdb6a39, 2012-11-24 (annotated)
- Committer:
- samux
- Date:
- Sat Nov 24 17:05:36 2012 +0000
- Revision:
- 1:15ea8cdb6a39
- Parent:
- 0:da9cea9f791c
- Child:
- 2:78b3ac0cd2a7
fixed typo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samux | 0:da9cea9f791c | 1 | // this program updates to the latest firmware a wifly module |
samux | 0:da9cea9f791c | 2 | |
samux | 0:da9cea9f791c | 3 | #include "mbed.h" |
samux | 0:da9cea9f791c | 4 | #include "WiflyInterface.h" |
samux | 0:da9cea9f791c | 5 | |
samux | 1:15ea8cdb6a39 | 6 | WiflyInterface wifly(p9, p10, p30, p29, "mbed", "password", WPA); |
samux | 0:da9cea9f791c | 7 | |
samux | 0:da9cea9f791c | 8 | int main() { |
samux | 0:da9cea9f791c | 9 | wifly.init(); //Use DHCP |
samux | 0:da9cea9f791c | 10 | while(!wifly.connect()); |
samux | 0:da9cea9f791c | 11 | |
samux | 0:da9cea9f791c | 12 | // once connected, send command to update firmware |
samux | 0:da9cea9f791c | 13 | wifly.sendCommand("set ftp address 0\r", "AOK"); |
samux | 0:da9cea9f791c | 14 | wifly.sendCommand("set dns name rn.microchip.com\r", "AOK"); |
samux | 0:da9cea9f791c | 15 | wifly.sendCommand("save\r", "Stor"); |
samux | 0:da9cea9f791c | 16 | wifly.sendCommand("ftp update\r", "FTP OK", NULL, 30000); |
samux | 0:da9cea9f791c | 17 | wifly.sendCommand("factory RESET\r"); |
samux | 0:da9cea9f791c | 18 | wifly.sendCommand("reboot\r"); |
samux | 0:da9cea9f791c | 19 | |
samux | 0:da9cea9f791c | 20 | while(1); |
samux | 0:da9cea9f791c | 21 | } |