×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Nov 2008
    Posts
    150

    block reading data

    hi,

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

    thanks

  2. #2
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: block reading data

    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.

  3. #3
    Regular Contributor
    Join Date
    Nov 2008
    Posts
    150

    Re: block reading data

    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()

  4. #4
    Super Contributor
    Join Date
    May 2004
    Location
    Tampere, Finland
    Posts
    524

    Re: block reading data

    Have you updated to the latest PyS60, version 1.4.5? It has some bugfixes concerning the positioning module:

    * The positioning module has been made safe to use from several threads.

Similar Threads

  1. Replies: 1
    Last Post: 2007-04-17, 10:47
  2. Problem reading a data file
    By xcoutin in forum Symbian
    Replies: 2
    Last Post: 2003-08-20, 17:54
  3. Reading chunks of data at a time
    By HenrikK in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2003-03-30, 18:17
  4. Reading Data Messages from a Nokia 6210
    By Pantelis in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-08-29, 06:49

Posting Permissions

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