libmm-glib: support for the 'OMA' interface
This commit is contained in:
@@ -115,6 +115,10 @@
|
||||
<xi:include href="xml/mm-modem-signal.xml"/>
|
||||
<xi:include href="xml/mm-signal.xml"/>
|
||||
</section>
|
||||
<section>
|
||||
<title>OMA support</title>
|
||||
<xi:include href="xml/mm-modem-oma.xml"/>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
@@ -56,6 +56,8 @@ mm_object_peek_modem_time
|
||||
mm_object_get_modem_time
|
||||
mm_object_peek_modem_firmware
|
||||
mm_object_get_modem_firmware
|
||||
mm_object_peek_modem_oma
|
||||
mm_object_get_modem_oma
|
||||
mm_object_peek_modem_simple
|
||||
mm_object_get_modem_simple
|
||||
mm_object_peek_modem_signal
|
||||
@@ -650,6 +652,44 @@ MM_TYPE_FIRMWARE_PROPERTIES
|
||||
mm_firmware_properties_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>mm-modem-oma</FILE>
|
||||
<TITLE>MMModemOma</TITLE>
|
||||
MMModemOma
|
||||
MMOmaPendingNetworkInitiatedSession
|
||||
<SUBSECTION Getters>
|
||||
mm_modem_oma_get_path
|
||||
mm_modem_oma_dup_path
|
||||
<SUBSECTION Methods>
|
||||
mm_modem_oma_setup
|
||||
mm_modem_oma_setup_finish
|
||||
mm_modem_oma_setup_sync
|
||||
mm_modem_oma_start_client_initiated_session
|
||||
mm_modem_oma_start_client_initiated_session_finish
|
||||
mm_modem_oma_start_client_initiated_session_sync
|
||||
mm_modem_oma_accept_network_initiated_session
|
||||
mm_modem_oma_accept_network_initiated_session_finish
|
||||
mm_modem_oma_accept_network_initiated_session_sync
|
||||
mm_modem_oma_cancel_session
|
||||
mm_modem_oma_cancel_session_finish
|
||||
mm_modem_oma_cancel_session_sync
|
||||
mm_modem_oma_get_features
|
||||
mm_modem_oma_get_session_type
|
||||
mm_modem_oma_get_session_state
|
||||
mm_modem_peek_pending_network_initiated_sessions
|
||||
mm_modem_get_pending_network_initiated_sessions
|
||||
<SUBSECTION Standard>
|
||||
MMModemOmaClass
|
||||
MMModemOmaPrivate
|
||||
MM_IS_MODEM_OMA
|
||||
MM_IS_MODEM_OMA_CLASS
|
||||
MM_MODEM_OMA
|
||||
MM_MODEM_OMA_CLASS
|
||||
MM_MODEM_OMA_GET_CLASS
|
||||
MM_TYPE_MODEM_OMA
|
||||
mm_modem_oma_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>mm-modem-simple</FILE>
|
||||
<TITLE>MMModemSimple</TITLE>
|
||||
@@ -1106,6 +1146,10 @@ mm_sms_delivery_state_get_string
|
||||
mm_sms_storage_get_string
|
||||
mm_sms_validity_type_get_string
|
||||
mm_firmware_image_type_get_string
|
||||
mm_oma_feature_build_string_from_mask
|
||||
mm_oma_session_type_get_string
|
||||
mm_oma_session_state_get_string
|
||||
mm_oma_session_state_failed_reason_get_string
|
||||
<SUBSECTION Private>
|
||||
mm_modem_capability_get_string
|
||||
mm_modem_lock_build_string_from_mask
|
||||
@@ -1135,6 +1179,10 @@ mm_modem_3gpp_network_availability_build_string_from_mask
|
||||
mm_modem_3gpp_ussd_session_state_build_string_from_mask
|
||||
mm_firmware_image_type_build_string_from_mask
|
||||
mm_modem_port_type_build_string_from_mask
|
||||
mm_oma_feature_get_string
|
||||
mm_oma_session_type_build_string_from_mask
|
||||
mm_oma_session_state_build_string_from_mask
|
||||
mm_oma_session_state_failed_reason_build_string_from_mask
|
||||
<SUBSECTION Standard>
|
||||
MM_TYPE_BEARER_IP_FAMILY
|
||||
MM_TYPE_BEARER_IP_METHOD
|
||||
@@ -1164,6 +1212,10 @@ MM_TYPE_SMS_PDU_TYPE
|
||||
MM_TYPE_SMS_STATE
|
||||
MM_TYPE_SMS_STORAGE
|
||||
MM_TYPE_SMS_VALIDITY_TYPE
|
||||
MM_TYPE_OMA_FEATURE
|
||||
MM_TYPE_OMA_SESSION_STATE
|
||||
MM_TYPE_OMA_SESSION_STATE_FAILED_REASON
|
||||
MM_TYPE_OMA_SESSION_TYPE
|
||||
mm_bearer_ip_family_get_type
|
||||
mm_bearer_ip_method_get_type
|
||||
mm_bearer_allowed_auth_get_type
|
||||
@@ -1192,6 +1244,10 @@ mm_sms_pdu_type_get_type
|
||||
mm_sms_state_get_type
|
||||
mm_sms_storage_get_type
|
||||
mm_sms_validity_type_get_type
|
||||
mm_oma_feature_get_type
|
||||
mm_oma_session_state_failed_reason_get_type
|
||||
mm_oma_session_state_get_type
|
||||
mm_oma_session_type_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -2108,12 +2164,14 @@ mm_gdbus_modem_oma_call_setup_sync
|
||||
mm_gdbus_modem_oma_call_start_client_initiated_session
|
||||
mm_gdbus_modem_oma_call_start_client_initiated_session_finish
|
||||
mm_gdbus_modem_oma_call_start_client_initiated_session_sync
|
||||
mm_gdbus_modem_oma_get_features
|
||||
mm_gdbus_modem_oma_get_session_state
|
||||
mm_gdbus_modem_oma_get_session_type
|
||||
mm_gdbus_modem_oma_get_pending_network_initiated_sessions
|
||||
mm_gdbus_modem_oma_dup_pending_network_initiated_sessions
|
||||
<SUBSECTION Private>
|
||||
mm_gdbus_modem_oma_set_pending_network_initiated_sessions
|
||||
mm_gdbus_modem_oma_set_features
|
||||
mm_gdbus_modem_oma_set_session_state
|
||||
mm_gdbus_modem_oma_set_session_type
|
||||
mm_gdbus_modem_oma_emit_session_state_changed
|
||||
|
@@ -33,6 +33,9 @@ mm_gdbus_modem_location_skeleton_get_type
|
||||
mm_gdbus_modem_messaging_get_type
|
||||
mm_gdbus_modem_messaging_proxy_get_type
|
||||
mm_gdbus_modem_messaging_skeleton_get_type
|
||||
mm_gdbus_modem_oma_get_type
|
||||
mm_gdbus_modem_oma_proxy_get_type
|
||||
mm_gdbus_modem_oma_skeleton_get_type
|
||||
mm_gdbus_modem_proxy_get_type
|
||||
mm_gdbus_modem_signal_get_type
|
||||
mm_gdbus_modem_signal_proxy_get_type
|
||||
@@ -85,6 +88,7 @@ mm_modem_location_source_get_type
|
||||
mm_modem_lock_get_type
|
||||
mm_modem_messaging_get_type
|
||||
mm_modem_mode_get_type
|
||||
mm_modem_oma_get_type
|
||||
mm_modem_port_type_get_type
|
||||
mm_modem_power_state_get_type
|
||||
mm_modem_signal_get_type
|
||||
@@ -95,6 +99,10 @@ mm_modem_state_get_type
|
||||
mm_modem_time_get_type
|
||||
mm_network_timezone_get_type
|
||||
mm_object_get_type
|
||||
mm_oma_feature_get_type
|
||||
mm_oma_session_state_failed_reason_get_type
|
||||
mm_oma_session_state_get_type
|
||||
mm_oma_session_type_get_type
|
||||
mm_serial_error_get_type
|
||||
mm_sim_get_type
|
||||
mm_simple_connect_properties_get_type
|
||||
|
@@ -29,6 +29,8 @@ libmm_glib_la_SOURCES = \
|
||||
mm-modem-firmware.c \
|
||||
mm-modem-signal.h \
|
||||
mm-modem-signal.c \
|
||||
mm-modem-oma.h \
|
||||
mm-modem-oma.c \
|
||||
mm-sim.h \
|
||||
mm-sim.c \
|
||||
mm-sms.h \
|
||||
@@ -106,6 +108,7 @@ include_HEADERS = \
|
||||
mm-modem-time.h \
|
||||
mm-modem-firmware.h \
|
||||
mm-modem-signal.h \
|
||||
mm-modem-oma.h \
|
||||
mm-modem-simple.h \
|
||||
mm-sim.h \
|
||||
mm-sms.h \
|
||||
|
@@ -44,6 +44,7 @@
|
||||
# include <mm-modem-time.h>
|
||||
# include <mm-modem-firmware.h>
|
||||
# include <mm-modem-signal.h>
|
||||
# include <mm-modem-oma.h>
|
||||
#endif
|
||||
|
||||
#if defined (_LIBMM_INSIDE_MM) || \
|
||||
|
@@ -745,6 +745,86 @@ mm_common_build_mode_combinations_default (void)
|
||||
return g_variant_builder_end (&builder);
|
||||
}
|
||||
|
||||
GArray *
|
||||
mm_common_oma_pending_network_initiated_sessions_variant_to_garray (GVariant *variant)
|
||||
{
|
||||
GArray *array = NULL;
|
||||
|
||||
if (variant) {
|
||||
GVariantIter iter;
|
||||
guint n;
|
||||
|
||||
g_variant_iter_init (&iter, variant);
|
||||
n = g_variant_iter_n_children (&iter);
|
||||
|
||||
if (n > 0) {
|
||||
MMOmaPendingNetworkInitiatedSession session;
|
||||
|
||||
array = g_array_sized_new (FALSE, FALSE, sizeof (MMOmaPendingNetworkInitiatedSession), n);
|
||||
while (g_variant_iter_loop (&iter, "(uu)", &session.session_type, &session.session_id))
|
||||
g_array_append_val (array, session);
|
||||
}
|
||||
}
|
||||
|
||||
/* If nothing set, fallback to empty */
|
||||
if (!array)
|
||||
array = g_array_new (FALSE, FALSE, sizeof (MMOmaPendingNetworkInitiatedSession));
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
MMOmaPendingNetworkInitiatedSession *
|
||||
mm_common_oma_pending_network_initiated_sessions_variant_to_array (GVariant *variant,
|
||||
guint *n_sessions)
|
||||
{
|
||||
GArray *array;
|
||||
|
||||
array = mm_common_oma_pending_network_initiated_sessions_variant_to_garray (variant);
|
||||
if (n_sessions)
|
||||
*n_sessions = array->len;
|
||||
return (MMOmaPendingNetworkInitiatedSession *) g_array_free (array, FALSE);
|
||||
}
|
||||
|
||||
GVariant *
|
||||
mm_common_oma_pending_network_initiated_sessions_array_to_variant (const MMOmaPendingNetworkInitiatedSession *sessions,
|
||||
guint n_sessions)
|
||||
{
|
||||
if (n_sessions > 0) {
|
||||
GVariantBuilder builder;
|
||||
guint i;
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(uu)"));
|
||||
|
||||
for (i = 0; i < n_sessions; i++)
|
||||
g_variant_builder_add_value (&builder,
|
||||
g_variant_new ("(uu)",
|
||||
((guint32)sessions[i].session_type),
|
||||
((guint32)sessions[i].session_id)));
|
||||
return g_variant_builder_end (&builder);
|
||||
}
|
||||
|
||||
return mm_common_build_oma_pending_network_initiated_sessions_default ();
|
||||
}
|
||||
|
||||
GVariant *
|
||||
mm_common_oma_pending_network_initiated_sessions_garray_to_variant (GArray *array)
|
||||
{
|
||||
if (array)
|
||||
return mm_common_oma_pending_network_initiated_sessions_array_to_variant ((const MMOmaPendingNetworkInitiatedSession *)array->data,
|
||||
array->len);
|
||||
|
||||
return mm_common_oma_pending_network_initiated_sessions_array_to_variant (NULL, 0);
|
||||
}
|
||||
|
||||
GVariant *
|
||||
mm_common_build_oma_pending_network_initiated_sessions_default (void)
|
||||
{
|
||||
GVariantBuilder builder;
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(uu)"));
|
||||
return g_variant_builder_end (&builder);
|
||||
}
|
||||
|
||||
gboolean
|
||||
mm_common_get_boolean_from_string (const gchar *value,
|
||||
GError **error)
|
||||
|
@@ -103,6 +103,14 @@ GVariant *mm_common_capability_combinations_garray_to_variant (GArray *
|
||||
GVariant *mm_common_build_capability_combinations_any (void);
|
||||
GVariant *mm_common_build_capability_combinations_none (void);
|
||||
|
||||
GArray *mm_common_oma_pending_network_initiated_sessions_variant_to_garray (GVariant *variant);
|
||||
MMOmaPendingNetworkInitiatedSession *mm_common_oma_pending_network_initiated_sessions_variant_to_array (GVariant *variant,
|
||||
guint *n_modes);
|
||||
GVariant *mm_common_oma_pending_network_initiated_sessions_array_to_variant (const MMOmaPendingNetworkInitiatedSession *modes,
|
||||
guint n_modes);
|
||||
GVariant *mm_common_oma_pending_network_initiated_sessions_garray_to_variant (GArray *array);
|
||||
GVariant *mm_common_build_oma_pending_network_initiated_sessions_default (void);
|
||||
|
||||
typedef gboolean (*MMParseKeyValueForeachFn) (const gchar *key,
|
||||
const gchar *value,
|
||||
gpointer user_data);
|
||||
|
@@ -59,4 +59,18 @@ struct _MMModemPortInfo {
|
||||
void mm_modem_port_info_array_free (MMModemPortInfo *array,
|
||||
guint array_size);
|
||||
|
||||
/**
|
||||
* MMOmaPendingNetworkInitiatedSession:
|
||||
* @session_type: A #MMOmaSessionType.
|
||||
* @session_id: Unique ID of the network-initiated OMA session.
|
||||
*
|
||||
* #MMOmaPendingNetworkInitiatedSession is a simple struct specifying the
|
||||
* information available for a pending network-initiated OMA session.
|
||||
*/
|
||||
typedef struct _MMOmaPendingNetworkInitiatedSession MMOmaPendingNetworkInitiatedSession;
|
||||
struct _MMOmaPendingNetworkInitiatedSession {
|
||||
MMOmaSessionType session_type;
|
||||
guint session_id;
|
||||
};
|
||||
|
||||
#endif /* _MM_HELPER_TYPES_H_ */
|
||||
|
@@ -72,6 +72,7 @@ get_proxy_type (GDBusObjectManagerClient *manager,
|
||||
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Time", GSIZE_TO_POINTER (MM_TYPE_MODEM_TIME));
|
||||
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Signal", GSIZE_TO_POINTER (MM_TYPE_MODEM_SIGNAL));
|
||||
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Firmware", GSIZE_TO_POINTER (MM_TYPE_MODEM_FIRMWARE));
|
||||
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Oma", GSIZE_TO_POINTER (MM_TYPE_MODEM_OMA));
|
||||
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.ModemCdma", GSIZE_TO_POINTER (MM_TYPE_MODEM_CDMA));
|
||||
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Modem3gpp", GSIZE_TO_POINTER (MM_TYPE_MODEM_3GPP));
|
||||
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd", GSIZE_TO_POINTER (MM_TYPE_MODEM_3GPP_USSD));
|
||||
|
592
libmm-glib/mm-modem-oma.c
Normal file
592
libmm-glib/mm-modem-oma.c
Normal file
@@ -0,0 +1,592 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* libmm -- Access modem status & information from glib applications
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2013 Google, Inc.
|
||||
*/
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mm-helpers.h"
|
||||
#include "mm-errors-types.h"
|
||||
#include "mm-modem-oma.h"
|
||||
|
||||
/**
|
||||
* SECTION: mm-modem-oma
|
||||
* @title: MMModemOma
|
||||
* @short_description: The OMA interface
|
||||
*
|
||||
* The #MMModemOma is an object providing access to the methods, signals and
|
||||
* properties of the OMA interface.
|
||||
*
|
||||
* The OMA interface is exposed whenever a modem has OMA device management capabilities.
|
||||
*/
|
||||
|
||||
G_DEFINE_TYPE (MMModemOma, mm_modem_oma, MM_GDBUS_TYPE_MODEM_OMA_PROXY)
|
||||
|
||||
struct _MMModemOmaPrivate {
|
||||
/* Supported Modes */
|
||||
GMutex pending_network_initiated_sessions_mutex;
|
||||
guint pending_network_initiated_sessions_id;
|
||||
GArray *pending_network_initiated_sessions;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_get_path:
|
||||
* @self: A #MMModemOma.
|
||||
*
|
||||
* Gets the DBus path of the #MMObject which implements this interface.
|
||||
*
|
||||
* Returns: (transfer none): The DBus path of the #MMObject object.
|
||||
*/
|
||||
const gchar *
|
||||
mm_modem_oma_get_path (MMModemOma *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), NULL);
|
||||
|
||||
RETURN_NON_EMPTY_CONSTANT_STRING (
|
||||
g_dbus_proxy_get_object_path (G_DBUS_PROXY (self)));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_dup_path:
|
||||
* @self: A #MMModemOma.
|
||||
*
|
||||
* Gets a copy of the DBus path of the #MMObject object which implements this interface.
|
||||
*
|
||||
* Returns: (transfer full): The DBus path of the #MMObject. The returned value should be freed with g_free().
|
||||
*/
|
||||
gchar *
|
||||
mm_modem_oma_dup_path (MMModemOma *self)
|
||||
{
|
||||
gchar *value;
|
||||
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), NULL);
|
||||
|
||||
g_object_get (G_OBJECT (self),
|
||||
"g-object-path", &value,
|
||||
NULL);
|
||||
RETURN_NON_EMPTY_STRING (value);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_setup_finish:
|
||||
* @self: A #MMModemOma.
|
||||
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_oma_setup().
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Finishes an operation started with mm_modem_oma_setup().
|
||||
*
|
||||
* Returns: %TRUE if the setup was successful, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_setup_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_setup_finish (MM_GDBUS_MODEM_OMA (self), res, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_setup:
|
||||
* @self: A #MMModemOma.
|
||||
* @features: Mask of #MMOmaFeatures to enable.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
|
||||
* @user_data: User data to pass to @callback.
|
||||
*
|
||||
* Asynchronously sets up the OMA device management service.
|
||||
*
|
||||
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
|
||||
* You can then call mm_modem_oma_setup_finish() to get the result of the operation.
|
||||
*
|
||||
* See mm_modem_oma_setup_sync() for the synchronous, blocking version of this method.
|
||||
*/
|
||||
void
|
||||
mm_modem_oma_setup (MMModemOma *self,
|
||||
MMOmaFeature features,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (MM_IS_MODEM_OMA (self));
|
||||
|
||||
mm_gdbus_modem_oma_call_setup (MM_GDBUS_MODEM_OMA (self), features, cancellable, callback, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_setup_sync:
|
||||
* @self: A #MMModemOma.
|
||||
* @features: Mask of #MMOmaFeatures to enable.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Synchronously sets up the OMA device management service.
|
||||
*
|
||||
* The calling thread is blocked until a reply is received. See mm_modem_oma_setup()
|
||||
* for the asynchronous version of this method.
|
||||
*
|
||||
* Returns: %TRUE if the setup was successful, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_setup_sync (MMModemOma *self,
|
||||
MMOmaFeature features,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_setup_sync (MM_GDBUS_MODEM_OMA (self), features, cancellable, error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_start_client_initiated_session_finish:
|
||||
* @self: A #MMModemOma.
|
||||
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_oma_start_client_initiated_session().
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Finishes an operation started with mm_modem_oma_start_client_initiated_session().
|
||||
*
|
||||
* Returns: %TRUE if the session was started, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_start_client_initiated_session_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_start_client_initiated_session_finish (MM_GDBUS_MODEM_OMA (self), res, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_start_client_initiated_session:
|
||||
* @self: A #MMModemOma.
|
||||
* @session_type: A #MMOmaSessionType.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
|
||||
* @user_data: User data to pass to @callback.
|
||||
*
|
||||
* Asynchronously starts a client-initiated OMA device management session.
|
||||
*
|
||||
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
|
||||
* You can then call mm_modem_oma_start_client_initiated_session_finish() to get the result of the operation.
|
||||
*
|
||||
* See mm_modem_oma_start_client_initiated_session_sync() for the synchronous, blocking version of this method.
|
||||
*/
|
||||
void
|
||||
mm_modem_oma_start_client_initiated_session (MMModemOma *self,
|
||||
MMOmaSessionType session_type,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (MM_IS_MODEM_OMA (self));
|
||||
|
||||
mm_gdbus_modem_oma_call_start_client_initiated_session (MM_GDBUS_MODEM_OMA (self), session_type, cancellable, callback, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_start_client_initiated_session_sync:
|
||||
* @self: A #MMModemOma.
|
||||
* @session_type: A #MMOmaSessionType.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Synchronously starts a client-initiated OMA device management session.
|
||||
*
|
||||
* The calling thread is blocked until a reply is received. See mm_modem_oma_start_client_initiated_session()
|
||||
* for the asynchronous version of this method.
|
||||
*
|
||||
* Returns: %TRUE if the session was started, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_start_client_initiated_session_sync (MMModemOma *self,
|
||||
MMOmaSessionType session_type,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_start_client_initiated_session_sync (MM_GDBUS_MODEM_OMA (self), session_type, cancellable, error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_accept_network_initiated_session_finish:
|
||||
* @self: A #MMModemOma.
|
||||
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_oma_accept_network_initiated_session().
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Finishes an operation started with mm_modem_oma_accept_network_initiated_session().
|
||||
*
|
||||
* Returns: %TRUE if the session was started, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_accept_network_initiated_session_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_accept_network_initiated_session_finish (MM_GDBUS_MODEM_OMA (self), res, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_accept_network_initiated_session:
|
||||
* @self: A #MMModemOma.
|
||||
* @session_id: The unique ID of the network-initiated session.
|
||||
* @accept: %TRUE if the session is to be accepted, %FALSE otherwise.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
|
||||
* @user_data: User data to pass to @callback.
|
||||
*
|
||||
* Asynchronously accepts a nework-initiated OMA device management session.
|
||||
*
|
||||
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
|
||||
* You can then call mm_modem_oma_accept_network_initiated_session_finish() to get the result of the operation.
|
||||
*
|
||||
* See mm_modem_oma_accept_network_initiated_session_sync() for the synchronous, blocking version of this method.
|
||||
*/
|
||||
void
|
||||
mm_modem_oma_accept_network_initiated_session (MMModemOma *self,
|
||||
guint session_id,
|
||||
gboolean accept,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (MM_IS_MODEM_OMA (self));
|
||||
|
||||
mm_gdbus_modem_oma_call_accept_network_initiated_session (MM_GDBUS_MODEM_OMA (self), session_id, accept, cancellable, callback, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_accept_network_initiated_session_sync:
|
||||
* @self: A #MMModemOma.
|
||||
* @session_id: The unique ID of the network-initiated session.
|
||||
* @accept: %TRUE if the session is to be accepted, %FALSE otherwise.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Synchronously accepts a nework-initiated OMA device management session.
|
||||
*
|
||||
* The calling thread is blocked until a reply is received. See mm_modem_oma_accept_network_initiated_session()
|
||||
* for the asynchronous version of this method.
|
||||
*
|
||||
* Returns: %TRUE if the session was started, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_accept_network_initiated_session_sync (MMModemOma *self,
|
||||
guint session_id,
|
||||
gboolean accept,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_accept_network_initiated_session_sync (MM_GDBUS_MODEM_OMA (self), session_id, accept, cancellable, error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_cancel_session_finish:
|
||||
* @self: A #MMModemOma.
|
||||
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to mm_modem_oma_cancel_session().
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Finishes an operation started with mm_modem_oma_cancel_session().
|
||||
*
|
||||
* Returns: %TRUE if the session was started, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_cancel_session_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_cancel_session_finish (MM_GDBUS_MODEM_OMA (self), res, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_cancel_session:
|
||||
* @self: A #MMModemOma.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
|
||||
* @user_data: User data to pass to @callback.
|
||||
*
|
||||
* Asynchronously cancels the current OMA device management session.
|
||||
*
|
||||
* When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
|
||||
* You can then call mm_modem_oma_cancel_session_finish() to get the result of the operation.
|
||||
*
|
||||
* See mm_modem_oma_cancel_session_sync() for the synchronous, blocking version of this method.
|
||||
*/
|
||||
void
|
||||
mm_modem_oma_cancel_session (MMModemOma *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (MM_IS_MODEM_OMA (self));
|
||||
|
||||
mm_gdbus_modem_oma_call_cancel_session (MM_GDBUS_MODEM_OMA (self), cancellable, callback, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_oma_cancel_session_sync:
|
||||
* @self: A #MMModemOma.
|
||||
* @cancellable: (allow-none): A #GCancellable or %NULL.
|
||||
* @error: Return location for error or %NULL.
|
||||
*
|
||||
* Synchronously cancels the current OMA device management session.
|
||||
*
|
||||
* The calling thread is blocked until a reply is received. See mm_modem_oma_cancel_session()
|
||||
* for the asynchronous version of this method.
|
||||
*
|
||||
* Returns: %TRUE if the session was started, %FALSE if @error is set.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_oma_cancel_session_sync (MMModemOma *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
|
||||
return mm_gdbus_modem_oma_call_cancel_session_sync (MM_GDBUS_MODEM_OMA (self), cancellable, error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_get_features:
|
||||
* @self: A #MMModemOma.
|
||||
*
|
||||
* Gets the currently enabled OMA features.
|
||||
*
|
||||
* Returns: a bitmask of #MMOmaFeature values.
|
||||
*/
|
||||
MMOmaFeature
|
||||
mm_modem_oma_get_features (MMModemOma *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), MM_OMA_SESSION_TYPE_UNKNOWN);
|
||||
|
||||
return (MMOmaFeature) mm_gdbus_modem_oma_get_features (MM_GDBUS_MODEM_OMA (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_get_session_type:
|
||||
* @self: A #MMModemOma.
|
||||
*
|
||||
* Gets the type of the current OMA device management session.
|
||||
*
|
||||
* Returns: a #MMOmaSessionType.
|
||||
*/
|
||||
MMOmaSessionType
|
||||
mm_modem_oma_get_session_type (MMModemOma *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), MM_OMA_SESSION_TYPE_UNKNOWN);
|
||||
|
||||
return (MMOmaSessionType) mm_gdbus_modem_oma_get_session_type (MM_GDBUS_MODEM_OMA (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_oma_get_session_state:
|
||||
* @self: A #MMModemOma.
|
||||
*
|
||||
* Gets the state of the current OMA device management session.
|
||||
*
|
||||
* Returns: a #MMOmaSessionState.
|
||||
*/
|
||||
MMOmaSessionState
|
||||
mm_modem_oma_get_session_state (MMModemOma *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), MM_OMA_SESSION_STATE_UNKNOWN);
|
||||
|
||||
return (MMOmaSessionType) mm_gdbus_modem_oma_get_session_state (MM_GDBUS_MODEM_OMA (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
pending_network_initiated_sessions_updated (MMModemOma *self,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
g_mutex_lock (&self->priv->pending_network_initiated_sessions_mutex);
|
||||
{
|
||||
GVariant *dictionary;
|
||||
|
||||
if (self->priv->pending_network_initiated_sessions)
|
||||
g_array_unref (self->priv->pending_network_initiated_sessions);
|
||||
|
||||
dictionary = mm_gdbus_modem_oma_get_pending_network_initiated_sessions (MM_GDBUS_MODEM_OMA (self));
|
||||
self->priv->pending_network_initiated_sessions = (dictionary ?
|
||||
mm_common_oma_pending_network_initiated_sessions_variant_to_garray (dictionary) :
|
||||
NULL);
|
||||
}
|
||||
g_mutex_unlock (&self->priv->pending_network_initiated_sessions_mutex);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ensure_internal_pending_network_initiated_sessions (MMModemOma *self,
|
||||
MMOmaPendingNetworkInitiatedSession **dup_sessions,
|
||||
guint *dup_sessions_n)
|
||||
{
|
||||
gboolean ret;
|
||||
|
||||
g_mutex_lock (&self->priv->pending_network_initiated_sessions_mutex);
|
||||
{
|
||||
/* If this is the first time ever asking for the array, setup the
|
||||
* update listener and the initial array, if any. */
|
||||
if (!self->priv->pending_network_initiated_sessions_id) {
|
||||
GVariant *dictionary;
|
||||
|
||||
dictionary = mm_gdbus_modem_oma_dup_pending_network_initiated_sessions (MM_GDBUS_MODEM_OMA (self));
|
||||
if (dictionary) {
|
||||
self->priv->pending_network_initiated_sessions = mm_common_oma_pending_network_initiated_sessions_variant_to_garray (dictionary);
|
||||
g_variant_unref (dictionary);
|
||||
}
|
||||
|
||||
/* No need to clear this signal connection when freeing self */
|
||||
self->priv->pending_network_initiated_sessions_id =
|
||||
g_signal_connect (self,
|
||||
"notify::pending-network-initiated-sessions",
|
||||
G_CALLBACK (pending_network_initiated_sessions_updated),
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (!self->priv->pending_network_initiated_sessions)
|
||||
ret = FALSE;
|
||||
else {
|
||||
ret = TRUE;
|
||||
|
||||
if (dup_sessions && dup_sessions_n) {
|
||||
*dup_sessions_n = self->priv->pending_network_initiated_sessions->len;
|
||||
if (self->priv->pending_network_initiated_sessions->len > 0) {
|
||||
*dup_sessions = g_malloc (sizeof (MMOmaPendingNetworkInitiatedSession) * self->priv->pending_network_initiated_sessions->len);
|
||||
memcpy (*dup_sessions, self->priv->pending_network_initiated_sessions->data, sizeof (MMOmaPendingNetworkInitiatedSession) * self->priv->pending_network_initiated_sessions->len);
|
||||
} else
|
||||
*dup_sessions = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
g_mutex_unlock (&self->priv->pending_network_initiated_sessions_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_get_pending_network_initiated_sessions:
|
||||
* @self: A #MMModem.
|
||||
* @sessions: (out) (array length=n_sessions): Return location for the array of #MMOmaPendingNetworkInitiatedSession structs. The returned array should be freed with g_free() when no longer needed.
|
||||
* @n_sessions: (out): Return location for the number of values in @sessions.
|
||||
*
|
||||
* Gets the list of pending network-initiated OMA sessions.
|
||||
*
|
||||
* Returns: %TRUE if @sessions and @n_sessions are set, %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_get_pending_network_initiated_sessions (MMModemOma *self,
|
||||
MMOmaPendingNetworkInitiatedSession **sessions,
|
||||
guint *n_sessions)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
g_return_val_if_fail (sessions != NULL, FALSE);
|
||||
g_return_val_if_fail (n_sessions != NULL, FALSE);
|
||||
|
||||
return ensure_internal_pending_network_initiated_sessions (self, sessions, n_sessions);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_modem_peek_pending_network_initiated_sessions:
|
||||
* @self: A #MMModem.
|
||||
* @sessions: (out) (array length=n_sessions): Return location for the array of #MMOmaPendingNetworkInitiatedSession values. Do not free the returned array, it is owned by @self.
|
||||
* @n_sessions: (out): Return location for the number of values in @sessions.
|
||||
*
|
||||
* Gets the list of pending network-initiated OMA sessions.
|
||||
*
|
||||
* Returns: %TRUE if @sessions and @n_sessions are set, %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
mm_modem_peek_pending_network_initiated_sessions (MMModemOma *self,
|
||||
const MMOmaPendingNetworkInitiatedSession **sessions,
|
||||
guint *n_sessions)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_MODEM_OMA (self), FALSE);
|
||||
g_return_val_if_fail (sessions != NULL, FALSE);
|
||||
g_return_val_if_fail (n_sessions != NULL, FALSE);
|
||||
|
||||
if (!ensure_internal_pending_network_initiated_sessions (self, NULL, NULL))
|
||||
return FALSE;
|
||||
|
||||
*n_sessions = self->priv->pending_network_initiated_sessions->len;
|
||||
*sessions = (MMOmaPendingNetworkInitiatedSession *)self->priv->pending_network_initiated_sessions->data;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
mm_modem_oma_init (MMModemOma *self)
|
||||
{
|
||||
/* Setup private data */
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
MM_TYPE_MODEM_OMA,
|
||||
MMModemOmaPrivate);
|
||||
g_mutex_init (&self->priv->pending_network_initiated_sessions_mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
finalize (GObject *object)
|
||||
{
|
||||
MMModemOma *self = MM_MODEM_OMA (object);
|
||||
|
||||
g_mutex_clear (&self->priv->pending_network_initiated_sessions_mutex);
|
||||
|
||||
if (self->priv->pending_network_initiated_sessions)
|
||||
g_array_unref (self->priv->pending_network_initiated_sessions);
|
||||
|
||||
G_OBJECT_CLASS (mm_modem_oma_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
mm_modem_oma_class_init (MMModemOmaClass *modem_class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (modem_class);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMModemOmaPrivate));
|
||||
|
||||
/* Virtual methods */
|
||||
object_class->finalize = finalize;
|
||||
}
|
136
libmm-glib/mm-modem-oma.h
Normal file
136
libmm-glib/mm-modem-oma.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* libmm -- Access modem status & information from glib applications
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2013 Google, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _MM_MODEM_OMA_H_
|
||||
#define _MM_MODEM_OMA_H_
|
||||
|
||||
#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
|
||||
#error "Only <libmm-glib.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <ModemManager.h>
|
||||
|
||||
#include "mm-helper-types.h"
|
||||
#include "mm-common-helpers.h"
|
||||
#include "mm-gdbus-modem.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define MM_TYPE_MODEM_OMA (mm_modem_oma_get_type ())
|
||||
#define MM_MODEM_OMA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_MODEM_OMA, MMModemOma))
|
||||
#define MM_MODEM_OMA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_MODEM_OMA, MMModemOmaClass))
|
||||
#define MM_IS_MODEM_OMA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_MODEM_OMA))
|
||||
#define MM_IS_MODEM_OMA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MM_TYPE_MODEM_OMA))
|
||||
#define MM_MODEM_OMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_MODEM_OMA, MMModemOmaClass))
|
||||
|
||||
typedef struct _MMModemOma MMModemOma;
|
||||
typedef struct _MMModemOmaClass MMModemOmaClass;
|
||||
typedef struct _MMModemOmaPrivate MMModemOmaPrivate;
|
||||
|
||||
/**
|
||||
* MMModemOma:
|
||||
*
|
||||
* The #MMModemOma structure contains private data and should only be accessed
|
||||
* using the provided API.
|
||||
*/
|
||||
struct _MMModemOma {
|
||||
/*< private >*/
|
||||
MmGdbusModemOmaProxy parent;
|
||||
MMModemOmaPrivate *priv;
|
||||
};
|
||||
|
||||
struct _MMModemOmaClass {
|
||||
/*< private >*/
|
||||
MmGdbusModemOmaProxyClass parent;
|
||||
};
|
||||
|
||||
GType mm_modem_oma_get_type (void);
|
||||
|
||||
const gchar *mm_modem_oma_get_path (MMModemOma *self);
|
||||
gchar *mm_modem_oma_dup_path (MMModemOma *self);
|
||||
|
||||
void mm_modem_oma_setup (MMModemOma *self,
|
||||
MMOmaFeature features,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_modem_oma_setup_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
gboolean mm_modem_oma_setup_sync (MMModemOma *self,
|
||||
MMOmaFeature features,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void mm_modem_oma_start_client_initiated_session (MMModemOma *self,
|
||||
MMOmaSessionType session_type,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_modem_oma_start_client_initiated_session_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
gboolean mm_modem_oma_start_client_initiated_session_sync (MMModemOma *self,
|
||||
MMOmaSessionType session_type,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void mm_modem_oma_accept_network_initiated_session (MMModemOma *self,
|
||||
guint session_id,
|
||||
gboolean accept,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_modem_oma_accept_network_initiated_session_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
gboolean mm_modem_oma_accept_network_initiated_session_sync (MMModemOma *self,
|
||||
guint session_id,
|
||||
gboolean accept,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void mm_modem_oma_cancel_session (MMModemOma *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_modem_oma_cancel_session_finish (MMModemOma *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
gboolean mm_modem_oma_cancel_session_sync (MMModemOma *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
MMOmaFeature mm_modem_oma_get_features (MMModemOma *self);
|
||||
MMOmaSessionType mm_modem_oma_get_session_type (MMModemOma *self);
|
||||
MMOmaSessionState mm_modem_oma_get_session_state (MMModemOma *self);
|
||||
|
||||
gboolean mm_modem_peek_pending_network_initiated_sessions (MMModemOma *self,
|
||||
const MMOmaPendingNetworkInitiatedSession **sessions,
|
||||
guint *n_sessions);
|
||||
gboolean mm_modem_get_pending_network_initiated_sessions (MMModemOma *self,
|
||||
MMOmaPendingNetworkInitiatedSession **sessions,
|
||||
guint *n_sessions);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _MM_MODEM_OMA_H_ */
|
@@ -448,6 +448,42 @@ mm_object_peek_modem_signal (MMObject *self)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_oma:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemOma instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Oma on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemOma that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModemOma *
|
||||
mm_object_get_modem_oma (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemOma *)mm_gdbus_object_get_modem_oma (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_oma: (skip)
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_oma() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModemOma or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModemOma *
|
||||
mm_object_peek_modem_oma (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemOma *)mm_gdbus_object_peek_modem_oma (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
mm_object_init (MMObject *self)
|
||||
{
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "mm-modem-time.h"
|
||||
#include "mm-modem-firmware.h"
|
||||
#include "mm-modem-signal.h"
|
||||
#include "mm-modem-oma.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -86,6 +87,7 @@ MMModemMessaging *mm_object_get_modem_messaging (MMObject *self);
|
||||
MMModemTime *mm_object_get_modem_time (MMObject *self);
|
||||
MMModemFirmware *mm_object_get_modem_firmware (MMObject *self);
|
||||
MMModemSignal *mm_object_get_modem_signal (MMObject *self);
|
||||
MMModemOma *mm_object_get_modem_oma (MMObject *self);
|
||||
|
||||
MMModem *mm_object_peek_modem (MMObject *self);
|
||||
MMModem3gpp *mm_object_peek_modem_3gpp (MMObject *self);
|
||||
@@ -97,6 +99,7 @@ MMModemMessaging *mm_object_peek_modem_messaging (MMObject *self);
|
||||
MMModemTime *mm_object_peek_modem_time (MMObject *self);
|
||||
MMModemFirmware *mm_object_peek_modem_firmware (MMObject *self);
|
||||
MMModemSignal *mm_object_peek_modem_signal (MMObject *self);
|
||||
MMModemOma *mm_object_peek_modem_oma (MMObject *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Reference in New Issue
Block a user