Andrew Boyson / gps

Dependencies:   net lpc1768 crypto clock web log

web-derived/nmea/web-nmea-ajax.c

Committer:
andrewboyson
Date:
2019-04-28
Revision:
55:a1bd0572c8b6
Parent:
http-derived/nmea/http-nmea-ajax.c@ 49:115a5e4fac0c
Child:
58:3f3e000151cc

File content as of revision 55:a1bd0572c8b6:

#include  <stdint.h>
#include   <stdio.h>

#include "http.h"
#include "web-base.h"
#include "gps.h"
#include "nmea.h"
#include "settings.h"

void WebNmeaAjax()
{
    HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);

    char nibble;
    
    nibble = 0;
    if (GpsTrace    ) nibble |= 1;                    // 0
    if (GpsVerbose  ) nibble |= 2;                    // 0
    if (NmeaMsgTrace) nibble |= 4;                    // 0
    if (NmeaCmdTrace) nibble |= 8;                    // 0
    HttpAddNibbleAsHex(nibble);
    
    HttpAddInt32AsHex(NmeaLatAv);                     // 1
    HttpAddInt32AsHex(NmeaLngAv);                     // 9
    HttpAddInt32AsHex(NmeaHgtAv);                     //17

    HttpAddInt32AsHex(NmeaHeightDevAboveMslAv);       //25

    HttpAddInt32AsHex(NmeaHeightMslAboveWgs);         //33
    HttpAddInt32AsHex(NmeaDop);                       //41
    HttpAddInt32AsHex(NmeaSatelliteCount);            //49
    HttpAddInt32AsHex(NmeaFixQuality);                //57
    HttpAddInt32AsHex(GetSensorHeight());             //65
    
    HttpAddInt32AsHex(NmeaTimeBucketGetSize());       //73
    for (int i = 0; i < NmeaTimeBucketGetSize(); i++) //81
    {
        HttpAddInt32AsHex(NmeaTimeBucketGetItem(i));
    }
}