diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-23 11:19:14 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-23 18:56:22 +0200 |
commit | 5b9c1625b6025d027c40fc62081e154507181557 (patch) | |
tree | cad155c50c9d8e012a36ccc78dd6b67ff4b22983 | |
parent | 7027c6e9729f5eeaf53c11d7791b372cb9e85e43 (diff) |
sierra: custom power-up command for CDMA modems
-rw-r--r-- | plugins/sierra/mm-common-sierra.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/sierra/mm-common-sierra.c b/plugins/sierra/mm-common-sierra.c index 0d06144b..d5ea7ca2 100644 --- a/plugins/sierra/mm-common-sierra.c +++ b/plugins/sierra/mm-common-sierra.c @@ -117,6 +117,21 @@ get_current_functionality_status_ready (MMBaseModem *self, simple); } +static void +pcstate_enable_ready (MMBaseModem *self, + GAsyncResult *res, + GSimpleAsyncResult *simple) +{ + /* Ignore errors for now; we're not sure if all Sierra CDMA devices support + * at!pcstate. + */ + mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, NULL); + + g_simple_async_result_set_op_res_gboolean (simple, TRUE); + g_simple_async_result_complete (simple); + g_object_unref (simple); +} + void mm_common_sierra_modem_power_up (MMIfaceModem *self, GAsyncReadyCallback callback, @@ -129,6 +144,18 @@ mm_common_sierra_modem_power_up (MMIfaceModem *self, user_data, mm_common_sierra_modem_power_up); + /* For CDMA modems, run !pcstate */ + if (mm_iface_modem_is_cdma_only (self)) { + mm_base_modem_at_command (MM_BASE_MODEM (self), + "!pcstate=1", + 5, + FALSE, + (GAsyncReadyCallback)pcstate_enable_ready, + result); + return; + } + + /* For 3GPP modems, check if we'll need the power up */ mm_base_modem_at_command (MM_BASE_MODEM (self), "+CFUN?", 3, |