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
device/GPSTracker.h@1:cac9b2960637, 2015-02-15 (annotated)
- Committer:
- rosterloh84
- Date:
- Sun Feb 15 22:04:12 2015 +0000
- Revision:
- 1:cac9b2960637
First working version. Lots to do still.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rosterloh84 | 1:cac9b2960637 | 1 | #pragma once |
rosterloh84 | 1:cac9b2960637 | 2 | |
rosterloh84 | 1:cac9b2960637 | 3 | #include <stddef.h> |
rosterloh84 | 1:cac9b2960637 | 4 | #include "GPS.h" |
rosterloh84 | 1:cac9b2960637 | 5 | #include "rtos.h" |
rosterloh84 | 1:cac9b2960637 | 6 | |
rosterloh84 | 1:cac9b2960637 | 7 | /** |
rosterloh84 | 1:cac9b2960637 | 8 | * A GPS tracker class providing access to the current position. |
rosterloh84 | 1:cac9b2960637 | 9 | */ |
rosterloh84 | 1:cac9b2960637 | 10 | class GPSTracker |
rosterloh84 | 1:cac9b2960637 | 11 | { |
rosterloh84 | 1:cac9b2960637 | 12 | public: |
rosterloh84 | 1:cac9b2960637 | 13 | /** |
rosterloh84 | 1:cac9b2960637 | 14 | * Initialize a new GPSTracker object. |
rosterloh84 | 1:cac9b2960637 | 15 | * @param gps a previously initialized instance of the GPSI2C class |
rosterloh84 | 1:cac9b2960637 | 16 | */ |
rosterloh84 | 1:cac9b2960637 | 17 | GPSTracker(GPSI2C&); |
rosterloh84 | 1:cac9b2960637 | 18 | |
rosterloh84 | 1:cac9b2960637 | 19 | typedef struct { |
rosterloh84 | 1:cac9b2960637 | 20 | double altitude; // altitude meters |
rosterloh84 | 1:cac9b2960637 | 21 | double latitude; // latitude degrees |
rosterloh84 | 1:cac9b2960637 | 22 | double longitude; // longitude degrees |
rosterloh84 | 1:cac9b2960637 | 23 | } Position; |
rosterloh84 | 1:cac9b2960637 | 24 | |
rosterloh84 | 1:cac9b2960637 | 25 | /** |
rosterloh84 | 1:cac9b2960637 | 26 | * Retrieves and invalidates the current position. |
rosterloh84 | 1:cac9b2960637 | 27 | * @param position a pointer of type Position where the current position is written to |
rosterloh84 | 1:cac9b2960637 | 28 | * @return true on success, false otherwise |
rosterloh84 | 1:cac9b2960637 | 29 | */ |
rosterloh84 | 1:cac9b2960637 | 30 | bool position(Position*); |
rosterloh84 | 1:cac9b2960637 | 31 | |
rosterloh84 | 1:cac9b2960637 | 32 | protected: |
rosterloh84 | 1:cac9b2960637 | 33 | void thread(); |
rosterloh84 | 1:cac9b2960637 | 34 | static void thread_func(void const*); |
rosterloh84 | 1:cac9b2960637 | 35 | |
rosterloh84 | 1:cac9b2960637 | 36 | private: |
rosterloh84 | 1:cac9b2960637 | 37 | GPSI2C _gps; |
rosterloh84 | 1:cac9b2960637 | 38 | Thread _thread; |
rosterloh84 | 1:cac9b2960637 | 39 | Mutex _mutex; |
rosterloh84 | 1:cac9b2960637 | 40 | Position _position; |
rosterloh84 | 1:cac9b2960637 | 41 | bool _positionSet; |
rosterloh84 | 1:cac9b2960637 | 42 | }; |