A tiny change to SKPanks GPS library to allow Ublox GPS modems to work.

Fork of GPS by Nicholas Herriot

A Library adapted for the Ublox MAX Q6 and MAX Q7 module.

The library is work in progress.

GPS.h

Committer:
nherriot
Date:
2013-07-25
Revision:
1:bcc48e322f84
Parent:
0:0f423a982334

File content as of revision 1:bcc48e322f84:

/* GPS class for mbed Microcontroller
 * Copyright (c) 2008, sford
 */

#include "mbed.h"

#ifndef GPS_H
#define GPS_H

/* Class: GPS
 *  A GPS interface for reading from a Globalsat EM-406 GPS Module
 */
class GPS {

public:

	/* Constructor: GPS
	 *  Create the GPS, connected to the specified serial port
	 */	
	GPS(PinName tx, PinName rx);
	
	/* Function: sample
	 *  Sample the incoming GPS data, returning whether there is a lock
	 * 
	 * Variables:
	 *  returns - 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0
	 */
	int sample();
	
	/* Variable: longitude
	 *  The longitude (call sample() to set)
	 */
	float longitude;

	/* Variable: latitude
	 *  The latitude (call sample() to set)
	 */
	float latitude;
	
private:

	float trunc(float v);
	void getline();
	
	Serial _gps;
	char msg[256];

};

#endif