You Are Here:

Community: Developer Discussion Boards

Reply « Previous Thread | Next Thread »

#1 Old API to N95 GPS (lbs) - 2007-05-11, 17:41

Join Date: Mar 2007
Posts: 78
Location: Paris, France
Send a message via ICQ to bergerc
bergerc
Offline
Regular Contributor
Hi,

I'm trying to developp an API to the lbs services to use the N95 internal GPS device. My first version of the extension is located here (mercurial repository) : https://air.mosomuso.com/pubhg/pyext/

It returns lat, lon, alt, accuracy (hor, vert) and name of the module used but it requires a DevCert signature with Location capabilities.

I'm looking forward to get advices or comments. I didn't integrate it to location extension, but it would be logical to do it.

And, also, I'm trying to make it non-blocking, but I don't find how to do it, Python crashes when I just make a Positioner.NotifyPositionUpdate(PosInfo, Status) without waiting for the Async call to return. I'm not experienced with Symbian programming and I may not well understanding how it goes on.

I also looking to make it coherant with the functionning of lbs (updates, returning or not a position if the GPS is online or if the value is old...)

Thanks
Reply With Quote

#2 Old Re: API to N95 GPS (lbs) - 2007-05-14, 01:39

Join Date: May 2007
Posts: 9
dpeddi
Offline
Registered User
May this thread solve your problem?

http://discussion.forum.nokia.com/fo...ead.php?t=7597

Eddi
Reply With Quote

#3 Old Re: API to N95 GPS (lbs) - 2007-05-14, 16:13

Join Date: Mar 2007
Posts: 78
Location: Paris, France
Send a message via ICQ to bergerc
bergerc
Offline
Regular Contributor
Quote:
Originally Posted by dpeddi
May this thread solve your problem?

http://discussion.forum.nokia.com/fo...ead.php?t=7597
I may miss something but it still blocks the process waiting for the response to be available, isn't it ?
I'm using the same thing based on an example of the module ext/location of PyS60.

I was wondering if it was possible to do something like :

* Do the request
* returns with value None (no value available)
* The request finishes and the value is updated in the object
* the next call returns the actual value and a new request is issued.

What would be better is :
A timer that refreshes the value every 10 seconds, and the accessor only returns the value present in the object (with optionnaly a timestamp to evaluate the accuracy of the value returned)

I tried to do that but Python crashes... no idea what I was doing wrong.

=> can I just bypass the CActiveSchedulerWait::Start not to wait the response to come ?
Code I took from the asynccallhandler.cpp file in PyS60 ext/location folder:
Code:
iWait=new (ELeave) CActiveSchedulerWait;
Code:
  this->iPositioner.NotifyPositionUpdate(posInfo, status);
  this->SetActive();
  this->iWait->Start();
  status=this->iStatus;
Thanks
Reply With Quote

#4 Old Re: API to N95 GPS (lbs) - 2007-05-15, 14:34

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Note that you must always release the interpreter lock before entering the Active Scheduler and reacquire it upon return. In the above code you must do:
Code:
PyEval_SaveThread();
this->iWait->Start();
PyEval_RestoreThread(PYTHON_TLS->thread_state);
Reply With Quote

#5 Old Re: API to N95 GPS (lbs) - 2007-05-15, 14:44

Join Date: Mar 2007
Posts: 78
Location: Paris, France
Send a message via ICQ to bergerc
bergerc
Offline
Regular Contributor
Quote:
Originally Posted by jplauril
Note that you must always release the interpreter lock before entering the Active Scheduler and reacquire it upon return. In the above code you must do:
Code:
PyEval_SaveThread();
this->iWait->Start();
PyEval_RestoreThread(PYTHON_TLS->thread_state);
Well, this is done with Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS, isn't it ?
So it is done but a little bit before and after this code block.


Christophe Berger
Reply With Quote

#6 Old Re: API to N95 GPS (lbs) - 2007-05-15, 14:52

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Yes, these two calls do the same thing.
Reply With Quote

#7 Old Re: API to N95 GPS (lbs) - 2007-05-24, 14:45

Join Date: Aug 2004
Posts: 290
simo.salminen
Offline
Regular Contributor
If you wonder how to do async callbacks in pys60 from c++ to python code, look the code of e32.ao_sleep. Tell if you have problems.
Reply With Quote

#8 Old Re: API to N95 GPS (lbs) - 2007-06-25, 12:06

