[PATCH] Add modem_power_down to telit plugin
Carlo Lobrano
c.lobrano at gmail.com
Fri Dec 4 00:06:40 PST 2015
---
plugins/telit/mm-broadband-modem-telit.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c
index 971e85e..f4fe03c 100644
--- a/plugins/telit/mm-broadband-modem-telit.c
+++ b/plugins/telit/mm-broadband-modem-telit.c
@@ -40,6 +40,30 @@ G_DEFINE_TYPE_EXTENDED (MMBroadbandModemTelit, mm_broadband_modem_telit, MM_TYPE
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init));
/*****************************************************************************/
+/* Modem power down (Modem interface) */
+
+static gboolean
+modem_power_down_finish (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
+}
+
+static void
+modem_power_down (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ mm_base_modem_at_command (MM_BASE_MODEM (self),
+ "+CFUN=4",
+ 20,
+ FALSE,
+ callback,
+ user_data);
+}
+
+/*****************************************************************************/
/* Load access technologies (Modem interface) */
static gboolean
@@ -289,6 +313,8 @@ mm_broadband_modem_telit_init (MMBroadbandModemTelit *self)
static void
iface_modem_init (MMIfaceModem *iface)
{
+ iface->modem_power_down = modem_power_down;
+ iface->modem_power_down_finish = modem_power_down_finish;
iface->load_access_technologies = load_access_technologies;
iface->load_access_technologies_finish = load_access_technologies_finish;
iface->setup_flow_control = setup_flow_control;
--
2.5.0
More information about the ModemManager-devel
mailing list