Andrew Boyson / gps

Dependencies:   net lpc1768 crypto clock web log

http-derived/nmea/http-nmea-ajax.c

Committer:
andrewboyson
Date:
2019-03-27
Revision:
48:9f1ab7784067
Child:
49:115a5e4fac0c

File content as of revision 48:9f1ab7784067:

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

#include "http.h"
#include "http-server.h"
#include "gps.h"
#include "nmea.h"
#include "settings.h"

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

    char text[20];
    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(NmeaDop);                       //33
    HttpAddInt32AsHex(NmeaSatelliteCount);            //41
    HttpAddInt32AsHex(NmeaFixQuality);                //49
    HttpAddInt32AsHex(GetSensorheight);               //57
    
    HttpAddInt32AsHex(NmeaTimeBucketGetSize());       //65
    for (int i = 0; i < NmeaTimeBucketGetSize(); i++) //73
    {
        HttpAddInt32AsHex(NmeaTimeBucketGetItem(i));
    }
}