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.
Dependencies: net lpc1768 crypto clock web log
web-this/home/web-home-query.c@84:baec7c1f5618, 2019-11-18 (annotated)
- Committer:
- andrewboyson
- Date:
- Mon Nov 18 08:51:46 2019 +0000
- Revision:
- 84:baec7c1f5618
- Parent:
- 59:d2d25c2265f8
- Child:
- 90:9b8bc951c6d9
Updated LPC1768 library
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andrewboyson | 27:eb5728b9052b | 1 | #include "http.h" |
| andrewboyson | 27:eb5728b9052b | 2 | #include "clkgov.h" |
| andrewboyson | 27:eb5728b9052b | 3 | #include "clkutc.h" |
| andrewboyson | 27:eb5728b9052b | 4 | #include "led.h" |
| andrewboyson | 27:eb5728b9052b | 5 | #include "settings.h" |
| andrewboyson | 27:eb5728b9052b | 6 | |
| andrewboyson | 55:a1bd0572c8b6 | 7 | void WebHomeQuery(char* pQuery) |
| andrewboyson | 27:eb5728b9052b | 8 | { |
| andrewboyson | 27:eb5728b9052b | 9 | while (pQuery) |
| andrewboyson | 27:eb5728b9052b | 10 | { |
| andrewboyson | 27:eb5728b9052b | 11 | char* pName; |
| andrewboyson | 27:eb5728b9052b | 12 | char* pValue; |
| andrewboyson | 29:4fe0f237fd61 | 13 | pQuery = HttpQuerySplit(pQuery, &pName, &pValue); |
| andrewboyson | 43:bf39371b4576 | 14 | int value = HttpQueryValueAsInt(pValue); |
| andrewboyson | 27:eb5728b9052b | 15 | |
| andrewboyson | 28:7fb6b4e9ab80 | 16 | if (HttpSameStr(pName, "chg-clock-leap-enable" )) ClkUtcTglNextLeapEnable (); |
| andrewboyson | 28:7fb6b4e9ab80 | 17 | if (HttpSameStr(pName, "chg-clock-leap-forward")) ClkUtcTglNextLeapForward(); |
| andrewboyson | 27:eb5728b9052b | 18 | |
| andrewboyson | 27:eb5728b9052b | 19 | int months1970 = ClkUtcGetNextEpochMonth1970(); |
| andrewboyson | 27:eb5728b9052b | 20 | int months = months1970 % 12; |
| andrewboyson | 27:eb5728b9052b | 21 | int years = months1970 / 12; |
| andrewboyson | 27:eb5728b9052b | 22 | |
| andrewboyson | 28:7fb6b4e9ab80 | 23 | if (HttpSameStr(pName, "set-clock-leap-year" )) |
| andrewboyson | 27:eb5728b9052b | 24 | { |
| andrewboyson | 43:bf39371b4576 | 25 | years = value - 1970; |
| andrewboyson | 27:eb5728b9052b | 26 | if (years < 0) years = 0; |
| andrewboyson | 27:eb5728b9052b | 27 | ClkUtcSetNextEpochMonth1970(years * 12 + months); |
| andrewboyson | 27:eb5728b9052b | 28 | } |
| andrewboyson | 28:7fb6b4e9ab80 | 29 | if (HttpSameStr(pName, "set-clock-leap-month" )) |
| andrewboyson | 27:eb5728b9052b | 30 | { |
| andrewboyson | 43:bf39371b4576 | 31 | months = value - 1; |
| andrewboyson | 27:eb5728b9052b | 32 | if (months < 0) months = 0; |
| andrewboyson | 27:eb5728b9052b | 33 | ClkUtcSetNextEpochMonth1970(years * 12 + months); |
| andrewboyson | 27:eb5728b9052b | 34 | } |
| andrewboyson | 28:7fb6b4e9ab80 | 35 | if (HttpSameStr(pName, "set-clock-leap-count" )) |
| andrewboyson | 27:eb5728b9052b | 36 | { |
| andrewboyson | 43:bf39371b4576 | 37 | uint16_t leaps = value; |
| andrewboyson | 27:eb5728b9052b | 38 | ClkUtcSetEpochOffset(leaps); |
| andrewboyson | 27:eb5728b9052b | 39 | } |
| andrewboyson | 27:eb5728b9052b | 40 | |
| andrewboyson | 28:7fb6b4e9ab80 | 41 | if (HttpSameStr(pName, "ppb" )) ClkGovSetPpb (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 42 | if (HttpSameStr(pName, "slewdivisor" )) SetClockSlewDivisor (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 43 | if (HttpSameStr(pName, "slewmax" )) SetClockSlewMaxMs (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 44 | if (HttpSameStr(pName, "ppbdivisor" )) SetClockPpbDivisor (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 45 | if (HttpSameStr(pName, "ppbmaxchange" )) SetClockPpbChangeMax (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 46 | if (HttpSameStr(pName, "syncedlimitns" )) SetClockSyncedLimitNs (value * 1000000 ); |
| andrewboyson | 28:7fb6b4e9ab80 | 47 | if (HttpSameStr(pName, "syncedhysns" )) SetClockSyncedHysterisNs (value * 1000000 ); |
| andrewboyson | 28:7fb6b4e9ab80 | 48 | if (HttpSameStr(pName, "syncedlimitppb")) SetClockSyncedLimitPpb (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 49 | if (HttpSameStr(pName, "syncedhysppb" )) SetClockSyncedHysterisPpb (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 50 | if (HttpSameStr(pName, "maxoffsetsecs" )) SetClockMaxOffsetSecs (value ); |
| andrewboyson | 28:7fb6b4e9ab80 | 51 | if (HttpSameStr(pName, "clockgovtrace" )) ChgTraceSync(); |
| andrewboyson | 27:eb5728b9052b | 52 | } |
| andrewboyson | 27:eb5728b9052b | 53 | } |
| andrewboyson | 27:eb5728b9052b | 54 |