A GPS disciplined clock

Dependencies:   net lpc1768 crypto clock web log

Committer:
andrewboyson
Date:
Fri Apr 03 08:15:37 2020 +0000
Revision:
93:2cce06dd2bcc
Parent:
59:d2d25c2265f8
Increased NMEA confidence delay from 10 to 20 minutes after an incident where it took 13 minutes to settle.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 57:2d54e570de60 1 #include "http.h"
andrewboyson 59:d2d25c2265f8 2 #include "web-pages-this.h"
andrewboyson 58:3f3e000151cc 3 #include "web.h"
andrewboyson 57:2d54e570de60 4
andrewboyson 59:d2d25c2265f8 5 #define DO_HOME_HTML DO_THIS + 0
andrewboyson 59:d2d25c2265f8 6 #define DO_HOME_AJAX DO_THIS + 1
andrewboyson 59:d2d25c2265f8 7 #define DO_HOME_SCRIPT DO_THIS + 2
andrewboyson 59:d2d25c2265f8 8 #define DO_NMEA_HTML DO_THIS + 3
andrewboyson 59:d2d25c2265f8 9 #define DO_NMEA_AJAX DO_THIS + 4
andrewboyson 59:d2d25c2265f8 10 #define DO_NMEA_SCRIPT DO_THIS + 5
andrewboyson 57:2d54e570de60 11
andrewboyson 59:d2d25c2265f8 12 int WebServerThisDecideWhatToDo(char *pPath, char* pLastModified)
andrewboyson 57:2d54e570de60 13 {
andrewboyson 57:2d54e570de60 14 if (HttpSameStr(pPath, "/" )) return DO_HOME_HTML;
andrewboyson 57:2d54e570de60 15 if (HttpSameStr(pPath, "/home-ajax" )) return DO_HOME_AJAX;
andrewboyson 57:2d54e570de60 16 if (HttpSameStr(pPath, "/nmea" )) return DO_NMEA_HTML;
andrewboyson 57:2d54e570de60 17 if (HttpSameStr(pPath, "/nmea-ajax" )) return DO_NMEA_AJAX;
andrewboyson 57:2d54e570de60 18
andrewboyson 57:2d54e570de60 19 if (HttpSameStr(pPath, "/home.js" )) return HttpSameDate(WebHomeScriptDate, WebHomeScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_HOME_SCRIPT;
andrewboyson 57:2d54e570de60 20 if (HttpSameStr(pPath, "/nmea.js" )) return HttpSameDate(WebNmeaScriptDate, WebNmeaScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_NMEA_SCRIPT;
andrewboyson 57:2d54e570de60 21
andrewboyson 57:2d54e570de60 22 return DO_NOT_FOUND;
andrewboyson 57:2d54e570de60 23 }
andrewboyson 57:2d54e570de60 24
andrewboyson 59:d2d25c2265f8 25 bool WebServerThisHandleQuery(int todo, char* pQuery)
andrewboyson 57:2d54e570de60 26 {
andrewboyson 57:2d54e570de60 27 switch (todo)
andrewboyson 57:2d54e570de60 28 {
andrewboyson 58:3f3e000151cc 29 case DO_HOME_AJAX: WebHomeQuery(pQuery); return true;
andrewboyson 58:3f3e000151cc 30 case DO_NMEA_HTML: WebNmeaQuery(pQuery); return true;
andrewboyson 58:3f3e000151cc 31 case DO_NMEA_AJAX: WebNmeaQuery(pQuery); return true;
andrewboyson 57:2d54e570de60 32 }
andrewboyson 58:3f3e000151cc 33 return false;
andrewboyson 57:2d54e570de60 34 }
andrewboyson 59:d2d25c2265f8 35 bool WebServerThisPost(int todo, int contentLength, int contentStart, int size, char* pRequestStream, uint32_t positionInRequestStream, bool* pComplete)
andrewboyson 57:2d54e570de60 36 {
andrewboyson 58:3f3e000151cc 37 return false;
andrewboyson 57:2d54e570de60 38 }
andrewboyson 59:d2d25c2265f8 39 bool WebServerThisReply(int todo)
andrewboyson 57:2d54e570de60 40 {
andrewboyson 57:2d54e570de60 41 switch (todo)
andrewboyson 57:2d54e570de60 42 {
andrewboyson 58:3f3e000151cc 43 case DO_HOME_HTML: WebHomeHtml (); return true;
andrewboyson 58:3f3e000151cc 44 case DO_HOME_AJAX: WebHomeAjax (); return true;
andrewboyson 58:3f3e000151cc 45 case DO_HOME_SCRIPT: WebHomeScript(); return true;
andrewboyson 58:3f3e000151cc 46 case DO_NMEA_HTML: WebNmeaHtml (); return true;
andrewboyson 58:3f3e000151cc 47 case DO_NMEA_AJAX: WebNmeaAjax (); return true;
andrewboyson 58:3f3e000151cc 48 case DO_NMEA_SCRIPT: WebNmeaScript(); return true;
andrewboyson 57:2d54e570de60 49 }
andrewboyson 58:3f3e000151cc 50 return false;
andrewboyson 57:2d54e570de60 51 }
andrewboyson 57:2d54e570de60 52