Hi list,
The following script:
import dbus
import time
bus = dbus.SystemBus()
usage = bus.get_object('org.freesmartphone.ousaged',
'/org/freesmartphone/Usage')
gps = bus.get_object('org.freedesktop.Gypsy', '/org/freedesktop/Gypsy')
gps_device = dbus.Interface(gps, 'org.freedesktop.Gypsy.Device')
gps_position = dbus.Interface(gps, 'org.freedesktop.Gypsy.Position')
usage.RequestResource('GPS')
gps_device.Stop()
while True:
gps_device.Stop()
print 'Connection:', gps_device.GetConnectionStatus()
print 'Fix:', gps_device.GetFixStatus()
print 'Position:', gps_position.GetPosition()
time.sleep(2)
usage.ReleaseResource('GPS')
despite the repeated calls to gps_device.Stop(), gives me a nice fix in
no time. Why?
Related: how can I check if the GPS device is switched off (or on)? I
need to request it using ousaged, but that will probably enable the GPS,
right? When I stop and start my script, the fix is lost for a short
time, so I think that after releasing, the GPS is switched off, but I
have no way to check it, do I?
Thanks!
David