A GPS disciplined clock

Dependencies:   net lpc1768 crypto clock web log

Committer:
andrewboyson
Date:
Tue Feb 12 15:37:17 2019 +0000
Revision:
35:a535b65203a9
Parent:
34:d9586fc921dc
Child:
36:2983e45eeb49
Lots of improvements to the GPS and NMEA modules

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 27:eb5728b9052b 1 #include <stdio.h>
andrewboyson 27:eb5728b9052b 2
andrewboyson 27:eb5728b9052b 3 #include "http-server.h"
andrewboyson 27:eb5728b9052b 4 #include "http.h"
andrewboyson 27:eb5728b9052b 5 #include "page.h"
andrewboyson 27:eb5728b9052b 6 #include "page-derived.h"
andrewboyson 27:eb5728b9052b 7 #include "nmea.h"
andrewboyson 27:eb5728b9052b 8 #include "gps.h"
andrewboyson 27:eb5728b9052b 9 #include "settings.h"
andrewboyson 27:eb5728b9052b 10
andrewboyson 27:eb5728b9052b 11 void HttpNmeaHtml()
andrewboyson 27:eb5728b9052b 12 {
andrewboyson 27:eb5728b9052b 13 HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
andrewboyson 27:eb5728b9052b 14 PageAddHeader(PageSite, "NMEA", "settings.css", NULL);
andrewboyson 27:eb5728b9052b 15 PageAddNav(NMEA_PAGE);
andrewboyson 27:eb5728b9052b 16 PageAddH1(PageSite, "NMEA");
andrewboyson 27:eb5728b9052b 17
andrewboyson 27:eb5728b9052b 18 PageAddH2("Position");
andrewboyson 27:eb5728b9052b 19 HttpAddText("<p>WGS ");
andrewboyson 27:eb5728b9052b 20 char text[20];
andrewboyson 27:eb5728b9052b 21 NmeaDegToString('N', 'S', NmeaLatAv, text); HttpAddText(text); HttpAddText(" ");
andrewboyson 27:eb5728b9052b 22 NmeaDegToString('E', 'W', NmeaLngAv, text); HttpAddText(text); HttpAddText(" ");
andrewboyson 27:eb5728b9052b 23 NmeaHgtToString('H', 'D', NmeaHgtAv, text); HttpAddText(text);
andrewboyson 27:eb5728b9052b 24 HttpAddText("</p>\r\n");
andrewboyson 27:eb5728b9052b 25
andrewboyson 27:eb5728b9052b 26 HttpAddText("<p>Height of sensor above MSL m ");
andrewboyson 27:eb5728b9052b 27 NmeaHgtToString('H', 'D', NmeaHeightDevAboveMslAv, text); HttpAddText(text);
andrewboyson 27:eb5728b9052b 28 HttpAddText("</p>\r\n");
andrewboyson 27:eb5728b9052b 29
andrewboyson 27:eb5728b9052b 30 HttpAddText("<p>Satellite count ");
andrewboyson 27:eb5728b9052b 31 sprintf(text, "%d", NmeaSatelliteCount);
andrewboyson 27:eb5728b9052b 32 HttpAddText(text);
andrewboyson 27:eb5728b9052b 33 HttpAddText("</p>\r\n");
andrewboyson 27:eb5728b9052b 34
andrewboyson 27:eb5728b9052b 35 HttpAddText("<p>Dilution of Precision ");
andrewboyson 27:eb5728b9052b 36 NmeaDopToString(NmeaDop, text);
andrewboyson 27:eb5728b9052b 37 HttpAddText(text);
andrewboyson 27:eb5728b9052b 38 HttpAddText("</p>\r\n");
andrewboyson 27:eb5728b9052b 39
andrewboyson 27:eb5728b9052b 40 PageAddH2("Sensor height");
andrewboyson 27:eb5728b9052b 41 HttpAddText("<p>");
andrewboyson 27:eb5728b9052b 42 PageAddIntInput("/nmea", 0, "Sensor height above ground m", 15, "sensorheight", 2, GetSensorHeight());
andrewboyson 27:eb5728b9052b 43 HttpAddText("</p>\r\n");
andrewboyson 27:eb5728b9052b 44
andrewboyson 27:eb5728b9052b 45 HttpAddText("<p>Ground level above MSL m ");
andrewboyson 27:eb5728b9052b 46 NmeaHgtToString('H', 'D', NmeaHeightDevAboveMslAv - GetSensorHeight() * NMEA_HGT_UNIT, text); HttpAddText(text);
andrewboyson 27:eb5728b9052b 47 HttpAddText("</p>\r\n");
andrewboyson 35:a535b65203a9 48
andrewboyson 35:a535b65203a9 49 PageAddH2("Trace");
andrewboyson 35:a535b65203a9 50 if (GpsTrace ) PageAddCheckInput("/nmea", "Trace gps on" , "gpstrace", "turn off");
andrewboyson 35:a535b65203a9 51 else PageAddCheckInput("/nmea", "Trace gps off", "gpstrace", "turn on" );
andrewboyson 35:a535b65203a9 52 if (NmeaMsgTrace) PageAddCheckInput("/nmea", "Trace msg on" , "nmeamsgtrace", "turn off");
andrewboyson 35:a535b65203a9 53 else PageAddCheckInput("/nmea", "Trace msg off", "nmeamsgtrace", "turn on" );
andrewboyson 35:a535b65203a9 54 if (NmeaCmdTrace) PageAddCheckInput("/nmea", "Trace cmd on" , "nmeacmdtrace", "turn off");
andrewboyson 35:a535b65203a9 55 else PageAddCheckInput("/nmea", "Trace cmd off", "nmeacmdtrace", "turn on" );
andrewboyson 27:eb5728b9052b 56
andrewboyson 27:eb5728b9052b 57 PageAddH2("ZDA timing bins");
andrewboyson 27:eb5728b9052b 58 HttpAddText("<code>");
andrewboyson 34:d9586fc921dc 59 NmeaTimeBucketEnumerateStart();
andrewboyson 34:d9586fc921dc 60 while(NmeaTimeBucketEnumerate(sizeof(text), text)) HttpAddText(text);
andrewboyson 27:eb5728b9052b 61 HttpAddText("</code>\r\n");
andrewboyson 27:eb5728b9052b 62
andrewboyson 27:eb5728b9052b 63 PageAddEnd();
andrewboyson 27:eb5728b9052b 64 }