summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Crosser <crosser@average.org>2009-09-22 22:56:58 -0700
committerDan Williams <dcbw@redhat.com>2009-09-22 22:56:58 -0700
commit2bad09403aae95dd25ce03790fce45a85578f677 (patch)
treeeeb2c52625690684d945fa39b9af233133986f30
parentfeb00e455337850aa77c1014d4e73fef51953636 (diff)
nokia: don't use CFUN at all (lp430576)
CFUN=0 actually powers off the phone; CFUN=1 isn't really supported on some phones either. So just don't use CFUN at all.
-rw-r--r--plugins/mm-modem-nokia.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/mm-modem-nokia.c b/plugins/mm-modem-nokia.c
index 379fba09..f449dfd4 100644
--- a/plugins/mm-modem-nokia.c
+++ b/plugins/mm-modem-nokia.c
@@ -84,9 +84,46 @@ mm_modem_nokia_init (MMModemNokia *self)
}
static void
+get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec)
+{
+ /* Nokia headsets (at least N85) do not support "power on"; they do
+ * support "power off" but you proabably do not want to turn off the
+ * power on your telephone if something went wrong with connecting
+ * process. So, disabling both these operations. The Nokia GSM/UMTS command
+ * reference v1.2 also states that only CFUN=0 (turn off but still charge)
+ * and CFUN=1 (full functionality) are supported, and since the phone has
+ * to be in CFUN=1 before we'll be able to talk to it in the first place,
+ * we shouldn't bother with CFUN at all.
+ */
+ switch (prop_id) {
+ case MM_GENERIC_GSM_PROP_POWER_UP_CMD:
+ g_value_set_string (value, "");
+ break;
+ case MM_GENERIC_GSM_PROP_POWER_DOWN_CMD:
+ g_value_set_string (value, "");
+ break;
+ default:
+ break;
+ }
+}
+
+static void
mm_modem_nokia_class_init (MMModemNokiaClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
mm_modem_nokia_parent_class = g_type_class_peek_parent (klass);
+
+ object_class->get_property = get_property;
+
+ g_object_class_override_property (object_class,
+ MM_GENERIC_GSM_PROP_POWER_UP_CMD,
+ MM_GENERIC_GSM_POWER_UP_CMD);
+
+ g_object_class_override_property (object_class,
+ MM_GENERIC_GSM_PROP_POWER_DOWN_CMD,
+ MM_GENERIC_GSM_POWER_DOWN_CMD);
}
GType