glhal/src/glgps_hal_net.c File Reference

Create the PGLOR,NET sentence to report network aiding and GPS results. More...

#include "../../glct/glct_crt_lib.h"
#include "glgpsapi.h"
#include "glgps_hal.h"
Include dependency graph for glgps_hal_net.c:

Functions

void GpsHalNrInit (void *pHal, pFunc_PrintPglorNet_t pFunc, int bFull)
 Initialize the PGLOR,NET data: provide the HAL and a callback function to handle the printing.
void GpsHalNrSetPosSource (GL_POS_SOURCE source)
 Sets the position source.
GL_POS_SOURCE GpsHalNrGetPosSource ()
 Gets the position source.
void GpsHalNrSetSessionType (PGLOR_NET_SESSION_TYPE t)
 Sets the session type.
PGLOR_NET_SESSION_TYPE GpsHalNrGetSessionType ()
 Gets the session type.
int GpsHalNrControl (int iFlags, unsigned long ulTimeOffsetMS)
 Control options:
void GpsHalNrFixStart (unsigned long ulFlags)
 Call this function when starting a request that will result in a $PGLOR,NET,pass/fail message.
void GpsHalNrFixEnd (unsigned long ulFlags)
 Indicate we got a fix (could be an unsuccessful fix).
void GpsHalNrProtocol (unsigned long ulFlag, unsigned long ulData)
 Report AGPS protocol progress. Use the PGLOR_NET_*** bits to describe the protocol.
void GpsHalNrSessionStart (int bClear)
 Report AGPS session is starting.
unsigned long GpsHalNrSessionStartTime ()
 Returns the session start time.
unsigned long GpsHalNrFixStartTime ()
 Returns the fix start time.
void GpsHalNrSessionEnd (unsigned long ulFlag, unsigned long ulData)
 Report AGPS session is ending: start removing attributes of the session.

Detailed Description

Create the PGLOR,NET sentence to report network aiding and GPS results.

The flags passed to GpsHalNr***() functions fall into these categories:

  • results: network pass/fail, fix pass/fail
  • description of the fix: single, perioric, MS-A, MS-B
  • description of the assistance provided: time, location, ephemeris, etc.

The flags are the logical OR of:

  • PGLOR_NET_RES_FIX_PASS Successful position fix
  • PGLOR_NET_RES_FIX_FAIL Failed position fix
  • PGLOR_NET_RES_PROTO_PASS Successful sending of protocol
  • PGLOR_NET_RES_PROTO_FAIL Error sending protocol
  • PGLOR_NET_FIX_SINGLE Single shot position fix
  • PGLOR_NET_FIX_PERIODIC Periodic position fix
  • PGLOR_NET_MSA_POSITION MSA position fix returned
  • PGLOR_NET_PROTO_RRLP RRLP is the protocol
  • PGLOR_NET_PROTO_RRC RRC is the protocol
  • PGLOR_NET_PROTO_SUPL SUPL is the protocol
  • PGLOR_NET_PROTO_LBS LBS is future
  • PGLOR_NET_PROTO_LTE LTE is future
  • PGLOR_NET_ASST_FINE_TIME Fine-time assistance
  • PGLOR_NET_ASST_FREQ Frequency aiding (CNTIN)
  • PGLOR_NET_ASST_LOCATION Reference location
  • PGLOR_NET_ASST_TIME Coarse time aiding
  • PGLOR_NET_ASST_EPH Ephemeris
  • PGLOR_NET_ASST_ACQ Acquisition assistance
  • PGLOR_NET_ASST_OTHER Almanac, ionospheric info, etc.

Or the flag can be:

  • PGLOR_NET_DONE Indicates EOS for non-assisted cases.

Function Documentation

int GpsHalNrControl ( int  iFlags,
unsigned long  ulTimeOffsetMS 
)

Control options:

  • FAKE - a successful GPS first fix becomes session done. Otherwise end of GPS run becomes session done.
  • DEBUG - Report internal details of the glgps_hal_net operations. Otherwise end of GPS run becomes session done.
void GpsHalNrFixStart ( unsigned long  ulFlags)

Call this function when starting a request that will result in a $PGLOR,NET,pass/fail message.

unsigned long GpsHalNrFixStartTime ( void  )

Returns the fix start time.

Returns zero if fix process has not been started.

void GpsHalNrInit ( void *  pHal,
pFunc_PrintPglorNet_t  cbPrint,
int  bFull 
)

Initialize the PGLOR,NET data: provide the HAL and a callback function to handle the printing.

  • pHal - Pointer to the HAL.
  • cbPrint - Set the callback invoked when there is a PGLOR,NET string.
  • bFull - 1 clears the GpsHalNrControl() flags also.
void GpsHalNrSessionEnd ( unsigned long  ulFlag,
unsigned long  ulData 
)

Report AGPS session is ending: start removing attributes of the session.

Handling of ulFlag is reversed in this function: the flags are removed.

void GpsHalNrSessionStart ( int  bClear)

Report AGPS session is starting.

You may use GpsHalNrProtocol() function to notify this event instead.

Parameters:
bClear[input] Clears the previous session completely. Otherwise, only the session start time will be updated.
unsigned long GpsHalNrSessionStartTime ( void  )

Returns the session start time.

Returns zero if session has not been started.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines