Hi ppl! I have a problem with wy GPS. I can’t get erGetGpsState()… The code is:
void ERideAppLoop(u8 timerId)
{
s32 gpsDataAvailMask = 0;
s32 GpsState;
GpsState = erGetGpsState();
TRACE(( 1, “erGetGpsState = %d”, GpsState ));
adl_atSendResponse(ADL_AT_RSP,“GpsState= \n”);
adl_atSendResponse(ADL_AT_RSP,GpsState);
/* Make sure initialization (erGpsStart) is complete before calling core /
if ((GpsState == ER_GPS_STATE_ON) || (rx_bytes_in > 0)){
/ Send a response to user informing that GPS library is loaded /
adl_atSendResponse(ADL_AT_RSP,“GpsState== ER_GPS_STATE_ON” );
if ( (!AppIsGpsLoaded)&&(GpsState == ER_GPS_STATE_ON) )
{
AppCGpsCoreCb(APP_CGPS_INIT_DONE);
adl_atSendResponse(ADL_AT_RSP,“GPS library is loaded”);
AppIsGpsLoaded = TRUE;
}
/ Produce PVT solution*/
/* Extract the contents of serial port /
/ UART Rx interrupt receives bytes from the GPS chipset and store bytes in OS queue */
TRACE(( 1, “ErideDataIn Check”));
if (rx_bytes_in) {
/* Process the serial port packets /
/ If complete GPS chipset packet is available, GPS core attempts a position fix and
- returns bit field that indicate if new PVT data is available.
*/
TRACE(( 1 , “ErideCore Enter %d”, rx_bytes_in));
gpsDataAvailMask = erGpsCoreTask(rxbuffer, rx_bytes_in);
rx_bytes_in = 0;
TRACE(( 1 , “ErideCore Exit %x”, gpsDataAvailMask));
}
}
else
{
adl_atSendResponse(ADL_AT_RSP,“It’s not working… why?! Who knows…” );
/* GPS not started yet, it means feature is not activated */
AppCGpsCoreCb(APP_CGPS_FEATURE_NOT_ACTIVATED);
/* Unsubscribe the timer */
adl_tmrUnSubscribe(AppLoopTimer, ERideAppLoop, ADL_TMR_TYPE_TICK);
/* Unsubscribe the FCM flow */
adl_fcmUnsubscribe(DataGPS_fcmHandle);
}
}
And in GpsState= I get nothing! Nothing at all… And every time i start my program it send “It’s not working… why?! Who knows…” Why GpsState is empty?