在诺基亚 N80 和 E63 上运行“通过网络定位”脚本时遇到问题。相同的代码在更新的E5上运行良好。是否有任何 PyS60 大师可以提供帮助?
这是脚本(从这里摘录):-
import positioning,e32,appuifw
# 'Hotwired' values - use
wifi = 536979841
agps = 270526860
gps = 270526858
network = 270559509
def quit():
app_lock.signal()
def c(data):
if data['position']['latitude'] == data['position']['latitude']:
print "Lat : ",data['position']['latitude']
print "Long: ",data['position']['longitude']
print "HAcc: ",data['position']['horizontal_accuracy']
app_lock = e32.Ao_lock()
appuifw.app.exit_key_handler = quit
try:
#positioning.select_module(positioning.default_module())
positioning.select_module(network)
positioning.set_requestors([{"type":"service","format":"application","data":"gps_app"}])
positioning.position(callback=c, interval=1000000,partial=0)
print "Positioning started"
except:
appuifw.note(u'Positioning start failed','error')
app_lock.wait()
try:
positioning.stop_position()
except:
appuifw.note(u'Positining stop failed','error')