Hi, I’m writing a program to get GPS coordinate on WP7702. However, the program failed to activate Positiong Service:
Jun 14 17:52:45 swi-mdm9x28-wp user.err Legato: =ERR= | posDaemon[1215]/posDaemon T=main | le_gnss.c le_gnss_SetAcquisitionRate() 4195 | Bad state for that request [2]
Jun 14 17:52:45 swi-mdm9x28-wp user.warn Legato: -WRN- | posDaemon[1215]/posDaemon T=main | le_pos.c le_posCtrl_Request() 1322 | Failed to set GNSS’s acquisition rate (1000)
Jun 14 17:52:45 swi-mdm9x28-wp user.err Legato: =ERR= | posDaemon[1215]/posDaemon T=main | le_gnss.c le_gnss_Start() 3643 | Bad state for that request [2]
Jun 15 00:52:45 swi-mdm9x28-wp user.err Legato: =ERR= | sms[1280]/smsComponent T=main | smsReceiver.c GetCurrentLocation() 62 | Can’t activate Positiong Service
Jun 15 00:52:45 swi-mdm9x28-wp user.info Legato: INFO | sms[1280]/smsComponent T=main | smsReceiver.c GpsTimer() 132 | Couldn’t get GPS location. Publishing default location: 4928790, -123120900
I tried with
gnss get loc2d
which actually worked as follows:
root@swi-mdm9x28-wp:~# gnss get loc2d
Latitude(positive->north) : 48.467516
Longitude(positive->east) : -123.345192
hAccuracy : 10.00m
here is my code:
int32_t latitude;
int32_t longitude; int32_t horizontalAccuracy; int len; memset(content, 0,400); const le_result_t result = GetCurrentLocation( &latitude, &longitude, &horizontalAccuracy, GPSTIMEOUT *60); if (result == LE_OK) { LE_INFO("Loc:%f,%f", (float)latitude/1000000.0, (float)longitude/1000000.0); sprintf((char*)content, "loc: %f, %f", (float)latitude/1000000.0, (float)longitude/1000000.0); printf("%d %s\n", strlen((const char*)content), content); }
else
{ latitude = DefaultLatitude; longitude = DefaultLongitude; LE_INFO( "Couldn't get GPS location. Publishing default location: %d, %d", latitude, longitude); }
Can anyone help?
(NOTE: the app actually worked once upon a time, but it just started failing for the time being for some reason)