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.
To integrate Onboard LTO, the GLL, HAL, and configuration files are affected.
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)
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:
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)
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:
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.