Example #1
0
 def close(self):
   if self.ok:
     positioning.stop_position()
     self.ok = False
     # HACK ALERT: undocumented, but otherwise bluetooth stays open!
     try:    del positioning._positioner
     except: pass
Example #2
0
def stop_gps():
	global gpson
	'''Function to stop the GPS'''
	try:
		positioning.stop_position()
		gpson_off = 0
		print "GPS Stopped"
	except:
		print "Problem with GPS"
Example #3
0
    def test_positioning_info(self):
        positioning.set_requestors([{
            "type": "service",
            "format": "application",
            "data": "test_app"
        }])
        event = positioning.position(course=1, satellites=1, partial=1)
        positioning.stop_position()
        self.failUnlessEqual(len(event), len(gps_data['position_info']),
                             "position API erroneous")
        self.failUnlessEqual(
            event.keys(), gps_data['position_info'].keys(),
            "Testing the keys returned by postion API failed")
        compare_keys = (event['satellites'].keys()
                        == gps_data['position_info']['satellites'].keys()
                        and event['position'].keys()
                        == gps_data['position_info']['position'].keys()
                        and event['course'].keys()
                        == gps_data['position_info']['course'].keys())
        self.assert_(
            compare_keys,
            "comparision of satellites, course or " + "position keys failed")

        event = positioning.position(course=0, satellites=1, partial=1)
        positioning.stop_position()
        self.assert_(
            event['course'] is None and event['satellites'] is not None,
            'Only course info was set to zero')

        event = positioning.position(course=1, satellites=0, partial=1)
        positioning.stop_position()
        self.assert_(
            event['satellites'] is None and event['course'] is not None,
            'only satellites info was set to zero')

        event = positioning.position(course=0, satellites=0, partial=1)
        positioning.stop_position()
        self.assert_(event['course'] is None and event['satellites'] is None,
                     'course and satellites info were not requested for')
Example #4
0
 def StopGPS():
     positioning.stop_position()
Example #5
0
 def stop(self):
   appuifw.note(u"stopping location scan", 'info')
   positioning.stop_position()
   self.running = False
   self.parent.draw_screen("location scan stopped!")
def clean():
    positioning.stop_position()
    print "Done."
    lock.signal()
Example #7
0
 def stop_gps():
         try:
                 positioning.stop_position()
                 appuifw.note(u'GPS stopped','error')
         except:
                 appuifw.note(u'Problem with GPS','error')
Example #8
0
except:
    print 'Oops! NOT available: %s!' % media

print
print 'IMEI:%s\nUserAgent:%s' % (imei, uagent)
mod = pos.default_module() # A-GPS as first time fixer
pos.select_module(mod) 
modinfo = pos.module_info(mod)
print '%s:%s,QoD:%s' % (modinfo['name'],modinfo['id'],modinfo['status']['data_quality'])
try:
    # set_requestors() must follows select_module()
    pos.set_requestors([{"type":"service","format":"application","data":"test_app"}])
    gpsdict = pos.position(satellites=True)
except:
    print 'Oops! GPS failed!'
    pos.stop_position()
    sys.exit(1)


mod -= 2
pos.select_module(mod)  # Built-in GPS
modinfo = pos.module_info(mod)
pos.set_requestors([{"type":"service","format":"application","data":"test_app"}])


for iscan in range(NUMLOOP):
    print '%sScan %d%s' % ('-'*12, iscan+1, '-'*12)

    cellok = 1 # Cell info OK.
    celloc = loc.gsm_location()
    if (not isinstance(celloc, tuple)) or (not len(celloc) == 4):
Example #9
0
 def stopListening(self):
     positioning.stop_position()
Example #10
0
 def stop(self):
     if self.active:
         positioning.stop_position()
         self.active = False
Example #11
0
 def stopListening(self):
     positioning.stop_position()
def stop_finding_position():
    positioning.stop_position()
Example #13
0
def gps_stop():
	#This function stops GPS
	try:
		positioning.stop_position()
	except:
		appuifw.note(u'Problem with GPS','error')
Example #14
0
mod = pos.default_module()  # A-GPS as first time fixer
pos.select_module(mod)
modinfo = pos.module_info(mod)
print '%s:%s,QoD:%s' % (modinfo['name'], modinfo['id'],
                        modinfo['status']['data_quality'])
try:
    # set_requestors() must follows select_module()
    pos.set_requestors([{
        "type": "service",
        "format": "application",
        "data": "test_app"
    }])
    gpsdict = pos.position(satellites=True)
except:
    print 'Oops! GPS failed!'
    pos.stop_position()
    sys.exit(1)

mod -= 2
pos.select_module(mod)  # Built-in GPS
modinfo = pos.module_info(mod)
pos.set_requestors([{
    "type": "service",
    "format": "application",
    "data": "test_app"
}])

for iscan in range(NUMLOOP):
    print '%sScan %d%s' % ('-' * 12, iscan + 1, '-' * 12)

    cellok = 1  # Cell info OK.
Example #15
0
 def StopGps(self):
     Log("ngps", "NativeGps::StopGps()")
     import positioning
     positioning.stop_position()