Join Date: Jun 2007
Posts: 2
marciallus
Offline
Registered User
Hello

I've writed two simple App which can perhaps give you so tricks to use the LBS API :
http://www.newlc.com/playing-n95
and http://www.newlc.com/playing-n95-use...pi-and-so-more

perhaps it can helps

--
MarCo
Reply With Quote

#9 Old Re: API to N95 GPS (lbs) - 2007-06-25, 14:33

Join Date: Mar 2007
Posts: 78
Location: Paris, France
Send a message via ICQ to bergerc
bergerc
Offline
Regular Contributor
Hi,

Quote:
Originally Posted by marciallus
Hello

I've writed two simple App which can perhaps give you so tricks to use the LBS API :
I will look at it.

Thank you


Christophe Berger
Reply With Quote

#10 Old Re: API to N95 GPS (lbs) - 2007-06-25, 19:35

Join Date: Apr 2004
Posts: 107
Send a message via ICQ to carknue
carknue
Offline
Regular Contributor
Does it work with E90?
Reply With Quote

#11 Old Re: API to N95 GPS (lbs) - 2007-06-26, 09:53

Join Date: Mar 2007
Posts: 78
Location: Paris, France
Send a message via ICQ to bergerc
bergerc
Offline
Regular Contributor
It should work with the E90 as it runs the same system/version as the N95 which I used to test it.


Christophe Berger
Reply With Quote

#12 Old Re: API to N95 GPS (lbs) - 2007-06-26, 14:59

Join Date: Mar 2007
Posts: 78
Location: Paris, France
Send a message via ICQ to bergerc
bergerc
Offline
Regular Contributor
I comitted a new version of the gps_location module, it now uses active object but still has problems. If someone wants to review the code it will be appreciated.

mercurial repository : https://air.mosomuso.com/pubhg/pyext/

I comitted an other module to perform wlan scanning, it returns data about seen wlan networks (SSID, BSSID, Rx Level...) but uses an API from the Extensions plug-in package for S60 3rd Edition SDK for Symbian OS, for C++, MR, Version 4 (http://forum.nokia.com/info/sw.nokia...Pack1.zip.html)

please feel free to test it.


Christophe Berger
Reply With Quote

#13 Old Re: API to N95 GPS (lbs) - 2007-06-26, 15:15

Join Date: Mar 2007
Posts: 78
Location: Paris, France
Send a message via ICQ to bergerc
bergerc
Offline
Regular Contributor
Quote:
Originally Posted by bergerc
I comitted a new version of the gps_location module, it now uses active object but still has problems. If someone wants to review the code it will be appreciated.

mercurial repository : https://air.mosomuso.com/pubhg/pyext/
I've just seen that the 1.3.23 PyS60 version includes a position module... so mine is no longer interesting...


Christophe Berger
Reply With Quote

#14 Old Re: API to N95 GPS (lbs) - 2007-06-26, 16:17

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
Quote:
Originally Posted by bergerc
I've just seen that the 1.3.23 PyS60 version includes a position module... so mine is no longer interesting...
Code:
import positioning
pos = positioning.position()
This just replaced 723 lines of my BtGpsReader.py + NMEAParser.py + Position.py code.

I love high level programming languages like Python for series 60. :-)
Reply With Quote

#15 Old Re: API to N95 GPS (lbs) - 2007-07-02, 13:39

Join Date: Apr 2007
Posts: 6
maaysn
Offline
Registered User
Quote:
Originally Posted by marciallus
Hello

I've writed two simple App which can perhaps give you so tricks to use the LBS API :
http://www.newlc.com/playing-n95
and http://www.newlc.com/playing-n95-use...pi-and-so-more

perhaps it can helps

--
MarCo

hi marco ,

i have got a problem here. i build your application example at newLC. i sent it to my phone but when i try to install it it gives me error like "Required application access not guaranteed" (phone is NOKIA N95)

how can i solve this?
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
PC Suite error: (Code: Init IMediaControl2) HELP?! chunkyspudmonkey General Discussion 29 2008-06-30 12:47
GPS on N95 kvr0 General Symbian C++ 0 2007-05-11 11:22
Nokia N95 - does the GPS application have an API hagana Mobile Java Networking & Messaging & Security 2 2007-05-05 11:42
Accessing the N95 GPS snogge General Discussion 2 2007-02-11 22:11
N95 GPS/Location API DavidJN Mobile Java General 1 2006-10-17 23:38

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