[PATCH] mbm plugin: send enap=0 on disable



Hi!

This patch makes the mbm plugin send at*enap=0 when disable is called.

Currently enap=0 is only sent when disconnect is called which I don't see happening. That causes enap to stay 
connected even if the user selects disconnect from nm-applet.

I'm not sure if this is the intended behaviour or if the bug is that disconnect isn't being called though...

Regards
Torgny Johansson

---
diff --git a/plugins/mm-modem-mbm.c b/plugins/mm-modem-mbm.c
index 5f06dae..6368d1c 100644
--- a/plugins/mm-modem-mbm.c
+++ b/plugins/mm-modem-mbm.c
@@ -453,11 +453,23 @@ parent_disable_done (MMModem *modem, GError *error, gpointer user_data)
 }
 
 static void
+mbm_disable_done (MMSerialPort *port,
+                GString *response,
+                GError *error,
+                gpointer user_data)
+{
+    MMModem *parent_modem_iface;
+    MMCallbackInfo *info = (MMCallbackInfo *) user_data;
+    
+    parent_modem_iface = g_type_interface_peek_parent (MM_MODEM_GET_INTERFACE (info->modem));
+    parent_modem_iface->disable (info->modem, parent_disable_done, info);
+}
+
+static void
 disable (MMModem *modem,
          MMModemFn callback,
          gpointer user_data)
 {
-    MMModem *parent_modem_iface;
     MMCallbackInfo *info;
     MMSerialPort *primary;
 
@@ -469,9 +481,7 @@ disable (MMModem *modem,
     /* Random stuff that mbm apparently wants.  Are these really needed? */
     mm_serial_port_queue_command (primary, "+CREG=0", 5, NULL, NULL);
     mm_serial_port_queue_command (primary, "+CMER=0", 5, NULL, NULL);
-
-    parent_modem_iface = g_type_interface_peek_parent (MM_MODEM_GET_INTERFACE (modem));
-    parent_modem_iface->disable (modem, parent_disable_done, info);
+    mm_serial_port_queue_command (primary, "*ENAP=0", 5, mbm_disable_done, info);
 }
 
 static void

---


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