sierra: use +CFUN=4 for powering down GSM modems

This commit is contained in:
Marius B. Kotsbak
2012-09-09 18:06:30 +02:00
committed by Dan Williams
parent b65bc50777
commit d2353e01ff

View File

@@ -490,12 +490,12 @@ modem_power_down_finish (MMIfaceModem *self,
} }
static void static void
pcstate_disable_ready (MMBaseModem *self, modem_power_down_ready (MMBaseModem *self,
GAsyncResult *res, GAsyncResult *res,
GSimpleAsyncResult *simple) GSimpleAsyncResult *simple)
{ {
/* Ignore errors for now; we're not sure if all Sierra CDMA devices support /* Ignore errors for now; we're not sure if all Sierra CDMA devices support
* at!pcstate. * at!pcstate or 3GPP devices support +CFUN=4.
*/ */
mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL); mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL);
@@ -522,16 +522,18 @@ modem_power_down (MMIfaceModem *self,
"!pcstate=0", "!pcstate=0",
5, 5,
FALSE, FALSE,
(GAsyncReadyCallback)pcstate_disable_ready, (GAsyncReadyCallback)modem_power_down_ready,
result); result);
return; return;
} }
/* For 3GPP modems we should call parent's power down, but there is no /* For GSM modems, run AT+CFUN=4 (power save) */
* such power down command in MMBroadbandModem, so just finish here. */ mm_base_modem_at_command (MM_BASE_MODEM (self),
g_simple_async_result_set_op_res_gboolean (result, TRUE); "+CFUN=4",
g_simple_async_result_complete_in_idle (result); 3,
g_object_unref (result); FALSE,
(GAsyncReadyCallback)modem_power_down_ready,
result);
} }
/*****************************************************************************/ /*****************************************************************************/