Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
firmware/web-firmware-ajax.c@103:91194cc19bbb, 2019-04-27 (annotated)
- Committer:
- andrewboyson
- Date:
- Sat Apr 27 09:25:28 2019 +0000
- Revision:
- 103:91194cc19bbb
Renamed everything from Http to Web
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 103:91194cc19bbb | 1 | #include <stdio.h> |
andrewboyson | 103:91194cc19bbb | 2 | |
andrewboyson | 103:91194cc19bbb | 3 | #include "http.h" |
andrewboyson | 103:91194cc19bbb | 4 | #include "web-base.h" |
andrewboyson | 103:91194cc19bbb | 5 | #include "firmware.h" |
andrewboyson | 103:91194cc19bbb | 6 | #include "web-firmware.h" |
andrewboyson | 103:91194cc19bbb | 7 | |
andrewboyson | 103:91194cc19bbb | 8 | void WebFirmwareAjax() |
andrewboyson | 103:91194cc19bbb | 9 | { |
andrewboyson | 103:91194cc19bbb | 10 | //Header |
andrewboyson | 103:91194cc19bbb | 11 | HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL); |
andrewboyson | 103:91194cc19bbb | 12 | |
andrewboyson | 103:91194cc19bbb | 13 | //Upload status |
andrewboyson | 103:91194cc19bbb | 14 | if (FirmwareSentLength == FirmwareFileLength) |
andrewboyson | 103:91194cc19bbb | 15 | { |
andrewboyson | 103:91194cc19bbb | 16 | HttpAddText("Length ok\r\n"); |
andrewboyson | 103:91194cc19bbb | 17 | } |
andrewboyson | 103:91194cc19bbb | 18 | else |
andrewboyson | 103:91194cc19bbb | 19 | { |
andrewboyson | 103:91194cc19bbb | 20 | HttpAddText("Length error\r\n"); |
andrewboyson | 103:91194cc19bbb | 21 | HttpAddF (" sent %6d\r\n", FirmwareSentLength); |
andrewboyson | 103:91194cc19bbb | 22 | HttpAddF (" rcvd %6d\r\n", FirmwareRcvdLength); |
andrewboyson | 103:91194cc19bbb | 23 | HttpAddF (" file %6d\r\n", FirmwareFileLength); |
andrewboyson | 103:91194cc19bbb | 24 | } |
andrewboyson | 103:91194cc19bbb | 25 | |
andrewboyson | 103:91194cc19bbb | 26 | //Save status |
andrewboyson | 103:91194cc19bbb | 27 | if (FirmwareFailed) |
andrewboyson | 103:91194cc19bbb | 28 | { |
andrewboyson | 103:91194cc19bbb | 29 | HttpAddText("Save failed - see log"); |
andrewboyson | 103:91194cc19bbb | 30 | } |
andrewboyson | 103:91194cc19bbb | 31 | else |
andrewboyson | 103:91194cc19bbb | 32 | { |
andrewboyson | 103:91194cc19bbb | 33 | HttpAddText("Saved ok"); |
andrewboyson | 103:91194cc19bbb | 34 | } |
andrewboyson | 103:91194cc19bbb | 35 | |
andrewboyson | 103:91194cc19bbb | 36 | //Delimiter |
andrewboyson | 103:91194cc19bbb | 37 | HttpAddChar('\f'); |
andrewboyson | 103:91194cc19bbb | 38 | |
andrewboyson | 103:91194cc19bbb | 39 | //New directory list |
andrewboyson | 103:91194cc19bbb | 40 | WebFirmwareListSemihostFiles(); |
andrewboyson | 103:91194cc19bbb | 41 | } |