Try to request gpspos and see if gps comes up
authorEnrico Zini <enrico@enricozini.org>
Tue, 14 Jul 2009 16:19:31 +0000 (17:19 +0100)
committerEnrico Zini <enrico@enricozini.org>
Tue, 14 Jul 2009 16:19:31 +0000 (17:19 +0100)
vala/gps.vala
vala/zavai.vala

index 17afa848a81f62ff14e2f5045a4523c7c832cba2..57e6b36431244680c1c817a6e6b31cb5809042ff 100644 (file)
@@ -115,13 +115,13 @@ public class GPSMonitor : zavai.Service
 
 public class GPSPosition : zavai.Service
 {
-       weak zavai.Registry reg;
+       zavai.GPS* gps;
        dynamic DBus.Object position;
 
        public GPSPosition(zavai.Registry r)
        {
-               reg = r;
-               position = reg.sbus.get_object(
+               gps = (zavai.GPS)r.gets("gps");
+               position = r.sbus.get_object(
                        "org.freesmartphone.ogpsd",
                        "/org/freedesktop/Gypsy",
                        "org.freedesktop.Gypsy.Position");
@@ -135,7 +135,7 @@ public class GPSPosition : zavai.Service
 
        public override void start()
        {
-//         self.gps.connect("gps", self)
+               gps->request("GPSPosition");
                position.PositionChanged += on_position_changed;
                base.start();
        }
@@ -143,7 +143,7 @@ public class GPSPosition : zavai.Service
        public override void stop()
        {
                position.PositionChanged -= on_position_changed;
-//         self.gps.disconnect("gps", self)
+               gps->release("GPSPosition");
                base.stop();
        }
 }
index 64c4a8c8c6c0ec4b34ed91c6ce86570d7853fdb2..4ab9a2768afacec9e2e99f2a29f8273b05c047b6 100644 (file)
@@ -45,8 +45,9 @@ static int main (string[] args) {
        zavai.Registry registry = new zavai.Registry();
 
        registry.register("gps", new zavai.GPS(registry));
+       registry.register("gpspos", new zavai.GPSPosition(registry));
 
-       registry.gets("gps").start();
+       registry.gets("gpspos").start();
 
        // # Register main factories
        // registry.register(dbus_system_bus, "dbus.system_bus")