Software Update via Ethernet - the mbed application can pull down an updated application binary from a web server and activate that binary. This library works only with the LPC1768, as it relies on the magic-chip boot-loader mechanism.

Dependents:   WattEye X10Svr PUB_SWUpdate

Success!! With this library, a network connection, and a web server hosting a new binary image, you can update the mbed firmware over the air (FOTA) - well, at least via Ethernet so far.

As of March 2015, it has been tested with the following mbed official libraries:

And a custom derivation:

  • HTTPClient v33, v32, which includes a custom HTTPFile.

Part of the update process involves checking the integrity of the downloaded binary file, for both a checksum and the program (file) size. To create this additional information, a small perl script is used (the important part is only 20 lines of code). See the documentation in the header file.

After the new binary is successfully downloaded, the checksum and the size are evaluated and if correct, then the old binary file is removed (this is the only way to cause the new binary to activate).

The mbed can then be automatically reset to activate the new image, or this may be deferred in case there is some other process necessary for an orderly restart.

Details are in the SWUpdate header file, and PUB_SWUpdate is a publicly accessible demonstration program for this library.

Committer:
WiredHome
Date:
Sun Jul 14 01:40:36 2019 +0000
Revision:
27:3d3089b8212d
Parent:
26:f2bb6061dcb3
Child:
29:f67a7f54c173
Clarify in return codes if the specified file does not exist.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:e221363f7942 1
WiredHome 17:1d318666246c 2 // Software Update via Ethernet from forum -
WiredHome 0:e221363f7942 3 // http://mbed.org/forum/mbed/topic/1183/
WiredHome 1:208de08b1a19 4 //
WiredHome 0:e221363f7942 5 #include "mbed.h"
WiredHome 0:e221363f7942 6 #include "SWUpdate.h"
WiredHome 0:e221363f7942 7 #include "HTTPFile.h"
WiredHome 0:e221363f7942 8 #include <stdio.h>
WiredHome 0:e221363f7942 9
WiredHome 0:e221363f7942 10 extern "C" void mbed_reset();
WiredHome 0:e221363f7942 11
WiredHome 15:49cc43dcbbf6 12 //#define DEBUG "SWup"
WiredHome 0:e221363f7942 13 #include <cstdio>
WiredHome 0:e221363f7942 14 #if (defined(DEBUG) && !defined(TARGET_LPC11U24))
WiredHome 0:e221363f7942 15 #define DBG(x, ...) std::printf("[DBG %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
WiredHome 0:e221363f7942 16 #define WARN(x, ...) std::printf("[WRN %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
WiredHome 0:e221363f7942 17 #define ERR(x, ...) std::printf("[ERR %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
WiredHome 0:e221363f7942 18 #define INFO(x, ...) std::printf("[INF %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
WiredHome 0:e221363f7942 19 #else
WiredHome 0:e221363f7942 20 #define DBG(x, ...)
WiredHome 0:e221363f7942 21 #define WARN(x, ...)
WiredHome 0:e221363f7942 22 #define ERR(x, ...)
WiredHome 0:e221363f7942 23 #define INFO(x, ...)
WiredHome 0:e221363f7942 24 #endif
WiredHome 0:e221363f7942 25
WiredHome 17:1d318666246c 26 static HTTPResult HTTPErrorCode;
WiredHome 17:1d318666246c 27
WiredHome 19:169aab9047bd 28 typedef enum {
WiredHome 19:169aab9047bd 29 ok,
WiredHome 19:169aab9047bd 30 no_file,
WiredHome 19:169aab9047bd 31 bad_crc
WiredHome 19:169aab9047bd 32 } Integrity_t;
WiredHome 19:169aab9047bd 33
WiredHome 24:e400edb8d2ee 34
WiredHome 24:e400edb8d2ee 35 const char * SWErrorMsg[] = {
WiredHome 24:e400edb8d2ee 36 "OK", // SWUP_OK = 0x00, ///< Software Update succeeded as planned.
WiredHome 24:e400edb8d2ee 37 "Same version", // SWUP_SAME_VER = 0x01, ///< Online version is the same as the installed version.
WiredHome 24:e400edb8d2ee 38 "Get bin error", // SWUP_HTTP_BIN = 0x02, ///< HTTP get returned an error while trying to fetch the bin file.
WiredHome 27:3d3089b8212d 39 "Old file stuck", // SWUP_OLD_STUCK = 0x03, ///< Old file could not be removed.
WiredHome 27:3d3089b8212d 40 "Old vers stuck", // SWUP_VER_STUCK = 0x04, ///< Old version number could not be updated.
WiredHome 27:3d3089b8212d 41 "Ver write fail", // SWUP_VWRITE_FAILED = 0x05, ///< Can't open for write the version tracking file.
WiredHome 27:3d3089b8212d 42 "Integrity fail", // SWUP_INTEGRITY_FAILED = 0x06, ///< Integrity check of downloaded file failed.
WiredHome 27:3d3089b8212d 43 "Get ver fail", // SWUP_HTTP_VER = 0x07, ///< HTTP get returned an error while trying to fetch the version file.
WiredHome 27:3d3089b8212d 44 "Filesys full", // SWUP_NO_SPACE = 0x08, ///< No space on file system for new version.
WiredHome 27:3d3089b8212d 45 "Does not exist", // SWUP_NO_FILE = 0x09, ///< Specified file does not exist
WiredHome 24:e400edb8d2ee 46 };
WiredHome 24:e400edb8d2ee 47
WiredHome 27:3d3089b8212d 48 const char * SoftwareUpdateGetHTTPErrorMsg(SWUpdate_T r)
WiredHome 24:e400edb8d2ee 49 {
WiredHome 24:e400edb8d2ee 50 const char * p = "invalid result code";
WiredHome 27:3d3089b8212d 51 if (r <= SWUP_NO_FILE)
WiredHome 24:e400edb8d2ee 52 p = SWErrorMsg[r];
WiredHome 24:e400edb8d2ee 53 return p;
WiredHome 24:e400edb8d2ee 54 }
WiredHome 24:e400edb8d2ee 55
WiredHome 24:e400edb8d2ee 56 HTTPResult SoftwareUpdateGetHTTPErrorCode(void)
WiredHome 24:e400edb8d2ee 57 {
WiredHome 24:e400edb8d2ee 58 return HTTPErrorCode;
WiredHome 24:e400edb8d2ee 59 }
WiredHome 24:e400edb8d2ee 60
WiredHome 24:e400edb8d2ee 61
WiredHome 19:169aab9047bd 62 static Integrity_t PassesIntegrityCheck(const char * fname, int cksum, int fsize)
WiredHome 17:1d318666246c 63 {
WiredHome 19:169aab9047bd 64 Integrity_t res = bad_crc; // assume things go wrong...
WiredHome 3:c69fff55fc60 65 int newCksum = 0;
WiredHome 3:c69fff55fc60 66 int newFSize = 0;
WiredHome 3:c69fff55fc60 67 FILE *fh = fopen(fname, "rb");
WiredHome 17:1d318666246c 68
WiredHome 3:c69fff55fc60 69 INFO("IntegrityCheck(%s,%d,%d)", fname, cksum, fsize);
WiredHome 3:c69fff55fc60 70 if (fh) {
WiredHome 3:c69fff55fc60 71 char buf;
WiredHome 3:c69fff55fc60 72 while (fread(&buf, 1, 1, fh)) {
WiredHome 3:c69fff55fc60 73 newCksum = (newCksum + buf) & 0xFFFF;
WiredHome 3:c69fff55fc60 74 newFSize++;
WiredHome 3:c69fff55fc60 75 }
WiredHome 3:c69fff55fc60 76 fclose(fh);
WiredHome 3:c69fff55fc60 77 INFO(" Check(...,%d,%d)", newCksum, newFSize);
WiredHome 3:c69fff55fc60 78 if (newCksum == cksum && newFSize == fsize)
WiredHome 19:169aab9047bd 79 res = ok;
WiredHome 3:c69fff55fc60 80 } else {
WiredHome 3:c69fff55fc60 81 WARN("failed to open %s.", fname);
WiredHome 19:169aab9047bd 82 res = no_file;
WiredHome 3:c69fff55fc60 83 }
WiredHome 3:c69fff55fc60 84 return res;
WiredHome 1:208de08b1a19 85 }
WiredHome 1:208de08b1a19 86
WiredHome 9:73067ef14c30 87 /// mytolower exists because not all compiler libraries have this function
WiredHome 9:73067ef14c30 88 ///
WiredHome 9:73067ef14c30 89 /// This takes a character and if it is upper-case, it converts it to
WiredHome 9:73067ef14c30 90 /// lower-case and returns it.
WiredHome 9:73067ef14c30 91 ///
WiredHome 17:1d318666246c 92 /// @note this only works for characters in the range 'A' - 'Z'.
WiredHome 17:1d318666246c 93 ///
WiredHome 18:5f7667d63a27 94 /// a is the character to convert
WiredHome 18:5f7667d63a27 95 /// returns the lower case equivalent to the supplied character.
WiredHome 9:73067ef14c30 96 ///
WiredHome 17:1d318666246c 97 static char mytolower(char a)
WiredHome 17:1d318666246c 98 {
WiredHome 9:73067ef14c30 99 if (a >= 'A' && a <= 'Z')
WiredHome 9:73067ef14c30 100 return (a - 'A' + 'a');
WiredHome 9:73067ef14c30 101 else
WiredHome 9:73067ef14c30 102 return a;
WiredHome 9:73067ef14c30 103 }
WiredHome 9:73067ef14c30 104
WiredHome 9:73067ef14c30 105 /// mystrnicmp exists because not all compiler libraries have this function.
WiredHome 9:73067ef14c30 106 ///
WiredHome 9:73067ef14c30 107 /// Some have strnicmp, others _strnicmp, and others have C++ methods, which
WiredHome 9:73067ef14c30 108 /// is outside the scope of this C-portable set of functions.
WiredHome 9:73067ef14c30 109 ///
WiredHome 18:5f7667d63a27 110 /// l is a pointer to the string on the left
WiredHome 18:5f7667d63a27 111 /// r is a pointer to the string on the right
WiredHome 18:5f7667d63a27 112 /// n is the number of characters to compare
WiredHome 18:5f7667d63a27 113 /// returns -1 if l < r
WiredHome 18:5f7667d63a27 114 /// returns 0 if l == r
WiredHome 18:5f7667d63a27 115 /// returns +1 if l > r
WiredHome 9:73067ef14c30 116 ///
WiredHome 17:1d318666246c 117 static int mystrnicmp(const char *l, const char *r, size_t n)
WiredHome 17:1d318666246c 118 {
WiredHome 9:73067ef14c30 119 int result = 0;
WiredHome 9:73067ef14c30 120
WiredHome 9:73067ef14c30 121 if (n != 0) {
WiredHome 9:73067ef14c30 122 do {
WiredHome 9:73067ef14c30 123 result = mytolower(*l++) - mytolower(*r++);
WiredHome 9:73067ef14c30 124 } while ((result == 0) && (*l != '\0') && (--n > 0));
WiredHome 9:73067ef14c30 125 }
WiredHome 9:73067ef14c30 126 if (result < -1)
WiredHome 9:73067ef14c30 127 result = -1;
WiredHome 9:73067ef14c30 128 else if (result > 1)
WiredHome 9:73067ef14c30 129 result = 1;
WiredHome 9:73067ef14c30 130 return result;
WiredHome 9:73067ef14c30 131 }
WiredHome 9:73067ef14c30 132
WiredHome 9:73067ef14c30 133
WiredHome 17:1d318666246c 134 // Scan the local file system for any .bin files and
WiredHome 9:73067ef14c30 135 // if they don't match the current one, remove them.
WiredHome 9:73067ef14c30 136 //
WiredHome 9:73067ef14c30 137 static bool RemoveOtherBinFiles(const char * name, int ver)
WiredHome 9:73067ef14c30 138 {
WiredHome 9:73067ef14c30 139 char curbin[SW_MAX_FQFN];
WiredHome 9:73067ef14c30 140 DIR *d;
WiredHome 9:73067ef14c30 141 struct dirent *p;
WiredHome 9:73067ef14c30 142 bool noFailed = true;
WiredHome 17:1d318666246c 143
WiredHome 17:1d318666246c 144 snprintf(curbin, SW_MAX_FQFN, "%s%02d.bin", name, (ver % 100));
WiredHome 9:73067ef14c30 145 INFO("Remove bin files excluding {%s}", curbin);
WiredHome 9:73067ef14c30 146 d = opendir("/local/");
WiredHome 9:73067ef14c30 147 // Get a directory handle
WiredHome 9:73067ef14c30 148 if ( d != NULL ) {
WiredHome 9:73067ef14c30 149 // Walk the directory
WiredHome 9:73067ef14c30 150 while ( (p = readdir(d)) != NULL ) {
WiredHome 9:73067ef14c30 151 INFO(" check {%s}", p->d_name);
WiredHome 9:73067ef14c30 152 // if the file is .bin and not curbin
WiredHome 9:73067ef14c30 153 if (0 == mystrnicmp(p->d_name + strlen(p->d_name) - 4, ".bin", 4)
WiredHome 17:1d318666246c 154 && (0 != mystrnicmp(p->d_name, curbin, strlen(curbin)))) {
WiredHome 9:73067ef14c30 155 // remove the file
WiredHome 9:73067ef14c30 156 char toremove[SW_MAX_FQFN];
WiredHome 9:73067ef14c30 157 snprintf(toremove, SW_MAX_FQFN, "/local/%s", p->d_name);
WiredHome 9:73067ef14c30 158 INFO(" removing %s.", toremove);
WiredHome 9:73067ef14c30 159 if (remove(toremove)) {
WiredHome 9:73067ef14c30 160 // set flag if it could not be removed
WiredHome 9:73067ef14c30 161 noFailed = false;
WiredHome 9:73067ef14c30 162 }
WiredHome 9:73067ef14c30 163 }
WiredHome 9:73067ef14c30 164 }
WiredHome 9:73067ef14c30 165 closedir(d);
WiredHome 9:73067ef14c30 166 }
WiredHome 9:73067ef14c30 167 return noFailed;
WiredHome 9:73067ef14c30 168 }
WiredHome 9:73067ef14c30 169
WiredHome 26:f2bb6061dcb3 170
WiredHome 26:f2bb6061dcb3 171 int GetSoftwareVersionNumber(const char * name)
WiredHome 17:1d318666246c 172 {
WiredHome 26:f2bb6061dcb3 173 char nameroot[7];
WiredHome 9:73067ef14c30 174 char verfn[SW_MAX_FQFN]; // local version file
WiredHome 26:f2bb6061dcb3 175
WiredHome 16:de99e872fc9d 176 strncpy(nameroot, name, 6);
WiredHome 16:de99e872fc9d 177 nameroot[6] = '\0';
WiredHome 16:de99e872fc9d 178 snprintf(verfn, SW_MAX_FQFN, "/local/%s.ver", nameroot);
WiredHome 0:e221363f7942 179
WiredHome 0:e221363f7942 180 /* Read installed version string */
WiredHome 0:e221363f7942 181 int inst_ver = -1;
WiredHome 0:e221363f7942 182 FILE *fv = fopen(verfn, "r");
WiredHome 0:e221363f7942 183 if (fv) {
WiredHome 0:e221363f7942 184 fscanf(fv, "%d", &inst_ver);
WiredHome 0:e221363f7942 185 fclose(fv);
WiredHome 26:f2bb6061dcb3 186 } else {
WiredHome 26:f2bb6061dcb3 187 inst_ver = -1;
WiredHome 0:e221363f7942 188 }
WiredHome 0:e221363f7942 189 INFO(" Installed version: %d", inst_ver);
WiredHome 26:f2bb6061dcb3 190 return inst_ver;
WiredHome 26:f2bb6061dcb3 191 }
WiredHome 17:1d318666246c 192
WiredHome 26:f2bb6061dcb3 193 bool SetSoftwareVersionNumber(const char * name, int ver, int cksum, int filesize)
WiredHome 26:f2bb6061dcb3 194 {
WiredHome 26:f2bb6061dcb3 195 char nameroot[7];
WiredHome 26:f2bb6061dcb3 196 char verfn[SW_MAX_FQFN]; // local version file
WiredHome 26:f2bb6061dcb3 197 char buf[40];
WiredHome 26:f2bb6061dcb3 198
WiredHome 26:f2bb6061dcb3 199 strncpy(nameroot, name, 6);
WiredHome 26:f2bb6061dcb3 200 nameroot[6] = '\0';
WiredHome 26:f2bb6061dcb3 201 snprintf(verfn, SW_MAX_FQFN, "/local/%s.ver", nameroot);
WiredHome 26:f2bb6061dcb3 202 snprintf(buf, 40, "%d,%d,%d", ver, cksum, filesize);
WiredHome 26:f2bb6061dcb3 203 FILE *fv = fopen(verfn, "w");
WiredHome 26:f2bb6061dcb3 204 if (fv) {
WiredHome 26:f2bb6061dcb3 205 int fr = fputs(buf, fv);
WiredHome 26:f2bb6061dcb3 206 fclose( fv );
WiredHome 26:f2bb6061dcb3 207 if (fr >= 0) {
WiredHome 26:f2bb6061dcb3 208 return true;
WiredHome 26:f2bb6061dcb3 209 } else {
WiredHome 26:f2bb6061dcb3 210 ERR("Failed (%d) to update stored version number.", fr);
WiredHome 26:f2bb6061dcb3 211 }
WiredHome 26:f2bb6061dcb3 212 } else {
WiredHome 26:f2bb6061dcb3 213 WARN("Failed to update local version info in %s.", verfn);
WiredHome 26:f2bb6061dcb3 214 }
WiredHome 26:f2bb6061dcb3 215 return false;
WiredHome 26:f2bb6061dcb3 216 }
WiredHome 26:f2bb6061dcb3 217
WiredHome 26:f2bb6061dcb3 218 SWUpdate_T SoftwareUpdate(const char *url, const char * name, Reboot_T action)
WiredHome 26:f2bb6061dcb3 219 {
WiredHome 26:f2bb6061dcb3 220 HTTPClient http;
WiredHome 26:f2bb6061dcb3 221 //http.setTimeout( 15000 );
WiredHome 26:f2bb6061dcb3 222 char fqurl[SW_MAX_URL]; // fully qualified url
WiredHome 26:f2bb6061dcb3 223 char fwfn[SW_MAX_FQFN];
WiredHome 26:f2bb6061dcb3 224 char nameroot[7];
WiredHome 27:3d3089b8212d 225 SWUpdate_T result = SWUP_OK; // starting out quite optimistic, for all the things that can go wrong
WiredHome 26:f2bb6061dcb3 226 char buf[50]; // long enough for 3 comma separated numbers...
WiredHome 26:f2bb6061dcb3 227
WiredHome 26:f2bb6061dcb3 228 INFO("SoftwareUpdate(%s , %s)", url, name);
WiredHome 26:f2bb6061dcb3 229 strncpy(nameroot, name, 6);
WiredHome 26:f2bb6061dcb3 230 nameroot[6] = '\0';
WiredHome 26:f2bb6061dcb3 231 int inst_ver = GetSoftwareVersionNumber(name);
WiredHome 0:e221363f7942 232 /* Download latest version string */
WiredHome 21:253e7da56ff9 233 //HTTPText server_ver("test message");
WiredHome 9:73067ef14c30 234 snprintf(fqurl, SW_MAX_URL, "%s/%s.txt", url, name);
WiredHome 23:cfe84db2b2cb 235 INFO("Query %s", fqurl);
WiredHome 17:1d318666246c 236 HTTPErrorCode = http.get(fqurl, buf, sizeof(buf));
WiredHome 17:1d318666246c 237 if (HTTPErrorCode == HTTP_OK) {
WiredHome 0:e221363f7942 238 int latest_ver = -1;
WiredHome 3:c69fff55fc60 239 int cksum = 0;
WiredHome 3:c69fff55fc60 240 int fsize = 0;
WiredHome 3:c69fff55fc60 241 int parseCount;
WiredHome 3:c69fff55fc60 242 parseCount = sscanf(buf, "%d,%d,%d", &latest_ver, &cksum, &fsize);
WiredHome 3:c69fff55fc60 243 if (parseCount == 3) {
WiredHome 9:73067ef14c30 244 INFO(" web version: %d", latest_ver);
WiredHome 9:73067ef14c30 245 INFO(" checksum: %d", cksum);
WiredHome 9:73067ef14c30 246 INFO(" file size: %d", fsize);
WiredHome 3:c69fff55fc60 247 if (inst_ver != latest_ver) {
WiredHome 3:c69fff55fc60 248 INFO(" Downloading firmware ver %d ...", latest_ver);
WiredHome 22:2a010efe00da 249 snprintf(fwfn, SW_MAX_FQFN, "/local/%s%02d.BIN", nameroot, (latest_ver % 100));
WiredHome 22:2a010efe00da 250 snprintf(fqurl, SW_MAX_URL, "%s/%s.bin", url, name);
WiredHome 17:1d318666246c 251
WiredHome 3:c69fff55fc60 252 HTTPFile latest(fwfn);
WiredHome 23:cfe84db2b2cb 253 INFO("Fetch %s", fqurl);
WiredHome 17:1d318666246c 254 HTTPErrorCode = http.get(fqurl, &latest);
WiredHome 17:1d318666246c 255 if (HTTPErrorCode == HTTP_OK) {
WiredHome 19:169aab9047bd 256 Integrity_t t = PassesIntegrityCheck(fwfn, cksum, fsize);
WiredHome 19:169aab9047bd 257 if (t == no_file) {
WiredHome 19:169aab9047bd 258 ERR(" *** No space on file system. ***");
WiredHome 27:3d3089b8212d 259 result = SWUP_NO_SPACE;
WiredHome 19:169aab9047bd 260 } else if (t == ok) {
WiredHome 16:de99e872fc9d 261 if (!RemoveOtherBinFiles(nameroot, latest_ver)) {
WiredHome 9:73067ef14c30 262 ERR(" *** Failed to remove old version(s). ***");
WiredHome 27:3d3089b8212d 263 result = SWUP_OLD_STUCK;
WiredHome 3:c69fff55fc60 264 }
WiredHome 3:c69fff55fc60 265 INFO("Updating stored version number.");
WiredHome 26:f2bb6061dcb3 266 if (SetSoftwareVersionNumber(name, latest_ver, cksum, fsize)) {
WiredHome 26:f2bb6061dcb3 267 // ok
WiredHome 26:f2bb6061dcb3 268 if (action == AUTO_REBOOT) {
WiredHome 26:f2bb6061dcb3 269 WARN("Resetting...\n");
WiredHome 26:f2bb6061dcb3 270 wait_ms(200);
WiredHome 26:f2bb6061dcb3 271 mbed_reset();
WiredHome 3:c69fff55fc60 272 }
WiredHome 1:208de08b1a19 273 } else {
WiredHome 26:f2bb6061dcb3 274 // failed
WiredHome 26:f2bb6061dcb3 275 ERR("Failed to update stored version number.");
WiredHome 27:3d3089b8212d 276 result = SWUP_VWRITE_FAILED;
WiredHome 1:208de08b1a19 277 }
WiredHome 19:169aab9047bd 278 } else /* t == bad_crc */ {
WiredHome 3:c69fff55fc60 279 WARN("New file {%s} did not pass integrity check.", fwfn);
WiredHome 27:3d3089b8212d 280 result = SWUP_INTEGRITY_FAILED;
WiredHome 0:e221363f7942 281 }
WiredHome 1:208de08b1a19 282 } else {
WiredHome 3:c69fff55fc60 283 WARN("Failed to download lastest firmware.");
WiredHome 27:3d3089b8212d 284 result = SWUP_HTTP_BIN;
WiredHome 0:e221363f7942 285 }
WiredHome 0:e221363f7942 286 } else {
WiredHome 9:73067ef14c30 287 INFO("Online version is same as installed version.");
WiredHome 27:3d3089b8212d 288 result = SWUP_SAME_VER;
WiredHome 0:e221363f7942 289 }
WiredHome 0:e221363f7942 290 }
WiredHome 0:e221363f7942 291 } else {
WiredHome 27:3d3089b8212d 292 int ec = http.getHTTPResponseCode();
WiredHome 22:2a010efe00da 293 WARN("Failed accessing {%s}. Extended Error Code = %d", fqurl, HTTPErrorCode);
WiredHome 27:3d3089b8212d 294 WARN(" HTTP Response Code %d", ec);
WiredHome 27:3d3089b8212d 295 if (ec == 404)
WiredHome 27:3d3089b8212d 296 result = SWUP_NO_FILE;
WiredHome 27:3d3089b8212d 297 else
WiredHome 27:3d3089b8212d 298 result = SWUP_HTTP_VER;
WiredHome 0:e221363f7942 299 }
WiredHome 27:3d3089b8212d 300 return result;
WiredHome 0:e221363f7942 301 }