libmm-glib: add methods to retrieve 'Bearers' property in Modem interface

This commit is contained in:
Ben Chan
2013-11-21 22:24:49 -08:00
committed by Aleksander Morgado
parent a787d1bbb8
commit e438221258
3 changed files with 44 additions and 0 deletions

View File

@@ -113,6 +113,8 @@ mm_modem_peek_unlock_retries
mm_modem_get_unlock_retries
mm_modem_get_max_bearers
mm_modem_get_max_active_bearers
mm_modem_get_bearer_paths
mm_modem_dup_bearer_paths
mm_modem_get_own_numbers
mm_modem_dup_own_numbers
mm_modem_peek_supported_modes

View File

@@ -340,6 +340,45 @@ mm_modem_get_max_active_bearers (MMModem *self)
/*****************************************************************************/
/**
* mm_modem_get_bearer_paths:
* @self: A #MMModem.
*
* Gets the DBus paths of the #MMBearer handled in this #MMModem.
*
* <warning>The returned value is only valid until the property changes so
* it is only safe to use this function on the thread where
* @self was constructed. Use mm_modem_dup_bearer_paths() if on another
* thread.</warning>
*
* Returns: (transfer none): The DBus paths of the #MMBearer handled in this #MMModem, or %NULL if none available. Do not free the returned value, it belongs to @self.
*/
const gchar * const *
mm_modem_get_bearer_paths (MMModem *self)
{
g_return_val_if_fail (MM_IS_MODEM (self), NULL);
return mm_gdbus_modem_get_bearers (MM_GDBUS_MODEM (self));
}
/**
* mm_modem_dup_bearer_paths:
* @self: A #MMModem.
*
* Gets a copy of the DBus paths of the #MMBearer handled in this #MMModem.
*
* Returns: (transfer full): The DBus paths of the #MMBearer handled in this #MMModem, or %NULL if none available. The returned value should be freed with g_strfreev().
*/
gchar **
mm_modem_dup_bearer_paths (MMModem *self)
{
g_return_val_if_fail (MM_IS_MODEM (self), NULL);
return mm_gdbus_modem_dup_bearers (MM_GDBUS_MODEM (self));
}
/*****************************************************************************/
/**
* mm_modem_get_manufacturer:
* @self: A #MMModem.

View File

@@ -87,6 +87,9 @@ guint mm_modem_get_max_bearers (MMModem *self);
guint mm_modem_get_max_active_bearers (MMModem *self);
const gchar * const *mm_modem_get_bearer_paths (MMModem *self);
gchar **mm_modem_dup_bearer_paths (MMModem *self);
const gchar *mm_modem_get_manufacturer (MMModem *self);
gchar *mm_modem_dup_manufacturer (MMModem *self);