aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElly Jones <ellyjones@google.com>2010-12-20 14:51:39 -0500
committerElly Jones <ellyjones@google.com>2010-12-20 15:19:45 -0500
commiteb90498efdcf1cbb9a8ebab606b945263f25b6ce (patch)
tree8c2429071b1c0086f246b793ce1c679467c028da
parentb19b25f324eff63e63638c26210d3108308bbaf9 (diff)
Add CDMA Activate and ActivateManual methods.
BUG=6885 TEST=built modemmanager and cromo Change-Id: Ib73a093b13da05948a2f1da8f051fe7c55682584 Review URL: http://codereview.chromium.org/3517013 (cherry picked from commit f447c8e1a0062500e1171e031cf4c8fef76ffd59) Conflicts: src/mm-modem-cdma.c
-rw-r--r--introspection/org.freedesktop.ModemManager.Modem.Cdma.xml28
-rw-r--r--src/mm-modem-cdma.c35
-rw-r--r--src/mm-modem-cdma.h18
3 files changed, 81 insertions, 0 deletions
diff --git a/introspection/org.freedesktop.ModemManager.Modem.Cdma.xml b/introspection/org.freedesktop.ModemManager.Modem.Cdma.xml
index 5f2db855..fd6a4d3d 100644
--- a/introspection/org.freedesktop.ModemManager.Modem.Cdma.xml
+++ b/introspection/org.freedesktop.ModemManager.Modem.Cdma.xml
@@ -3,6 +3,34 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.ModemManager.Modem.Cdma">
+ <method name="Activate">
+ <tp:docstring>
+ Activates the modem for use with a given carrier.
+ </tp:docstring>
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_modem_cdma_activate"/>
+ <arg name="carrier" type="s" direction="in">
+ <tp:docstring>
+ Name of carrier.
+ </tp:docstring>
+ </arg>
+ </method>
+
+ <method name="ActivateManual">
+ <tp:docstring>
+ Sets modem configuration data. Unlike regular Activate(),
+ this does not contact the carrier. Some modems will reboot
+ after this call is made.
+ </tp:docstring>
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_modem_cdma_activate_manual"/>
+ <arg name="properties" type="a{sv}" direction="in">
+ <tp:docstring>
+ A dictionary of properties to set on the modem. Keys include 'mdn', 'min'
+ </tp:docstring>
+ </arg>
+ </method>
+
<method name="GetSignalQuality">
<tp:docstring>
Get the current signal quality.
diff --git a/src/mm-modem-cdma.c b/src/mm-modem-cdma.c
index e80dc4e2..3f4ffe54 100644
--- a/src/mm-modem-cdma.c
+++ b/src/mm-modem-cdma.c
@@ -26,6 +26,8 @@ static void impl_modem_cdma_get_signal_quality (MMModemCdma *modem, DBusGMethodI
static void impl_modem_cdma_get_esn (MMModemCdma *modem, DBusGMethodInvocation *context);
static void impl_modem_cdma_get_serving_system (MMModemCdma *modem, DBusGMethodInvocation *context);
static void impl_modem_cdma_get_registration_state (MMModemCdma *modem, DBusGMethodInvocation *context);
+static void impl_modem_cdma_activate (MMModemCdma *modem, DBusGMethodInvocation *context);
+static void impl_modem_cdma_activate_manual (MMModemCdma *modem, DBusGMethodInvocation *context);
#include "mm-modem-cdma-glue.h"
@@ -251,6 +253,39 @@ mm_modem_cdma_emit_signal_quality_changed (MMModemCdma *self, guint32 quality)
g_signal_emit (self, signals[SIGNAL_QUALITY], 0, quality);
}
+void mm_modem_cdma_activate(MMModemCdma *self, MMModemUIntFn callback,
+ gpointer user_data)
+{
+ g_return_if_fail (MM_IS_MODEM_CDMA (self));
+ g_return_if_fail (callback != NULL);
+
+ if (MM_MODEM_CDMA_GET_INTERFACE (self)->activate)
+ MM_MODEM_CDMA_GET_INTERFACE (self)->activate(self, callback, user_data);
+ else
+ uint_op_not_supported (MM_MODEM (self), callback, user_data);
+}
+
+static void impl_modem_cdma_activate(MMModemCdma *modem,
+ DBusGMethodInvocation *context)
+{
+ mm_modem_cdma_activate (modem, uint_call_done, context);
+}
+
+
+void mm_modem_cdma_activate_manual(MMModemCdma *self, MMModemUIntFn callback,
+ gpointer user_data) {
+ g_return_if_fail (MM_IS_MODEM_CDMA (self));
+ g_return_if_fail (callback != NULL);
+ if (MM_MODEM_CDMA_GET_INTERFACE (self)->activate_manual)
+ MM_MODEM_CDMA_GET_INTERFACE (self)->activate_manual(self, callback, user_data);
+ else
+ uint_op_not_supported (MM_MODEM (self), callback, user_data);
+}
+static void impl_modem_cdma_activate_manual (MMModemCdma *modem,
+ DBusGMethodInvocation *context) {
+ mm_modem_cdma_activate_manual(modem, uint_call_done, context);
+}
+
/*****************************************************************************/
static void
diff --git a/src/mm-modem-cdma.h b/src/mm-modem-cdma.h
index a7a626f7..89751518 100644
--- a/src/mm-modem-cdma.h
+++ b/src/mm-modem-cdma.h
@@ -70,6 +70,18 @@ struct _MMModemCdma {
MMModemCdmaRegistrationStateFn callback,
gpointer user_data);
+ void (*activate) (MMModemCdma *self,
+ MMModemUIntFn callback,
+ gpointer user_data);
+
+ void (*activate_manual) (MMModemCdma *self,
+ MMModemUIntFn callback,
+ gpointer user_data);
+
+ void (*activate_manual_debug) (MMModemCdma *self,
+ MMModemUIntFn callback,
+ gpointer user_data);
+
/* Signals */
void (*signal_quality) (MMModemCdma *self,
guint32 quality);
@@ -97,6 +109,12 @@ void mm_modem_cdma_get_registration_state (MMModemCdma *self,
MMModemCdmaRegistrationStateFn callback,
gpointer user_data);
+void mm_modem_cdma_activate (MMModemCdma *self, MMModemUIntFn callback,
+ gpointer user_data);
+
+void mm_modem_cdma_activate_manual (MMModemCdma *self, MMModemUIntFn callback,
+ gpointer user_data);
+
/* Protected */
void mm_modem_cdma_emit_signal_quality_changed (MMModemCdma *self, guint32 new_quality);