Re: [MM] [PATCH 2/3] ZTE: Use +CFUN=4 to turn off radios when disabling



Aleksander Morgado:
> In the ZTE plugin case, using POWER_UP as well may be not needed, as the 
> plugin overrides the whole enabling sequence, and therefore the generic 
> code launching the power up command from that property is never called 
> (just check if there is a +CFUN=1 command sent alone in the logs). But 
> for POWER_DOWN, it probably applies.

Thank you for your advices! I have applied POWER_DOWN property to ZTE
plugin. This is my renewed patch:

--- a/plugins/mm-modem-zte.c	2012-03-13 23:06:11.000000000 +0400
+++ b/plugins/mm-modem-zte.c	2012-04-20 01:05:13.835960168 +0400
@@ -677,6 +677,32 @@
     return !!port;
 }
 
+static void
+set_property (GObject *object,
+              guint prop_id,
+              const GValue *value,
+              GParamSpec *pspec)
+{
+    /* Do nothing... see set_property() in parent, which also does nothing */
+}
+
+static void
+get_property (GObject *object,
+              guint prop_id,
+              GValue *value,
+              GParamSpec *pspec)
+{
+    switch (prop_id) {
+    case MM_GENERIC_GSM_PROP_POWER_DOWN_CMD:
+        /* Use AT+CFUN=4 for power down. It will stop the RF (IMSI detach), and
+         * keeps access to the SIM */
+        g_value_set_string (value, "+CFUN=4");
+        break;
+    default:
+        break;
+    }
+}
+
 /*****************************************************************************/
 
 static MMModemIceraPrivate *
@@ -759,6 +785,13 @@
     mm_modem_zte_parent_class = g_type_class_peek_parent (klass);
     g_type_class_add_private (object_class, sizeof (MMModemZtePrivate));
 
+    object_class->get_property = get_property;
+    object_class->set_property = set_property;
+
+    g_object_class_override_property (object_class,
+                                      MM_GENERIC_GSM_PROP_POWER_DOWN_CMD,
+                                      MM_GENERIC_GSM_POWER_DOWN_CMD);
+
     object_class->dispose = dispose;
     gsm_class->do_enable = do_enable;
     gsm_class->do_disconnect = do_disconnect;


-- 
Alexander Orlov



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]