Doug Anson / Mbed 2 deprecated df2015-eth-hrm-k64f

Dependencies:   GroveEarbudSensor mbed mbedConnectorInterface mbedEndpointNetwork

Revision:
4:7efe785afc7f
Parent:
0:b1fc60dd398f
Child:
7:ccfb09b66c0b
--- 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