aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers-qmi.c
diff options
context:
space:
mode:
authorTorsten Hilbrich <torsten.hilbrich@secunet.com>2014-11-12 12:45:38 +0100
committerAleksander Morgado <aleksander@aleksander.es>2014-11-12 13:13:11 +0100
commitbc410ce03f6bfbfc970a89d79f200cece4c582de (patch)
tree87ea1ce1c104376cbce195b7041bb0dfbd7fb0ce /src/mm-modem-helpers-qmi.c
parentd44690489b57969bfdc44ebfcbfefce6cf3c5b42 (diff)
qmi: retrieve MM_MODEM_3GPP_FACILITY_SIM
This facility cannot be retrieved via 'DMS UIM Get CK Status' and seems currently unimplemented for mm-broadband-modem-qmi. The SIM enabled status is however available via 'DMS UIM Get PIN Status'. Using this message to add the retrieval of PIN status just after the other facilities were queried. Succesfully tested with Gobi2000 (05c6:9205), both retrieval of 3gpp SIM lock status and enabling/disabling the PIN.
Diffstat (limited to 'src/mm-modem-helpers-qmi.c')
-rw-r--r--src/mm-modem-helpers-qmi.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c
index c673697f..7e385320 100644
--- a/src/mm-modem-helpers-qmi.c
+++ b/src/mm-modem-helpers-qmi.c
@@ -98,6 +98,32 @@ mm_modem_lock_from_qmi_uim_pin_status (QmiDmsUimPinStatus status,
/*****************************************************************************/
+gboolean
+mm_pin_enabled_from_qmi_uim_pin_status (QmiDmsUimPinStatus status)
+{
+ switch (status) {
+ case QMI_DMS_UIM_PIN_STATUS_ENABLED_NOT_VERIFIED:
+ case QMI_DMS_UIM_PIN_STATUS_ENABLED_VERIFIED:
+ case QMI_DMS_UIM_PIN_STATUS_BLOCKED:
+ case QMI_DMS_UIM_PIN_STATUS_PERMANENTLY_BLOCKED:
+ case QMI_DMS_UIM_PIN_STATUS_UNBLOCKED:
+ case QMI_DMS_UIM_PIN_STATUS_CHANGED:
+ /* assume the PIN to be enabled then */
+ return TRUE;
+
+ case QMI_DMS_UIM_PIN_STATUS_DISABLED:
+ case QMI_DMS_UIM_PIN_STATUS_NOT_INITIALIZED:
+ /* assume the PIN to be disabled then */
+ return FALSE;
+
+ default:
+ /* by default assume disabled */
+ return FALSE;
+ }
+}
+
+/*****************************************************************************/
+
QmiDmsUimFacility
mm_3gpp_facility_to_qmi_uim_facility (MMModem3gppFacility mm)
{