Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: GroveEarbudSensor mbed mbedConnectorInterface mbedEndpointNetwork
Diff: mbedEndpointResources/LocationResource.h
- Revision:
- 4:7efe785afc7f
- Parent:
- 0:b1fc60dd398f
- Child:
- 7:ccfb09b66c0b
diff -r 4246dd70c0dc -r 7efe785afc7f mbedEndpointResources/LocationResource.h --- a/mbedEndpointResources/LocationResource.h Tue Sep 01 22:09:29 2015 +0000 +++ b/mbedEndpointResources/LocationResource.h Fri Sep 04 21:04:44 2015 +0000 @@ -28,10 +28,10 @@ extern RawSerial pc; // main.cpp // We have a static location by default - Moscone West - 37.783879,-122.4012538 -#define MY_LATITUDE "37.783879" -#define MY_LONGITUDE "-122.4012538" -#define MY_ALTITUDE "100.0" -#define MY_SPEED "0.0" +#define MY_LATITUDE 37.783879 +#define MY_LONGITUDE -122.4012538 +#define MY_ALTITUDE 30.0 +#define MY_SPEED 0.0 // Maximum Location JSON Length : {"latitude":XXX.YYYYYY, "longitude":XXX.YYYYYY, "msl":XXXXXX, "speed":XXXXXX} #define LOCATION_JSON_LENGTH 256 @@ -57,7 +57,7 @@ virtual string get() { char json[LOCATION_JSON_LENGTH+1]; memset(json,0,LOCATION_JSON_LENGTH+1); - sprintf(json,"{\"latitude\":%s,\"longitude\":%s,\"msl\":%s,\"speed\":%s}", + sprintf(json,"{\"latitude\":%.6f,\"longitude\":%.6f,\"msl\":%.1f,\"speed\":%.1f}", MY_LATITUDE, MY_LONGITUDE, MY_ALTITUDE, // in meters