[PATCH 1/2] telit: add modem_reset to telit plugin

Carlo Lobrano c.lobrano at gmail.com
Wed Dec 9 09:06:41 PST 2015


---
 plugins/telit/mm-broadband-modem-telit.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c
index f4fe03c..925face 100644
--- a/plugins/telit/mm-broadband-modem-telit.c
+++ b/plugins/telit/mm-broadband-modem-telit.c
@@ -64,6 +64,29 @@ modem_power_down (MMIfaceModem *self,
 }
 
 /*****************************************************************************/
+/* Reset (Modem interface) */
+
+static gboolean
+reset_finish (MMIfaceModem *self,
+              GAsyncResult *res,
+              GError **error)
+{
+    return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
+}
+
+static void
+reset (MMIfaceModem *self,
+       GAsyncReadyCallback callback,
+       gpointer user_data)
+{
+    mm_base_modem_at_command (MM_BASE_MODEM (self),
+                              "AT#REBOOT",
+                              3,
+                              FALSE,
+                              callback,
+                              user_data);
+}
+/*****************************************************************************/
 /* Load access technologies (Modem interface) */
 
 static gboolean
@@ -313,6 +336,8 @@ mm_broadband_modem_telit_init (MMBroadbandModemTelit *self)
 static void
 iface_modem_init (MMIfaceModem *iface)
 {
+    iface->reset = reset;
+    iface->reset_finish = reset_finish;
     iface->modem_power_down = modem_power_down;
     iface->modem_power_down_finish = modem_power_down_finish;
     iface->load_access_technologies = load_access_technologies;
-- 
2.1.4



More information about the ModemManager-devel mailing list