Alpha release.
[speedometer] / callbacks.c
index 5953252..3c48b2d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "callbacks.h"
 #include "appdata.h"
+#include "util.h"
 
 // this is just here for debugging and tracing purposes
 static void print_location(LocationGPSDevice* device) {
@@ -31,8 +32,15 @@ static void print_location(LocationGPSDevice* device) {
                        device->fix->speed);
 }
 
-void location_changed(LocationGPSDevice* device, gpointer userdata) {
+void location_changed(LocationGPSDevice* device, gpointer data) {
+       print_location(device);
 
+       AppData* appdata = (AppData*) data;
+
+       if(device->fix && LOCATION_GPS_DEVICE_SPEED_SET) {
+               g_print("Speed is %f km/h", device->fix->speed);
+               interpret_speed_from_gps(appdata, device->fix->speed);
+       }
 }
 
 gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, HildonWindow* window) {