iface-modem: add mm_iface_modem_get_unlock_retries helper

This patch adds a mm_iface_modem_get_unlock_retries helper for getting
the current MMUnlockRetries value of a MMIfaceModem object, which later
allows us to partially update (e.g. a specific MMModemLock) the
MMUnlockRetries value of a MMIfaceModem object.
This commit is contained in:
Ben Chan
2017-09-18 09:10:56 -07:00
committed by Aleksander Morgado
parent bb5cd9b4e2
commit 4f8e9e2e1c
2 changed files with 23 additions and 0 deletions

View File

@@ -2926,6 +2926,27 @@ set_lock_status (MMIfaceModem *self,
}
}
MMUnlockRetries *
mm_iface_modem_get_unlock_retries (MMIfaceModem *self)
{
MmGdbusModem *skeleton = NULL;
MMUnlockRetries *unlock_retries;
g_object_get (self,
MM_IFACE_MODEM_DBUS_SKELETON, &skeleton,
NULL);
if (skeleton) {
GVariant *dictionary;
dictionary = mm_gdbus_modem_get_unlock_retries (skeleton);
unlock_retries = mm_unlock_retries_new_from_dictionary (dictionary);
g_object_unref (skeleton);
} else
unlock_retries = mm_unlock_retries_new ();
return unlock_retries;
}
void
mm_iface_modem_update_unlock_retries (MMIfaceModem *self,
MMUnlockRetries *unlock_retries)

View File

@@ -414,6 +414,8 @@ MMModemLock mm_iface_modem_update_lock_info_finish (MMIfaceModem *self,
GAsyncResult *res,
GError **error);
MMUnlockRetries *mm_iface_modem_get_unlock_retries (MMIfaceModem *self);
void mm_iface_modem_update_unlock_retries (MMIfaceModem *self,
MMUnlockRetries *unlock_retries);