From 7978225934dc87bc74fac4d79a1080bc0501e581 Mon Sep 17 00:00:00 2001 From: Carlo Lobrano Date: Wed, 9 Dec 2015 18:06:41 +0100 Subject: [PATCH] telit: add modem_reset to telit plugin --- 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 f4fe03cd..0f772314 100644 --- a/plugins/telit/mm-broadband-modem-telit.c +++ b/plugins/telit/mm-broadband-modem-telit.c @@ -63,6 +63,29 @@ modem_power_down (MMIfaceModem *self, user_data); } +/*****************************************************************************/ +/* Reset (Modem interface) */ + +static gboolean +modem_reset_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); +} + +static void +modem_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) */ @@ -313,6 +336,8 @@ mm_broadband_modem_telit_init (MMBroadbandModemTelit *self) static void iface_modem_init (MMIfaceModem *iface) { + iface->reset = modem_reset; + iface->reset_finish = modem_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;