SWUpdate library to be used with RPC.
Fork of SWUpdate by
SWUpdate.h@2:ef2ac9627546, 2014-06-14 (annotated)
- Committer:
- WiredHome
- Date:
- Sat Jun 14 16:15:30 2014 +0000
- Revision:
- 2:ef2ac9627546
- Parent:
- 1:208de08b1a19
- Child:
- 3:c69fff55fc60
Improve documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WiredHome | 0:e221363f7942 | 1 | |
WiredHome | 0:e221363f7942 | 2 | #include "mbed.h" |
WiredHome | 0:e221363f7942 | 3 | |
WiredHome | 0:e221363f7942 | 4 | #ifndef SWUPDATE_H |
WiredHome | 0:e221363f7942 | 5 | #define SWUPDATE_H |
WiredHome | 0:e221363f7942 | 6 | |
WiredHome | 1:208de08b1a19 | 7 | /// After downloading, the user can choose what happens next. |
WiredHome | 0:e221363f7942 | 8 | typedef enum { |
WiredHome | 0:e221363f7942 | 9 | DEFER_REBOOT, |
WiredHome | 0:e221363f7942 | 10 | AUTO_REBOOT |
WiredHome | 0:e221363f7942 | 11 | } Reboot_T; |
WiredHome | 0:e221363f7942 | 12 | |
WiredHome | 1:208de08b1a19 | 13 | /// This API performs some processing to see if a web server |
WiredHome | 1:208de08b1a19 | 14 | /// has an updated version of software. If it does, then it |
WiredHome | 1:208de08b1a19 | 15 | /// will try to download it. If that succeeds, then it can |
WiredHome | 1:208de08b1a19 | 16 | /// optionally reboot to activate the new software. |
WiredHome | 1:208de08b1a19 | 17 | /// |
WiredHome | 1:208de08b1a19 | 18 | /// @todo check the freshly downloaded sw integrity. Since we have |
WiredHome | 1:208de08b1a19 | 19 | /// to remove the old .bin file before the new one will execute, |
WiredHome | 1:208de08b1a19 | 20 | /// it is in the device' best interest to ensure that new one |
WiredHome | 1:208de08b1a19 | 21 | /// is a good one. |
WiredHome | 1:208de08b1a19 | 22 | /// |
WiredHome | 1:208de08b1a19 | 23 | /// @param url is a pointer to a text string of the url from which to download. |
WiredHome | 1:208de08b1a19 | 24 | /// @param name is the base filename of the binary file. |
WiredHome | 1:208de08b1a19 | 25 | /// @param reboot determines whether to automatically reboot to activate the new bin. |
WiredHome | 2:ef2ac9627546 | 26 | /// @return true if the update succeeded (and the reboot was set to DEFER_REBOOT). |
WiredHome | 1:208de08b1a19 | 27 | /// |
WiredHome | 0:e221363f7942 | 28 | bool SoftwareUpdate(const char *url, const char * name, Reboot_T reboot = DEFER_REBOOT); |
WiredHome | 0:e221363f7942 | 29 | |
WiredHome | 0:e221363f7942 | 30 | #endif // SWUPDATE_H |