aboutsummaryrefslogtreecommitdiff
path: root/plugins/wavecom
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2014-02-18 11:33:28 +0100
committerAleksander Morgado <aleksander@aleksander.es>2014-02-20 11:18:22 +0100
commite3c4dec3d7db6cb61fd68f5b82452c236ed91843 (patch)
tree03f16f6efba6eaaccd0d47b65541621df5bcad85 /plugins/wavecom
parentf9b9f25cd1bee4996d918e6976c53e74edfa364a (diff)
wavecom: implement power off
Powering off Wavecom devices is done via the AT^CPOF=1 command. These devices seem to not only power-off, but also power-cycle when this command is received, which means that the user needs to make sure to fully cut the power to the device when the SetPowerState() method replies.
Diffstat (limited to 'plugins/wavecom')
-rw-r--r--plugins/wavecom/mm-broadband-modem-wavecom.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/wavecom/mm-broadband-modem-wavecom.c b/plugins/wavecom/mm-broadband-modem-wavecom.c
index 1fd3cd60..267226b4 100644
--- a/plugins/wavecom/mm-broadband-modem-wavecom.c
+++ b/plugins/wavecom/mm-broadband-modem-wavecom.c
@@ -1163,6 +1163,32 @@ modem_power_down (MMIfaceModem *self,
user_data);
}
+/*****************************************************************************/
+/* Modem power down (Modem interface) */
+
+static gboolean
+modem_power_off_finish (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
+}
+
+static void
+modem_power_off (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ mm_base_modem_at_command (MM_BASE_MODEM (self),
+ "+CPOF=1",
+ 3,
+ FALSE,
+ callback,
+ user_data);
+}
+
+/*****************************************************************************/
+
static void
setup_ports (MMBroadbandModem *self)
{
@@ -1243,6 +1269,8 @@ iface_modem_init (MMIfaceModem *iface)
iface->modem_power_up_finish = modem_power_up_finish;
iface->modem_power_down = modem_power_down;
iface->modem_power_down_finish = modem_power_down_finish;
+ iface->modem_power_off = modem_power_off;
+ iface->modem_power_off_finish = modem_power_off_finish;
}
static void