The FirmwareUpdater is a mbed firmware update library with HTTP server on cloud.

Dependents:   FirmwareUpdater_TestProgram geigercounter04 firm LPC1768_up_frim

Embed: (wiki syntax)

« Back to documentation index

FirmwareUpdater Class Reference

FirmwareUpdater Class Reference

#include <FirmwareUpdater.h>

Public Member Functions

 FirmwareUpdater (std::string url, std::string name, bool log=false)
 ~FirmwareUpdater ()
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("", "firm", true);

 // There are 2 files for the firmware.
 //  1. firm.txt : firmware version file.
 //  2. firm.bin : firmware binary file.

 int main() {
     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");
         } 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 


urlURL for firmware. Do not include a target file name.
nameAn application name. Do not include a extention.
logTrue if logging.

Definition at line 46 of file FirmwareUpdater.cpp.


Definition at line 62 of file FirmwareUpdater.cpp.

Member Function Documentation

int execute (  )

Execute update.

Return 0 if it succeed.

Definition at line 118 of file FirmwareUpdater.cpp.

int exist (  )

Checking a new firmware.

Compare versions of the software between local storage on mbed and on webserver.

Return 0 if a new firmware exists.

Definition at line 89 of file FirmwareUpdater.cpp.

const std::string getName (  ) const

Get a name.


Definition at line 79 of file FirmwareUpdater.cpp.

const std::string getURL (  ) const

Get a URL.


Definition at line 70 of file FirmwareUpdater.cpp.

void reset (  )

Reset system.

Definition at line 194 of file FirmwareUpdater.cpp.