| Reply | « Previous Thread | Next Thread » |
|
Hi, i'm italian so i'm sorry for my bad english.
I'm developing an application that every 30 sec call the location function to discover the cell ID. I try to import the sched module but it's no insert in python series 60. Do exist an alternative solution at this problem? I'm considering to use Active Object importing e32 module, but i've got some difficulties... Can you help me with an example. Lots of thanks ![]() |
| tonino12345 |
| View Public Profile |
| Find all posts by tonino12345 |
|
You could use ao_sleep() for this. If you want to schedule your function in 30 seconds you could use ao_sleep() like: ao_sleep(30,self.function_name)
This will immediatly return and call the function with function_name 30 seconds later in the current thread. |
|
Lots of thanks!
I'll try with this solution... |
| tonino12345 |
| View Public Profile |
| Find all posts by tonino12345 |
|
Hi skunkah, I've yet some problems to develop my application. In particular way, I would code a listener that alert me when the cellID changes. Can you help me?
|
| tonino12345 |
| View Public Profile |
| Find all posts by tonino12345 |
|
you can try to create a function than watch to changes frequently and notify them:
def notify(): #Look for changes here ao_sleep(0.1,notify) |
| diegodobelo |
| View Public Profile |
| Find all posts by diegodobelo |
|
Quote:
He should use e32.Ao_timer() instead. Code:
timer = e32.Ao_timer() timer.after(30, my_function) (...) # this has to be called if the app is going to quit timer.cancel() |
|
Quote:
I would recommend the following code: Code:
import location,e32
def call()
mcc, mnc, lac, cellid = location.gsm_location()
print cellid
# loop forever
while True:
e32.ao_sleep(30)
call()
Hope that helps |
|
Quote:
Code:
import e32
import location
class Scheduler(object):
sleeptime = 30
def __init__(self):
self._timer = e32.Ao_timer()
self.start_timer()
def start_timer(self):
self._timer.after(self.sleeptime, self.handler)
def __del__(self):
self._timer.cancel()
def handler(self):
self.start_timer()
mcc, mnc, lac, cellid = location.gsm_location()
print cellid
scheduler = Scheduler()
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| problem when stop playing video on 3650 and try to play again | niko86 | Mobile Java General | 5 | 2007-08-03 08:40 |
| netcards - Problem with opening adapter | kernj | Symbian Tools & SDKs | 5 | 2007-01-10 09:56 |
| Nokia 12i module - SIM cards problem | knapczyk | Nokia M2M | 1 | 2005-03-29 16:46 |
| Problem: S60 SDK for CW in PC with .NET | anttij | Carbide.c++ IDE and plug-ins | 1 | 2005-02-28 12:36 |
| wireless problem | sash_mca | General Browsing | 0 | 2003-06-06 12:34 |