mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
Merge branch 'conditional-modemmanager' into 'master'
gnss: Support using ofono when compiled with HAVE_MMGLIB Closes #16 See merge request mobian1/devices/eg25-manager!26
This commit is contained in:
35
src/gnss.c
35
src/gnss.c
@@ -27,13 +27,26 @@ gboolean gnss_upload_assistance_data(struct EG25Manager *manager)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* data upload isn't necessary to bring the modem onine, so we should wait
|
||||||
|
* until we've finished the rest of our configuration */
|
||||||
|
if (!manager->modem_iface ||
|
||||||
|
manager->modem_state < EG25_STATE_CONFIGURED ||
|
||||||
|
manager->modem_state > EG25_STATE_CONNECTED) {
|
||||||
|
g_message ("Rescheduling upload since modem isn't online yet, in %ds",
|
||||||
|
RESCHEDULE_IN_SECS);
|
||||||
|
manager->gnss_assistance_step = EG25_GNSS_STEP_LAST;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MMGLIB
|
||||||
/* ModemManager's Location is only available after unlocking */
|
/* ModemManager's Location is only available after unlocking */
|
||||||
if(!manager->mm_location) {
|
if(manager->modem_iface == MODEM_IFACE_MODEMMANAGER && !manager->mm_location) {
|
||||||
g_message ("Rescheduling upload since Location interface is not available, in %ds",
|
g_message ("Rescheduling upload since Location interface is not available, in %ds",
|
||||||
RESCHEDULE_IN_SECS);
|
RESCHEDULE_IN_SECS);
|
||||||
manager->gnss_assistance_step = EG25_GNSS_STEP_LAST;
|
manager->gnss_assistance_step = EG25_GNSS_STEP_LAST;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
manager->gnss_assistance_step = EG25_GNSS_STEP_FIRST;
|
manager->gnss_assistance_step = EG25_GNSS_STEP_FIRST;
|
||||||
gnss_step(manager);
|
gnss_step(manager);
|
||||||
@@ -423,10 +436,12 @@ void gnss_step(struct EG25Manager *manager)
|
|||||||
|
|
||||||
#ifdef HAVE_MMGLIB
|
#ifdef HAVE_MMGLIB
|
||||||
case EG25_GNSS_STEP_MM_GNSS_DISABLE:
|
case EG25_GNSS_STEP_MM_GNSS_DISABLE:
|
||||||
g_message("GNSS assistance upload step (%d/%d): "
|
if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
|
||||||
"disabling GNSS engine through ModemManager",
|
g_message("GNSS assistance upload step (%d/%d): "
|
||||||
manager->gnss_assistance_step, EG25_GNSS_STEP_LAST);
|
"disabling GNSS engine through ModemManager",
|
||||||
disable_mm_gnss(manager);
|
manager->gnss_assistance_step, EG25_GNSS_STEP_LAST);
|
||||||
|
disable_mm_gnss(manager);
|
||||||
|
}
|
||||||
manager->gnss_assistance_step++;
|
manager->gnss_assistance_step++;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
#endif
|
#endif
|
||||||
@@ -466,10 +481,12 @@ void gnss_step(struct EG25Manager *manager)
|
|||||||
|
|
||||||
#ifdef HAVE_MMGLIB
|
#ifdef HAVE_MMGLIB
|
||||||
case EG25_GNSS_STEP_MM_GNSS_ENABLE:
|
case EG25_GNSS_STEP_MM_GNSS_ENABLE:
|
||||||
g_message("GNSS assistance upload step (%d/%d): "
|
if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
|
||||||
"re-enabling GNSS through ModemManager",
|
g_message("GNSS assistance upload step (%d/%d): "
|
||||||
manager->gnss_assistance_step, EG25_GNSS_STEP_LAST);
|
"re-enabling GNSS through ModemManager",
|
||||||
enable_mm_gnss(manager);
|
manager->gnss_assistance_step, EG25_GNSS_STEP_LAST);
|
||||||
|
enable_mm_gnss(manager);
|
||||||
|
}
|
||||||
manager->gnss_assistance_step++;
|
manager->gnss_assistance_step++;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
#endif
|
#endif
|
||||||
|
@@ -48,10 +48,10 @@ enum EG25State {
|
|||||||
EG25_STATE_STARTED, // Modem has been started and declared itdata ready
|
EG25_STATE_STARTED, // Modem has been started and declared itdata ready
|
||||||
EG25_STATE_ACQUIRED, // Modem has been probed by ModemManager
|
EG25_STATE_ACQUIRED, // Modem has been probed by ModemManager
|
||||||
EG25_STATE_CONFIGURED, // Modem has been configured through AT commands
|
EG25_STATE_CONFIGURED, // Modem has been configured through AT commands
|
||||||
EG25_STATE_SUSPENDING, // System is going into suspend
|
|
||||||
EG25_STATE_RESUMING, // System is being resumed, waiting for modem to come back
|
|
||||||
EG25_STATE_REGISTERED, // Modem is unlocked and registered to a network provider
|
EG25_STATE_REGISTERED, // Modem is unlocked and registered to a network provider
|
||||||
EG25_STATE_CONNECTED, // Modem is connected (data connection active)
|
EG25_STATE_CONNECTED, // Modem is connected (data connection active)
|
||||||
|
EG25_STATE_SUSPENDING, // System is going into suspend
|
||||||
|
EG25_STATE_RESUMING, // System is being resumed, waiting for modem to come back
|
||||||
EG25_STATE_RESETTING, // Something went wrong, we're restarting the modem
|
EG25_STATE_RESETTING, // Something went wrong, we're restarting the modem
|
||||||
EG25_STATE_FINISHING
|
EG25_STATE_FINISHING
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user