An application to log WiFi SSIDs for position lookup testing

Dependencies:   C027_Support SWO mbed-rtos mbed picojson

Fork of lpc4088_ebb_ublox_Cellular_PubNubDemo_rtos by EmbeddedArtists AB

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GPSTracker.h Source File

GPSTracker.h

00001 #pragma once
00002 
00003 #include <stddef.h>
00004 #include "GPS.h"
00005 #include "rtos.h"
00006 
00007 /**
00008  * A GPS tracker class providing access to the current position.
00009  */
00010 class GPSTracker
00011 {
00012 public:
00013     /**
00014      * Initialize a new GPSTracker object.
00015      * @param gps a previously initialized instance of the GPSI2C class
00016      */
00017     GPSTracker(GPSI2C&);
00018     
00019     typedef struct {
00020         double altitude;  // altitude  meters
00021         double latitude;  // latitude  degrees
00022         double longitude; // longitude degrees
00023     } Position;
00024     
00025     /**
00026      * Retrieves and invalidates the current position.
00027      * @param position a pointer of type Position where the current position is written to
00028      * @return true on success, false otherwise
00029      */
00030     bool position(Position*);
00031     
00032 protected:
00033     void thread();
00034     static void thread_func(void const*);
00035 
00036 private:
00037     GPSI2C _gps;
00038     Thread _thread;
00039     Mutex _mutex;
00040     Position _position;
00041     bool _positionSet;
00042 };