diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-06-29 09:52:37 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-06 20:07:20 +0200 |
commit | 68c276efc1d7c856f8ce9790f384ae485fcaad66 (patch) | |
tree | 61a982822f45629778b884a34dd68f58a71786e8 /src/mm-broadband-modem.h | |
parent | 3b1d3063ba9aacb6ecbb927de3f20bd938c45f55 (diff) |
broadband-modem: new generic steps in initialization/enabling/disabling
Instead of hardcoding the logic to decide which ports are open or closed in the
different steps, we now let the subclasses of MMBroadbandModem to do that
themselves.
We now provide:
* initialization_started() and initialization_stopped(): the generic
implementation does the serial port open/close in these steps.
* enabling_started(): the generic implementation does the serial port opening
here. The serial ports are kept open as long the modem is in enabled state.
* disabling_stopped(): the generic implementation does the serial port closing
here.
Diffstat (limited to 'src/mm-broadband-modem.h')
-rw-r--r-- | src/mm-broadband-modem.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mm-broadband-modem.h b/src/mm-broadband-modem.h index 3b15ec91..74324847 100644 --- a/src/mm-broadband-modem.h +++ b/src/mm-broadband-modem.h @@ -46,6 +46,30 @@ struct _MMBroadbandModemClass { * Plugins which need specific setups should chain up parent's port setup * as well. */ void (* setup_ports) (MMBroadbandModem *self); + + /* First and last initialization steps. + * Actually, this is not really the first step, setup_ports() is */ + void (* initialization_started) (MMBroadbandModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + gpointer (* initialization_started_finish) (MMBroadbandModem *self, + GAsyncResult *res, + GError **error); + gboolean (* initialization_stopped) (MMBroadbandModem *self, + gpointer started_context, + GError **error); + + /* First enabling step */ + void (* enabling_started) (MMBroadbandModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* enabling_started_finish) (MMBroadbandModem *self, + GAsyncResult *res, + GError **error); + + /* Last disabling step */ + gboolean (* disabling_stopped) (MMBroadbandModem *self, + GError **error); }; GType mm_broadband_modem_get_type (void); |