libmm-glib: handle simple Disconnect()

This commit is contained in:
Aleksander Morgado
2011-12-27 16:34:09 +01:00
parent adcc33d0ea
commit dd4b073e08
2 changed files with 53 additions and 11 deletions

View File

@@ -180,7 +180,7 @@ mm_modem_simple_connect_sync (MMModemSimple *self,
gchar *bearer_path = NULL; gchar *bearer_path = NULL;
GVariant *variant; GVariant *variant;
g_return_val_if_fail (MM_GDBUS_IS_MODEM (self), NULL); g_return_val_if_fail (MM_GDBUS_IS_MODEM_SIMPLE (self), NULL);
variant = mm_common_connect_properties_get_dictionary ( variant = mm_common_connect_properties_get_dictionary (
MM_COMMON_CONNECT_PROPERTIES (properties)); MM_COMMON_CONNECT_PROPERTIES (properties));
@@ -205,3 +205,43 @@ mm_modem_simple_connect_sync (MMModemSimple *self,
return bearer; return bearer;
} }
void
mm_modem_simple_disconnect (MMModemSimple *self,
const gchar *bearer_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_return_if_fail (MM_GDBUS_IS_MODEM_SIMPLE (self));
mm_gdbus_modem_simple_call_disconnect (self,
bearer_path ? bearer_path : "/",
cancellable,
callback,
user_data);
}
gboolean
mm_modem_simple_disconnect_finish (MMModemSimple *self,
GAsyncResult *res,
GError **error)
{
g_return_val_if_fail (MM_GDBUS_IS_MODEM_SIMPLE (self), FALSE);
return mm_gdbus_modem_simple_call_disconnect_finish (self, res, error);
}
gboolean
mm_modem_simple_disconnect_sync (MMModemSimple *self,
const gchar *bearer_path,
GCancellable *cancellable,
GError **error)
{
g_return_val_if_fail (MM_GDBUS_IS_MODEM_SIMPLE (self), FALSE);
return mm_gdbus_modem_simple_call_disconnect_sync (self,
bearer_path ? bearer_path : "/",
cancellable,
error);
}

View File

@@ -52,16 +52,18 @@ MMBearer *mm_modem_simple_connect_sync (MMModemSimple *self,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
/* void mm_modem_simple_disconnect (MMModemSimple *self, */ void mm_modem_simple_disconnect (MMModemSimple *self,
/* GCancellable *cancellable, */ const gchar *bearer_path,
/* GAsyncReadyCallback callback, */ GCancellable *cancellable,
/* gpointer user_data); */ GAsyncReadyCallback callback,
/* GList *mm_modem_simple_disconnect_finish (MMModemSimple *self, */ gpointer user_data);
/* GAsyncResult *res, */ gboolean mm_modem_simple_disconnect_finish (MMModemSimple *self,
/* GError **error); */ GAsyncResult *res,
/* GList *mm_modem_simple_disconnect_sync (MMModemSimple *self, */ GError **error);
/* GCancellable *cancellable, */ gboolean mm_modem_simple_disconnect_sync (MMModemSimple *self,
/* GError **error); */ const gchar *bearer_path,
GCancellable *cancellable,
GError **error);
G_END_DECLS G_END_DECLS