iface-location: allow enabling without SIM

When the modem is in a failed state because of a SIM-related error,
like a missing SIM, or if the modem is SIM-locked, allow the
Location interface to initialize and be enabled anyway.

This allows someone without a SIM to use the GPS, which does not
particularly require a phone subscription. It also allows
someone with a SIM to use the GPS even if the SIM is still
locked.

This patch was reworked, while keeping the original idea, by:
Aleksander Morgado <aleksander@aleksander.es>

Fixes #183
This commit is contained in:
Raphaël Jakse
2023-12-11 12:37:42 +00:00
committed by Aleksander Morgado
parent 224c04065d
commit 63dd4ad263
5 changed files with 108 additions and 132 deletions
+7 -2
View File
@@ -1113,8 +1113,13 @@ typedef enum { /*< underscore_name=mm_sms_cdma_service_category >*/
* @MM_MODEM_LOCATION_SOURCE_GPS_NMEA: GPS location given as NMEA traces.
* @MM_MODEM_LOCATION_SOURCE_CDMA_BS: CDMA base station position.
* @MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED: No location given, just GPS module setup. Since 1.4.
* @MM_MODEM_LOCATION_SOURCE_AGPS_MSA: Mobile Station Assisted A-GPS location requested. Since 1.12.
* @MM_MODEM_LOCATION_SOURCE_AGPS_MSB: Mobile Station Based A-GPS location requested. Since 1.12.
* @MM_MODEM_LOCATION_SOURCE_AGPS_MSA: Mobile Station Assisted A-GPS location requested. In
* MSA A-GPS, the position fix is computed by a server online. The modem must have a valid SIM
* card inserted and be enabled for this mode to be allowed. Since 1.12.
* @MM_MODEM_LOCATION_SOURCE_AGPS_MSB: Mobile Station Based A-GPS location requested. In MSB
* A-GPS, the position fix is computed by the modem, but it first gathers information from an
* online server to facilitate the process (e.g. ephemeris). The modem must have a valid SIM
* card inserted and be enabled for this mode to be allowed. Since 1.12.
*
* Sources of location information supported by the modem.
*