The FirmwareUpdater is a mbed firmware update library with HTTP server on cloud.
Dependents: FirmwareUpdater_TestProgram geigercounter04 firm LPC1768_up_frim
FirmwareUpdater Class Reference
#include <FirmwareUpdater.h>
Public Member Functions | |
FirmwareUpdater (std::string url, std::string name, bool log=false) | |
Create. | |
~FirmwareUpdater () | |
Dispose. | |
const std::string | getURL () const |
Get a URL. | |
const std::string | getName () 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/", "firm", true); // There are 2 files for the firmware. // 1. firm.txt : firmware version file. // 2. firm.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 | url, |
std::string | 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.
Definition at line 46 of file FirmwareUpdater.cpp.
~FirmwareUpdater | ( | ) |
Dispose.
Definition at line 62 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 89 of file FirmwareUpdater.cpp.
const std::string getName | ( | ) | const |
const std::string getURL | ( | ) | const |
void reset | ( | ) |
Reset system.
Definition at line 194 of file FirmwareUpdater.cpp.
Generated on Wed Jul 13 2022 06:52:56 by
