You Are Here:

Community: Developer Discussion Boards

#1 Old block reading data - 2008-12-09, 17:31

Join Date: Nov 2008
Posts: 139
widetech1
Online
Regular Contributor
hi,

how block the main thread that this reading data from the GPS?

thanks
Reply With Quote

#2 Old Re: block reading data - 2008-12-09, 18:05

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Quote:
Originally Posted by widetech1 View Post
hi,

how block the main thread that this reading data from the GPS?

thanks
Hi widetech1,

You asked the same thing in this thread and jethro.fn already aswered you


BR,

Rafael.
Reply With Quote

#3 Old Re: block reading data - 2008-12-09, 18:28

Join Date: Nov 2008
Posts: 139
widetech1
Online
Regular Contributor
hi,

ok, but where run the following code show a Application Closed:
Py_num KERN-EXEC 0

Code:
import positioning
import socket
import appuifw
import time
import e32
import thread
import sysinfo


def startTracking():
    print "2"
    #positioning.set_requestors([{"type":"service", "format":"application","data":"WifeTracker"}])
    print "3"
    positioning.position(course=1,satellites=1, callback = locationCallback)
    print "print positioning.position()"
    print "4"

def testThread():
   global lock
   e32.ao_sleep(5)  
   startTracking()
   lock.signal()    
     
def locationCallback(event):
    lock = thread.allocate_lock()
    e32.ao_sleep(1)
    position = event['position']
    course = event['course']
    satellites=event['satellites']
    posTuple = (position['latitude'], position['longitude'],position['altitude'])
    velocidad = course['speed']
    rumbo = course['heading']
    date = satellites['time']
    la,lo,al = posTuple
    lock.release()
    e32.ao_sleep(10)
    lat = '>R4'+','+str("%.5f"%la)+','+str("%.5f"%lo)+','+str("%.5f"%velocidad)+','+str("%.5f"%rumbo)
        

lock = e32.Ao_lock()
thread.start_new_thread(testThread,())
lock.wait()
Reply With Quote

#4 Old Re: block reading data - 2008-12-09, 21:08

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Have you updated to the latest PyS60, version 1.4.5? It has some bugfixes concerning the positioning module:

Quote:
* The positioning module has been made safe to use from several threads.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Under what conditon will the MDL file be invoked? wonz General Symbian C++ 1 2007-04-17 11:47
6600 gprs 发送大量rtp延时问题 dicson_hu Symbian 9 2005-11-04 03:12
Problem reading a data file xcoutin General Symbian C++ 2 2003-08-20 18:54
Reading chunks of data at a time HenrikK Mobile Java Networking & Messaging & Security 1 2003-03-30 19:17
Reading Data Messages from a Nokia 6210 Pantelis PC Suite API and PC Connectivity SDK 0 2002-08-29 07:49

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia