![]() |
help me for start gps shell script
And a maemo system command line open GPS in words
As title, I in the maemo. Org for two days only found open GPS python statements and program, and I want to shell script of statements directly call everybody knows it, thanks |
Re: help me for start gps shell script
Thank you, I have found
The following is a reference to use import location import gobject nn = 0 def on_error(control, error, data): print "location error: %d... quitting" % error data.quit() def on_changed(device, data): if not device: return if device.fix: if device.fix[1] & location.GPS_DEVICE_LATLONG_SET: print "lat = %f, long = %f" % device.fix[4:6] # data.stop() commented out to allow continuous loop for a reliable fix - press ctrl c to break the loop, or program your own way of exiting) def on_stop(control, data): print "quitting" data.quit() def start_location(data): data.start() return False while nn < 5: loop = gobject.MainLoop() control = location.GPSDControl.get_default() device = location.GPSDevice() control.set_properties(preferred_method=location.M ETHOD_USER_SELECTED, preferred_interval=location.INTERVAL_DEFAULT) control.connect("error-verbose", on_error, loop) device.connect("changed", on_changed, control) control.connect("gpsd-stopped", on_stop, loop) gobject.idle_add(start_location, control) nn = nn + 1 if nn > 5: break gobject.timeout_add(8000,exit) loop.run() |
Re: help me for start gps shell script
Is this a question?
Or a statement? Or just a demonstation of code you've modified from the Wiki example? |
All times are GMT. The time now is 15:00. |
vBulletin® Version 3.8.8