mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
gnss: handle locked SIM
ModemManager Location service is only available after SIM unlock and network registration. Track service separately to avoid an assert error and crashes. GNSS assistance data is uploaded when the service becomes available.
This commit is contained in:
16
src/gnss.c
16
src/gnss.c
@@ -14,20 +14,30 @@
|
||||
|
||||
static void gnss_step(struct EG25Manager *manager);
|
||||
|
||||
void gnss_upload_assistance_data(struct EG25Manager *manager)
|
||||
gboolean gnss_upload_assistance_data(struct EG25Manager *manager)
|
||||
{
|
||||
if (!manager->gnss_assistance_enabled) {
|
||||
g_message("GNSS assistance is disabled!");
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (manager->gnss_assistance_step < EG25_GNSS_STEP_LAST) {
|
||||
g_warning("GNSS assistance data upload already in process (%d/%d)",
|
||||
manager->gnss_assistance_step, EG25_GNSS_STEP_LAST);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ModemManager's Location is only available after unlocking */
|
||||
if(!manager->mm_location) {
|
||||
g_message ("Rescheduling upload since Location interface is not available, in %ds",
|
||||
RESCHEDULE_IN_SECS);
|
||||
manager->gnss_assistance_step = EG25_GNSS_STEP_LAST;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
manager->gnss_assistance_step = EG25_GNSS_STEP_FIRST;
|
||||
gnss_step(manager);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void gnss_init(struct EG25Manager *manager, toml_table_t *config)
|
||||
|
Reference in New Issue
Block a user