From c44b928206c1147bd760b4aef48294d7dda28e24 Mon Sep 17 00:00:00 2001 From: Eric Caruso Date: Wed, 13 Dec 2017 10:17:33 -0800 Subject: mm-iface-modem: add check_for_sim_swap method and enable steps When in low-power mode, some modems will not dispatch unsolicited notifications, such as for SIM hot swapping. There is code in MMBroadbandModemTelit to handle this by checking the SIM identifier during modem power up against the identifier cached in the SIM D-Bus object. If they're different, the SIM has likely been swapped while we were powered down. We can move this code out to MMBroadbandModem because it doesn't actually rely on any Telit-specific details, and invoke it from MMIfaceModem via a new method. --- src/mm-iface-modem.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mm-iface-modem.h') diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h index d25fbd49..177bf910 100644 --- a/src/mm-iface-modem.h +++ b/src/mm-iface-modem.h @@ -281,6 +281,16 @@ struct _MMIfaceModem { GAsyncResult *res, GError **error); + /* Asynchronous check to see if the SIM was swapped. + * Useful for when the modem changes power states since we might + * not get the relevant notifications from the modem. */ + void (*check_for_sim_swap) (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*check_for_sim_swap_finish) (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + /* Asynchronous flow control setup */ void (*setup_flow_control) (MMIfaceModem *self, GAsyncReadyCallback callback, -- cgit v1.2.3-70-g09d2