diff --git a/master/master/lib/gps.c b/master/master/lib/gps.c --- a/master/master/lib/gps.c +++ b/master/master/lib/gps.c @@ -46,29 +46,34 @@ int numBytes = 0; char tramsmissionType[7]; char timestamp[12]; //hhmmss.ss -char* get_timestamp() { +char* get_timestamp() +{ return timestamp; } char latitude[14]; //lllll.lla -char* get_latitude() { +char* get_latitude() +{ return latitude; } char longitude[14]; //yyyyy.yyb -char* get_longitude() { +char* get_longitude() +{ return longitude; } char quality; //quality for GGA and validity for RMC char numSatellites[4]; -char* get_sv() { +char* get_sv() +{ return numSatellites; } char hdop[6]; //xx.x -char* get_hdop() { +char* get_hdop() +{ return hdop; } @@ -79,21 +84,25 @@ char stationID[8]; //blank - included fo char checksum[3]; //xx char knots[8]; //xxx.xx -char* get_speedKnots() { +char* get_speedKnots() +{ return knots; } char course[8]; //xxx.x -char* get_course() { +char* get_course() +{ return course; } char dayofmonth[9]; //ddmmyy -char* get_dayofmonth() { +char* get_dayofmonth() +{ return dayofmonth; } -bool gps_hasfix() { +bool gps_hasfix() +{ return strcmp("99.99", get_hdop()); } @@ -176,14 +185,16 @@ void parse_gps_transmission(void){ - while(nmeaBufferDataPosition != nmeaBufferParsePosition) { - led_on(LED_ACTIVITY); + while(nmeaBufferDataPosition != nmeaBufferParsePosition) + { + led_on(LED_ACTIVITY); byte = nmeaBuffer[nmeaBufferParsePosition]; if(decodeState == INITIALIZE) //start of transmission sentence { - if(byte == '$') { + if(byte == '$') + { #ifdef DEBUG_NMEA serial0_sendString("found $\r\n"); #endif @@ -194,7 +205,8 @@ void parse_gps_transmission(void){ calculatedChecksum = 0; } - else { + else + { setParserState(INITIALIZE); } }