firmware update from USB stick, does not work properly. If someone can get it work, please inform me.
FirmwareUpdater Class Reference
#include <FirmwareUpdater.h>
Public Member Functions | |
FirmwareUpdater (std::string src_name, std::string dest_name, bool log=false) | |
Create. | |
~FirmwareUpdater () | |
Dispose. | |
const std::string | get_src_name () const |
Get a URL. | |
const std::string | get_dest_name () const |
Get a name. | |
int | exist () |
Checking a new firmware. | |
int | execute () |
Execute update. | |
void | reset () |
Reset system. |
Detailed Description
#include "mbed.h" #include "FirmwareUpdater.h" #include "EthernetNetIf.h" EthernetNetIf eth; FirmwareUpdater fwup("http://mbed.org/media/uploads/shintamainjp/", "firmware", true); // There are 2 files for the firmware. // 1. firmware.txt : firmware version file. // 2. firmware.bin : firmware binary file. int main() { eth.setup(); if (fwup.exist() == 0) { printf("Found a new firmware.\n"); if (fwup.execute() == 0) { printf("Update succeed.\n"); printf("Resetting this system...\n\n\n\n\n"); fwup.reset(); } else { printf("Update failed!\n"); } } }
Definition at line 63 of file FirmwareUpdater.h.
Constructor & Destructor Documentation
FirmwareUpdater | ( | std::string | src_name, |
std::string | dest_name, | ||
bool | log = false |
||
) |
Create.
- Parameters:
-
url URL for firmware. Do not include a target file name. name An application name. Do not include a extention. log True if logging. src_name,: An application name on USB Stick. Do not include a extention. dest_name An application name on MBED. Do not include a extention. log True if logging.
Definition at line 50 of file FirmwareUpdater.cpp.
~FirmwareUpdater | ( | ) |
Dispose.
Definition at line 58 of file FirmwareUpdater.cpp.
Member Function Documentation
int execute | ( | ) |
int exist | ( | ) |
Checking a new firmware.
Compare versions of the software between local storage on mbed and on webserver.
- Returns:
- Return 0 if a new firmware exists.
Definition at line 86 of file FirmwareUpdater.cpp.
const std::string get_dest_name | ( | ) | const |
Get a name.
Get the dest_name.
- Returns:
- name.
- _destname.
Definition at line 75 of file FirmwareUpdater.cpp.
const std::string get_src_name | ( | ) | const |
Get a URL.
Get the source_name.
- Returns:
- URL.
- src_name.
Definition at line 66 of file FirmwareUpdater.cpp.
void reset | ( | ) |
Reset system.
Definition at line 176 of file FirmwareUpdater.cpp.
Generated on Wed Jul 13 2022 17:07:15 by 1.7.2