diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-11-25 15:21:31 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:27 +0100 |
commit | 00949c4782069326cb2d126a866b8167e6c24598 (patch) | |
tree | be55959d1c5a68b57a93c29e584ca7d9227b7774 /src | |
parent | 491758c266bdc22b8b0ab3c369da9b36815c2d0c (diff) |
broadband-modem: implement modem power-up commands
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-broadband-modem.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index fb6169bd..de5c8b54 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -702,6 +702,36 @@ load_unlock_required (MMIfaceModem *self, /*****************************************************************************/ static gboolean +modem_power_up_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + return !mm_at_command_finish (G_OBJECT (self), res, error); +} + +static void +modem_power_up (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + /* By default, errors in the power up command are ignored. + * Plugins wanting to treat power up errors should subclass the power up + * handling. */ + mm_at_command (G_OBJECT (self), + mm_base_modem_get_port_primary (MM_BASE_MODEM (self)), + "+CFUN=1", + 5, + NULL, /* response processor */ + NULL, /* response processor context */ + NULL, /* result signature */ + NULL, /* cancellable */ + callback, + user_data); +} + +/*****************************************************************************/ + +static gboolean modem_init_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) @@ -1008,6 +1038,8 @@ iface_modem_init (MMIfaceModem *iface) iface->modem_init = modem_init; iface->modem_init_finish = modem_init_finish; + iface->modem_power_up = modem_power_up; + iface->modem_power_up_finish = modem_power_up_finish; } static void |