diff options
author | Ben Chan <benchan@chromium.org> | 2013-11-21 22:24:49 -0800 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-11-22 08:35:41 +0100 |
commit | e4382212586447f63004db0fdd7df78243da582a (patch) | |
tree | 65c74424763bcd7d11c136565e8a53c81b0bdaa1 /libmm-glib/mm-modem.c | |
parent | a787d1bbb8460e577f1f32bda84f6c1b7420274e (diff) |
libmm-glib: add methods to retrieve 'Bearers' property in Modem interface
Diffstat (limited to 'libmm-glib/mm-modem.c')
-rw-r--r-- | libmm-glib/mm-modem.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c index c1dee3ac..213f679d 100644 --- a/libmm-glib/mm-modem.c +++ b/libmm-glib/mm-modem.c @@ -341,6 +341,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. * |