Onboard LTO

Onboard LTO Introduction

Onboard LTO is the computation of Long Term Orbits by the mobile device itself. The Onboard LTO data is called CBEE (Client-based Extended Ephemeris). The CBEE is computed by a separate excutable (the cbee_gen) that communicates with the GPS control task (the glgps).

This page discusses integration of Onboard LTO into the glgps, the Onboard LTO cbee_gen application, and synchronization between the two.

Integrating Onboard LTO into GLGPS

To integrate Onboard LTO, the GLL, HAL, and configuration files are affected.

  • GLL - The GLL must be built with Onboard LTO capabilities enabled. Due to the additional RAM requirements of Onboard LTO, the GLL can be built with and without the Onboard LTO capability.
  • Configuration - The glconfig.xml configuration file HAL-section needs these attributes. Many of the defaults value may be applicable.
    • EEDir - Directory of CBEE file. If this is empty, the value acLogDirectory is used.
    • EEFileName - File name of CBEE file. Defaults to cbee.cbee
    • CbeeGenAppPath - Directory and file name of the cbee_gen application
    • CbeeGenAppParam - Command line parameters for cbee_gen
    • CbeeSignalGenOnNewBE - If true, GpsHalEEInformGeneratorNewBE will be called when new BE is detected and is expected to inform cbee_gen. Default is false.
    • CbeeWriteNvmemOnNewBe - If true, NV RAM will be written whenever new BE is detected. Default is false.

Two reference designs are included in the SDK:
.../allPartners/deliverables/glhal/bcm4760/src/glgps_hal_ee.c (Linux-based)
.../allPartners/deliverables/glhal/win_xp/glgps_hal_ee.c (win-xp based)

CBEE_GEN - Generation of Onboard LTO

The cbee_gen application generates Onboard LTO/CBEE. It runs in the background.

CBEE data generation is a computationally intensive. Cbee_gen must cooperate with glgps and other user applications. To accomplish this, the priority of cbee_gen must be set to below that of the other applications.

Cbee_gen performs these basic tasks:

  • Parse command line parameters or configuration files (optional)
  • Initialize the HAL with GpsHalInit
  • Set it's priority to low/background.
  • Monitor the termination and new BE signals/messages
    • On new BE, Run the main CBEE generation task, EEMgr_Run, until it indicates it is complete.
    • On termination request, do any clean up and close the HAL with GpsHalClose

Generation of CBEE is done by function EEMgr_Run which uses the Extended Ephemeris Library (EEL) to perform the computations; therefore, cbee_gen must link with the EEL.

Two reference designs are included in the SDK:
.../allPartners/deliverables/cbee_gen/bcm4760/main.cpp (Linux-based)
.../allPartners/deliverables/cbee_gen/win_xp/main.cpp (win-xp-based)

The application must implement the following HAL functions:

Two reference designs are included in the SDK:
.../allPartners/deliverables/cbee_gen/bcm4760/glhal.c (Linux-based)
.../allPartners/deliverables/cbee_gen/win_xp/glhal.c (win-xp-based)

Synchronization between GLGPS and CBEE_GEN

glgps_cbee.gif

The above figure shows the data and event flow between glgps and cbee_gen. Since these two applications run simultaneously, there are possible race-conditions:

  • cbee_gen might read from NV RAM while glgps is writing to it. To handle this condition, NV RAM has a checksum. After each read of NV RAM, within the EEL cbee_gen checks the checksum. If the race condition has occurred, the checksum will not pass. In this case, cbee_gen will re-read the file.
  • glgps might read from cbee.cbee while cbee_gen is writing to it. As is done with NV RAM, the CBEE file has a checksum for each satellite. Within the GLL, the checksum is automatically checked. If it fails, the record is re-read the next second.

New BE (broadcast ephemeris) can be transmitted by the satellites at any time. Cbee_gen could be implemented to continually scan NV RAM for new BE, however, this is inefficient since many scans will find no new BE. Therefore, a signal has been implemented in the HAL which is triggered at the arrival of new BE. This is clearly a platform-specific operation. In this way, cbee_gen can sleep until the signal is triggered, wake up, read NV RAM to determine which satellites have new BE, and generate CBEE data for those new satellites.

Likewise, cbee_gen is not necessarily aware of when it should gracefully exit. The HAL has been implemented with the GpsHalEEStopGenerator call. This call signals cbee_gen to terminate. If cbee_gen is currently generating CBEE data it cannot stop immediately. Calling EEMgr_AbortGeneration will cause the EEMgr_Run function to end once the current iteration of its generation loops completes (typically within a millisecond). To immediately exit cbee_gen, it must use a multi-threaded or interrupt-driven architecture.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines