GPS Porting Problems...

85 views
Skip to first unread message

tarikk

unread,
Aug 23, 2010, 9:12:02 AM8/23/10
to android-porting
Hey there, I'm having slight confusion over how the GPS works exactly.
I'm trying to implement GPS on an OMAP board.

This is the error im getting when running a GPS app
================================================================
I/ActivityManager( 794): Starting activity: Intent
{ act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.yunnanexplorer.android.ygps/.YGPS }
I/ActivityManager( 794): Start proc com.yunnanexplorer.android.ygps
for activity com.yunnanexplorer.android.ygps/.YGPS: pid=1006 uid=10019
gids={1015}
D/LocationManager( 1006): Constructor: service =
android.location.ILocationManager$Stub$Proxy@43be1e08
D/GpsLocationProvider( 794): setMinTime 0
D/GpsLocationProvider( 794): startNavigating
D/gps_fr ( 794): gps fix frquency set to 1 secs
D/gps_fr ( 794): freerunner_gps_start: called
D/gps_fr ( 794): gps_state_start: could not send CMD_START command:
ret=-1: Bad file number
D/GpsLocationProvider( 794): setMinTime 0
D/dalvikvm( 1006): Total arena pages for JIT: 2
I/ActivityManager( 794): Displayed activity
com.yunnanexplorer.android.ygps/.YGPS: 785 ms (total 785 ms)
E/gralloc ( 794): [unregister] handle 0x3ca3f8 still locked
(state=40000001)
================================================================

This is the code where its crashing

static void
gps_state_start( GpsState* s )
{
char cmd = CMD_START;
int ret;

do { ret=write( s->control[0], &cmd, 1 ); }
while (ret < 0 && errno == EINTR);

if (ret != 1){
D("%s: could not send CMD_START command: ret=%d: %s",
__FUNCTION__, ret, strerror(errno));
}
}

This code is mostly from the gps_freerunner.cpp implementation.



Just tracing back in the code, i realized that it could be an issue
with the variable "_gps_state" because thats where it's stopping...
What is "_gps_state" exactly?? And where is it set? Seems to be null.

Please help i'm going mental. I've been searching all day and night...
even translating asian websites to try to figure this out :(

Any help is much appreciated,
Tarik

tarikk

unread,
Aug 31, 2010, 4:29:48 AM8/31/10
to android-porting
Still stuck on this. Any idea?

Ashwin Bihari

unread,
Aug 31, 2010, 8:32:40 AM8/31/10
to tari...@gmail.com, android-porting
Tarik,

The GPS code you are playing with there uses a socket pair to send
messages back and forth. When that piece of code starts up, it spawn a
thread that enter an while() loop and sits on the control socket. The
other commands gps_state_start, gps_state_stop and so on receive
messages from the upper level Android and send those commands to the
thread using the socket.

So make sure that you have the 'control' socket pair being created properly..

Regards
-- Ashwin

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

Reply all
Reply to author
Forward
0 new messages