access gps on N810

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 18 Mar 2008, Udayan Kumar wrote:

> Hi Andrew,
>
> I saw you mail in the maemo mailing list about reading the GPS directly. I am 
> also trying to do the same but i am still not successful. Just wanted to know 
> if you have figured out a way to do it.

http://maemo.org/api_refs/4.0/gpsbt/group__gpsbt__api.html
http://maemo.org/development/documentation/how-tos/3-x/howto_connectivity_guide_bora.html

#include <gpsbt.h>
#include <errno.h>
int main(int argc, char *argv[]) {
   int t = 0 ; if (argc > 1) sscanf(argv[1],"%d",&t) ;
   char error_buf[100] ; gpsbt_t ctx = {0} ; /* must clear ctx! */
   printf("start GPS..") ;
   if (gpsbt_start(NULL, 0, 0, 0, error_buf, 100, 0,  &ctx) ) {
     perror("gpsbt_start") ; printf("%s\n",error_buf) ;
   }
   if (t>0) {
     printf ("sleep %d..\n",t) ;
     sleep(t) ;
     printf ("stop GPS ..\n") ;
     if (gpsbt_stop( &ctx) ) perror("gpsbt_stop") ;
   }
}
need these libs :
gcc -g -o gpsonoff -lgpsbt -lgpsmgr -lgps gpsonoff.c


Still tinkering. Seems to leave it running on exit, then I can use cgps.
Or start with the program from howto_connectivity_guide instead of cgps 
(makes a gzipped logfile of position, sped etc.)


>
> Also in my case /usr/libexec/navicore-*gpsd*-helper is not giving out NMEA 
> sentences. do we need to do something else before navicore-gpsd-helper starts 
> emitting out NMEA?

Hmm, when I try now it doesn't, either. Not sure. Using gpsd is more 
elegant, anyway.



-- 
Andrew Daviel, TRIUMF, Canada
Tel. +1 (604) 222-7376  (Pacific Time)
Network Security Manager


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Big List of Linux Books]    

  Powered by Linux