Richard Osterloh / Mbed 2 deprecated WiFi_Scanner

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 LocationUpdate.cpp Source File

LocationUpdate.cpp

00001 #include "LocationUpdate.h"
00002 
00003 LocationUpdate::LocationUpdate(GPSTracker& gpsTracker) :
00004     _gpsTracker(gpsTracker)
00005 {
00006     _init = false;
00007 }
00008 
00009 bool LocationUpdate::init()
00010 {
00011     if (_init)
00012         return false;
00013     
00014     _init = true;
00015     return true;
00016 }
00017 
00018 bool LocationUpdate::run()
00019 {
00020     GPSTracker::Position position;
00021     
00022     if (!_gpsTracker.position(&position)) {
00023         puts("No GPS data available.");
00024         return true;
00025     }
00026         
00027     puts("Starting measurement sending.");
00028 
00029     float altitude = position.altitude;
00030     float latitude = position.latitude;
00031     float longitude = position.longitude;
00032     
00033     printf("Lat: %9.7f Long: %9.7f Altitude %.2f", latitude, longitude, altitude);
00034     
00035     return true;
00036 }