sim: rename 'MMSim' to 'MMBaseSim'
Just so that we don't have same header names in src/ and /libmm-glib.
This commit is contained in:
@@ -3158,7 +3158,7 @@ huawei_modem_power_down (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
huawei_modem_create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
|
||||
#include "mm-sim-huawei.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimHuawei, mm_sim_huawei, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimHuawei, mm_sim_huawei, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
/* SIM identifier loading */
|
||||
|
||||
static gchar *
|
||||
load_sim_identifier_finish (MMSim *self,
|
||||
load_sim_identifier_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ parent_load_sim_identifier_ready (MMSimHuawei *self,
|
||||
GError *error = NULL;
|
||||
gchar *simid;
|
||||
|
||||
simid = MM_SIM_CLASS (mm_sim_huawei_parent_class)->load_sim_identifier_finish (MM_SIM (self), res, &error);
|
||||
simid = MM_BASE_SIM_CLASS (mm_sim_huawei_parent_class)->load_sim_identifier_finish (MM_BASE_SIM (self), res, &error);
|
||||
if (simid)
|
||||
g_simple_async_result_set_op_res_gpointer (simple, simid, g_free);
|
||||
else
|
||||
@@ -74,7 +74,7 @@ iccid_read_ready (MMBaseModem *modem,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMSim *self;
|
||||
MMBaseSim *self;
|
||||
const gchar *response;
|
||||
const gchar *p;
|
||||
char *parsed;
|
||||
@@ -97,22 +97,22 @@ iccid_read_ready (MMBaseModem *modem,
|
||||
|
||||
error:
|
||||
/* Chain up to parent method; older devices don't support ^ICCID */
|
||||
self = MM_SIM (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
|
||||
MM_SIM_CLASS (mm_sim_huawei_parent_class)->load_sim_identifier (self,
|
||||
(GAsyncReadyCallback) parent_load_sim_identifier_ready,
|
||||
simple);
|
||||
self = MM_BASE_SIM (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
|
||||
MM_BASE_SIM_CLASS (mm_sim_huawei_parent_class)->load_sim_identifier (self,
|
||||
(GAsyncReadyCallback) parent_load_sim_identifier_ready,
|
||||
simple);
|
||||
g_object_unref (self);
|
||||
}
|
||||
|
||||
static void
|
||||
load_sim_identifier (MMSim *self,
|
||||
load_sim_identifier (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMBaseModem *modem = NULL;
|
||||
|
||||
g_object_get (self,
|
||||
MM_SIM_MODEM, &modem,
|
||||
MM_BASE_SIM_MODEM, &modem,
|
||||
NULL);
|
||||
|
||||
mm_dbg ("loading (Huawei) SIM identifier...");
|
||||
@@ -131,7 +131,7 @@ load_sim_identifier (MMSim *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_huawei_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -146,9 +146,9 @@ mm_sim_huawei_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -162,7 +162,7 @@ mm_sim_huawei_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -174,8 +174,8 @@ mm_sim_huawei_init (MMSimHuawei *self)
|
||||
static void
|
||||
mm_sim_huawei_class_init (MMSimHuaweiClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
sim_class->load_sim_identifier = load_sim_identifier;
|
||||
sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
base_sim_class->load_sim_identifier = load_sim_identifier;
|
||||
base_sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_HUAWEI (mm_sim_huawei_get_type ())
|
||||
#define MM_SIM_HUAWEI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_HUAWEI, MMSimHuawei))
|
||||
@@ -34,20 +34,20 @@ typedef struct _MMSimHuawei MMSimHuawei;
|
||||
typedef struct _MMSimHuaweiClass MMSimHuaweiClass;
|
||||
|
||||
struct _MMSimHuawei {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimHuaweiClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_huawei_get_type (void);
|
||||
|
||||
void mm_sim_huawei_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_huawei_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_huawei_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_huawei_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_HUAWEI_H */
|
||||
|
||||
@@ -257,7 +257,7 @@ load_supported_modes (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem inteface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
#include "mm-sim-iridium.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimIridium, mm_sim_iridium, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimIridium, mm_sim_iridium, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_iridium_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -46,9 +46,9 @@ mm_sim_iridium_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -62,7 +62,7 @@ mm_sim_iridium_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -74,15 +74,15 @@ mm_sim_iridium_init (MMSimIridium *self)
|
||||
static void
|
||||
mm_sim_iridium_class_init (MMSimIridiumClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
/* Skip querying the SIM card info, not supported by Iridium modems */
|
||||
sim_class->load_sim_identifier = NULL;
|
||||
sim_class->load_sim_identifier_finish = NULL;
|
||||
sim_class->load_imsi = NULL;
|
||||
sim_class->load_imsi_finish = NULL;
|
||||
sim_class->load_operator_identifier = NULL;
|
||||
sim_class->load_operator_identifier_finish = NULL;
|
||||
sim_class->load_operator_name = NULL;
|
||||
sim_class->load_operator_name_finish = NULL;
|
||||
base_sim_class->load_sim_identifier = NULL;
|
||||
base_sim_class->load_sim_identifier_finish = NULL;
|
||||
base_sim_class->load_imsi = NULL;
|
||||
base_sim_class->load_imsi_finish = NULL;
|
||||
base_sim_class->load_operator_identifier = NULL;
|
||||
base_sim_class->load_operator_identifier_finish = NULL;
|
||||
base_sim_class->load_operator_name = NULL;
|
||||
base_sim_class->load_operator_name_finish = NULL;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_IRIDIUM (mm_sim_iridium_get_type ())
|
||||
#define MM_SIM_IRIDIUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_IRIDIUM, MMSimIridium))
|
||||
@@ -33,20 +33,20 @@ typedef struct _MMSimIridium MMSimIridium;
|
||||
typedef struct _MMSimIridiumClass MMSimIridiumClass;
|
||||
|
||||
struct _MMSimIridium {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimIridiumClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_iridium_get_type (void);
|
||||
|
||||
void mm_sim_iridium_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_iridium_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_iridium_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_iridium_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_IRIDIUM_H */
|
||||
|
||||
@@ -136,7 +136,7 @@ modem_create_bearer (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
+15
-15
@@ -28,7 +28,7 @@
|
||||
#include "mm-base-modem-at.h"
|
||||
#include "mm-sim-mbm.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimMbm, mm_sim_mbm, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimMbm, mm_sim_mbm, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
/* SEND PIN/PUK (Generic implementation) */
|
||||
@@ -52,7 +52,7 @@ send_pin_puk_context_complete_and_free (SendPinPukContext *ctx)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
common_send_pin_puk_finish (MMSim *self,
|
||||
common_send_pin_puk_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -133,7 +133,7 @@ send_pin_puk_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
common_send_pin_puk (MMSim *self,
|
||||
common_send_pin_puk (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
const gchar *puk,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -149,7 +149,7 @@ common_send_pin_puk (MMSim *self,
|
||||
user_data,
|
||||
common_send_pin_puk);
|
||||
g_object_get (ctx->self,
|
||||
MM_SIM_MODEM, &ctx->modem,
|
||||
MM_BASE_SIM_MODEM, &ctx->modem,
|
||||
NULL);
|
||||
|
||||
command = (puk ?
|
||||
@@ -165,7 +165,7 @@ common_send_pin_puk (MMSim *self,
|
||||
}
|
||||
|
||||
static void
|
||||
send_puk (MMSim *self,
|
||||
send_puk (MMBaseSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -175,7 +175,7 @@ send_puk (MMSim *self,
|
||||
}
|
||||
|
||||
static void
|
||||
send_pin (MMSim *self,
|
||||
send_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -185,7 +185,7 @@ send_pin (MMSim *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_mbm_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -200,9 +200,9 @@ mm_sim_mbm_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -216,7 +216,7 @@ mm_sim_mbm_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -228,10 +228,10 @@ mm_sim_mbm_init (MMSimMbm *self)
|
||||
static void
|
||||
mm_sim_mbm_class_init (MMSimMbmClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
sim_class->send_pin = send_pin;
|
||||
sim_class->send_pin_finish = common_send_pin_puk_finish;
|
||||
sim_class->send_puk = send_puk;
|
||||
sim_class->send_puk_finish = common_send_pin_puk_finish;
|
||||
base_sim_class->send_pin = send_pin;
|
||||
base_sim_class->send_pin_finish = common_send_pin_puk_finish;
|
||||
base_sim_class->send_puk = send_puk;
|
||||
base_sim_class->send_puk_finish = common_send_pin_puk_finish;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_MBM (mm_sim_mbm_get_type ())
|
||||
#define MM_SIM_MBM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_MBM, MMSimMbm))
|
||||
@@ -32,20 +32,20 @@ typedef struct _MMSimMbm MMSimMbm;
|
||||
typedef struct _MMSimMbmClass MMSimMbmClass;
|
||||
|
||||
struct _MMSimMbm {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimMbmClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_mbm_get_type (void);
|
||||
|
||||
void mm_sim_mbm_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_mbm_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_mbm_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_mbm_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_MBM_H */
|
||||
|
||||
@@ -47,7 +47,7 @@ G_DEFINE_TYPE_EXTENDED (MMBroadbandModemNokia, mm_broadband_modem_nokia, MM_TYPE
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
|
||||
#include "mm-sim-nokia.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimNokia, mm_sim_nokia, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimNokia, mm_sim_nokia, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_nokia_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -45,9 +45,9 @@ mm_sim_nokia_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -61,7 +61,7 @@ mm_sim_nokia_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -73,13 +73,13 @@ mm_sim_nokia_init (MMSimNokia *self)
|
||||
static void
|
||||
mm_sim_nokia_class_init (MMSimNokiaClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
/* Skip querying most SIM card info, +CRSM not supported by Nokia modems */
|
||||
sim_class->load_sim_identifier = NULL;
|
||||
sim_class->load_sim_identifier_finish = NULL;
|
||||
sim_class->load_operator_identifier = NULL;
|
||||
sim_class->load_operator_identifier_finish = NULL;
|
||||
sim_class->load_operator_name = NULL;
|
||||
sim_class->load_operator_name_finish = NULL;
|
||||
base_sim_class->load_sim_identifier = NULL;
|
||||
base_sim_class->load_sim_identifier_finish = NULL;
|
||||
base_sim_class->load_operator_identifier = NULL;
|
||||
base_sim_class->load_operator_identifier_finish = NULL;
|
||||
base_sim_class->load_operator_name = NULL;
|
||||
base_sim_class->load_operator_name_finish = NULL;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_NOKIA (mm_sim_nokia_get_type ())
|
||||
#define MM_SIM_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_NOKIA, MMSimNokia))
|
||||
@@ -32,20 +32,20 @@ typedef struct _MMSimNokia MMSimNokia;
|
||||
typedef struct _MMSimNokiaClass MMSimNokiaClass;
|
||||
|
||||
struct _MMSimNokia {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimNokiaClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_nokia_get_type (void);
|
||||
|
||||
void mm_sim_nokia_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_nokia_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_nokia_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_nokia_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_NOKIA_H */
|
||||
|
||||
@@ -128,7 +128,7 @@ modem_create_bearer (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
modem_create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
|
||||
#include "mm-sim-novatel-lte.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimNovatelLte, mm_sim_novatel_lte, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimNovatelLte, mm_sim_novatel_lte, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
/* IMSI loading */
|
||||
|
||||
static gchar *
|
||||
load_imsi_finish (MMSim *self,
|
||||
load_imsi_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -176,14 +176,14 @@ imsi_read_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
load_imsi (MMSim *self,
|
||||
load_imsi (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMBaseModem *modem = NULL;
|
||||
|
||||
g_object_get (self,
|
||||
MM_SIM_MODEM, &modem,
|
||||
MM_BASE_SIM_MODEM, &modem,
|
||||
NULL);
|
||||
|
||||
mm_dbg ("loading (Novatel LTE) IMSI...");
|
||||
@@ -202,7 +202,7 @@ load_imsi (MMSim *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_novatel_lte_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -217,9 +217,9 @@ mm_sim_novatel_lte_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -233,7 +233,7 @@ mm_sim_novatel_lte_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -245,8 +245,8 @@ mm_sim_novatel_lte_init (MMSimNovatelLte *self)
|
||||
static void
|
||||
mm_sim_novatel_lte_class_init (MMSimNovatelLteClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
sim_class->load_imsi = load_imsi;
|
||||
sim_class->load_imsi_finish = load_imsi_finish;
|
||||
base_sim_class->load_imsi = load_imsi;
|
||||
base_sim_class->load_imsi_finish = load_imsi_finish;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_NOVATEL_LTE (mm_sim_novatel_lte_get_type ())
|
||||
#define MM_SIM_NOVATEL_LTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_NOVATEL_LTE, MMSimNovatelLte))
|
||||
@@ -32,20 +32,20 @@ typedef struct _MMSimNovatelLte MMSimNovatelLte;
|
||||
typedef struct _MMSimNovatelLteClass MMSimNovatelLteClass;
|
||||
|
||||
struct _MMSimNovatelLte {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimNovatelLteClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_novatel_lte_get_type (void);
|
||||
|
||||
void mm_sim_novatel_lte_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_novatel_lte_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_novatel_lte_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_novatel_lte_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_NOVATEL_LTE_H */
|
||||
|
||||
@@ -86,7 +86,7 @@ load_supported_storages (MMIfaceModemMessaging *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
|
||||
#include "mm-sim-pantech.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimPantech, mm_sim_pantech, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimPantech, mm_sim_pantech, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_pantech_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -45,23 +45,23 @@ mm_sim_pantech_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
mm_sim_pantech_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_async_initable_new_async (MM_TYPE_SIM_PANTECH,
|
||||
G_PRIORITY_DEFAULT,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -73,14 +73,14 @@ mm_sim_pantech_init (MMSimPantech *self)
|
||||
static void
|
||||
mm_sim_pantech_class_init (MMSimPantechClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
/* Skip querying most SIM card info, +CRSM just shoots the Pantech modems
|
||||
* (at least the UMW190) in the head */
|
||||
sim_class->load_sim_identifier = NULL;
|
||||
sim_class->load_sim_identifier_finish = NULL;
|
||||
sim_class->load_operator_identifier = NULL;
|
||||
sim_class->load_operator_identifier_finish = NULL;
|
||||
sim_class->load_operator_name = NULL;
|
||||
sim_class->load_operator_name_finish = NULL;
|
||||
base_sim_class->load_sim_identifier = NULL;
|
||||
base_sim_class->load_sim_identifier_finish = NULL;
|
||||
base_sim_class->load_operator_identifier = NULL;
|
||||
base_sim_class->load_operator_identifier_finish = NULL;
|
||||
base_sim_class->load_operator_name = NULL;
|
||||
base_sim_class->load_operator_name_finish = NULL;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_PANTECH (mm_sim_pantech_get_type ())
|
||||
#define MM_SIM_PANTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_PANTECH, MMSimPantech))
|
||||
@@ -32,20 +32,20 @@ typedef struct _MMSimPantech MMSimPantech;
|
||||
typedef struct _MMSimPantechClass MMSimPantechClass;
|
||||
|
||||
struct _MMSimPantech {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimPantechClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_pantech_get_type (void);
|
||||
|
||||
void mm_sim_pantech_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_pantech_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_pantech_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_pantech_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_PANTECH_H */
|
||||
|
||||
@@ -242,7 +242,7 @@ mm_common_sierra_load_power_state (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_common_sierra_create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "mm-broadband-modem.h"
|
||||
#include "mm-iface-modem.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
void mm_common_sierra_load_power_state (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -35,12 +36,12 @@ gboolean mm_common_sierra_modem_power_up_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_common_sierra_create_sim (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_common_sierra_create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_common_sierra_create_sim (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_common_sierra_create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_common_sierra_setup_ports (MMBroadbandModem *self);
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
|
||||
#include "mm-sim-sierra.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimSierra, mm_sim_sierra, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimSierra, mm_sim_sierra, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
/* SIM identifier loading */
|
||||
|
||||
static gchar *
|
||||
load_sim_identifier_finish (MMSim *self,
|
||||
load_sim_identifier_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -93,14 +93,14 @@ iccid_read_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
load_sim_identifier (MMSim *self,
|
||||
load_sim_identifier (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMBaseModem *modem = NULL;
|
||||
|
||||
g_object_get (self,
|
||||
MM_SIM_MODEM, &modem,
|
||||
MM_BASE_SIM_MODEM, &modem,
|
||||
NULL);
|
||||
|
||||
mm_dbg ("loading (Sierra) SIM identifier...");
|
||||
@@ -119,7 +119,7 @@ load_sim_identifier (MMSim *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_sierra_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -134,9 +134,9 @@ mm_sim_sierra_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -150,7 +150,7 @@ mm_sim_sierra_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@ mm_sim_sierra_init (MMSimSierra *self)
|
||||
static void
|
||||
mm_sim_sierra_class_init (MMSimSierraClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
sim_class->load_sim_identifier = load_sim_identifier;
|
||||
sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
base_sim_class->load_sim_identifier = load_sim_identifier;
|
||||
base_sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_SIERRA (mm_sim_sierra_get_type ())
|
||||
#define MM_SIM_SIERRA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_SIERRA, MMSimSierra))
|
||||
@@ -34,20 +34,20 @@ typedef struct _MMSimSierra MMSimSierra;
|
||||
typedef struct _MMSimSierraClass MMSimSierraClass;
|
||||
|
||||
struct _MMSimSierra {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimSierraClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_sierra_get_type (void);
|
||||
|
||||
void mm_sim_sierra_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_sierra_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_sierra_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_sierra_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_SIERRA_H */
|
||||
|
||||
+2
-2
@@ -175,8 +175,8 @@ ModemManager_SOURCES = \
|
||||
mm-device.h \
|
||||
mm-plugin-manager.c \
|
||||
mm-plugin-manager.h \
|
||||
mm-sim.h \
|
||||
mm-sim.c \
|
||||
mm-base-sim.h \
|
||||
mm-base-sim.c \
|
||||
mm-base-bearer.h \
|
||||
mm-base-bearer.c \
|
||||
mm-broadband-bearer.h \
|
||||
|
||||
+140
-142
@@ -27,17 +27,17 @@
|
||||
#include <libmm-glib.h>
|
||||
|
||||
#include "mm-iface-modem.h"
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
#include "mm-base-modem-at.h"
|
||||
#include "mm-base-modem.h"
|
||||
#include "mm-log.h"
|
||||
#include "mm-modem-helpers.h"
|
||||
|
||||
static void async_initable_iface_init (GAsyncInitableIface *iface);
|
||||
static void async_initable_iface_init (GAsyncInitableIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_EXTENDED (MMSim, mm_sim, MM_GDBUS_TYPE_SIM_SKELETON, 0,
|
||||
G_DEFINE_TYPE_EXTENDED (MMBaseSim, mm_base_sim, MM_GDBUS_TYPE_SIM_SKELETON, 0,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
|
||||
async_initable_iface_init));
|
||||
async_initable_iface_init))
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
@@ -54,7 +54,7 @@ enum {
|
||||
|
||||
static GParamSpec *properties[PROP_LAST];
|
||||
|
||||
struct _MMSimPrivate {
|
||||
struct _MMBaseSimPrivate {
|
||||
/* The connection to the system bus */
|
||||
GDBusConnection *connection;
|
||||
/* The modem which owns this SIM */
|
||||
@@ -68,14 +68,14 @@ static guint signals[SIGNAL_LAST] = { 0 };
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
mm_sim_export (MMSim *self)
|
||||
mm_base_sim_export (MMBaseSim *self)
|
||||
{
|
||||
static guint id = 0;
|
||||
gchar *path;
|
||||
|
||||
path = g_strdup_printf (MM_DBUS_SIM_PREFIX "/%d", id++);
|
||||
g_object_set (self,
|
||||
MM_SIM_PATH, path,
|
||||
MM_BASE_SIM_PATH, path,
|
||||
NULL);
|
||||
g_free (path);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ mm_sim_export (MMSim *self)
|
||||
/* CHANGE PIN (Generic implementation) */
|
||||
|
||||
static gboolean
|
||||
change_pin_finish (MMSim *self,
|
||||
change_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -108,7 +108,7 @@ change_pin_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
change_pin (MMSim *self,
|
||||
change_pin (MMBaseSim *self,
|
||||
const gchar *old_pin,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -138,7 +138,7 @@ change_pin (MMSim *self,
|
||||
/* CHANGE PIN (DBus call handling) */
|
||||
|
||||
typedef struct {
|
||||
MMSim *self;
|
||||
MMBaseSim *self;
|
||||
GDBusMethodInvocation *invocation;
|
||||
gchar *old_pin;
|
||||
gchar *new_pin;
|
||||
@@ -177,13 +177,13 @@ after_change_update_lock_info_ready (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
static void
|
||||
handle_change_pin_ready (MMSim *self,
|
||||
handle_change_pin_ready (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
HandleChangePinContext *ctx)
|
||||
{
|
||||
MMModemLock known_lock = MM_MODEM_LOCK_UNKNOWN;
|
||||
|
||||
if (!MM_SIM_GET_CLASS (self)->change_pin_finish (self, res, &ctx->save_error)) {
|
||||
if (!MM_BASE_SIM_GET_CLASS (self)->change_pin_finish (self, res, &ctx->save_error)) {
|
||||
if (g_error_matches (ctx->save_error,
|
||||
MM_MOBILE_EQUIPMENT_ERROR,
|
||||
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK))
|
||||
@@ -211,8 +211,8 @@ handle_change_pin_auth_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
/* If changing PIN is not implemented, report an error */
|
||||
if (!MM_SIM_GET_CLASS (ctx->self)->change_pin ||
|
||||
!MM_SIM_GET_CLASS (ctx->self)->change_pin_finish) {
|
||||
if (!MM_BASE_SIM_GET_CLASS (ctx->self)->change_pin ||
|
||||
!MM_BASE_SIM_GET_CLASS (ctx->self)->change_pin_finish) {
|
||||
g_dbus_method_invocation_return_error (ctx->invocation,
|
||||
MM_CORE_ERROR,
|
||||
MM_CORE_ERROR_UNSUPPORTED,
|
||||
@@ -222,7 +222,7 @@ handle_change_pin_auth_ready (MMBaseModem *modem,
|
||||
return;
|
||||
}
|
||||
|
||||
MM_SIM_GET_CLASS (ctx->self)->change_pin (ctx->self,
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->change_pin (ctx->self,
|
||||
ctx->old_pin,
|
||||
ctx->new_pin,
|
||||
(GAsyncReadyCallback)handle_change_pin_ready,
|
||||
@@ -230,7 +230,7 @@ handle_change_pin_auth_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_change_pin (MMSim *self,
|
||||
handle_change_pin (MMBaseSim *self,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *old_pin,
|
||||
const gchar *new_pin,
|
||||
@@ -256,7 +256,7 @@ handle_change_pin (MMSim *self,
|
||||
/* ENABLE PIN (Generic implementation) */
|
||||
|
||||
static gboolean
|
||||
enable_pin_finish (MMSim *self,
|
||||
enable_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -280,7 +280,7 @@ enable_pin_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
enable_pin (MMSim *self,
|
||||
enable_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
gboolean enabled,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -310,7 +310,7 @@ enable_pin (MMSim *self,
|
||||
/* ENABLE PIN (DBus call handling) */
|
||||
|
||||
typedef struct {
|
||||
MMSim *self;
|
||||
MMBaseSim *self;
|
||||
GDBusMethodInvocation *invocation;
|
||||
gchar *pin;
|
||||
gboolean enabled;
|
||||
@@ -350,13 +350,13 @@ after_enable_update_lock_info_ready (MMIfaceModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
handle_enable_pin_ready (MMSim *self,
|
||||
handle_enable_pin_ready (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
HandleEnablePinContext *ctx)
|
||||
{
|
||||
MMModemLock known_lock = MM_MODEM_LOCK_UNKNOWN;
|
||||
|
||||
if (!MM_SIM_GET_CLASS (self)->enable_pin_finish (self, res, &ctx->save_error)) {
|
||||
if (!MM_BASE_SIM_GET_CLASS (self)->enable_pin_finish (self, res, &ctx->save_error)) {
|
||||
if (g_error_matches (ctx->save_error,
|
||||
MM_MOBILE_EQUIPMENT_ERROR,
|
||||
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK))
|
||||
@@ -384,8 +384,8 @@ handle_enable_pin_auth_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
/* If changing PIN is not implemented, report an error */
|
||||
if (!MM_SIM_GET_CLASS (ctx->self)->enable_pin ||
|
||||
!MM_SIM_GET_CLASS (ctx->self)->enable_pin_finish) {
|
||||
if (!MM_BASE_SIM_GET_CLASS (ctx->self)->enable_pin ||
|
||||
!MM_BASE_SIM_GET_CLASS (ctx->self)->enable_pin_finish) {
|
||||
g_dbus_method_invocation_return_error (ctx->invocation,
|
||||
MM_CORE_ERROR,
|
||||
MM_CORE_ERROR_UNSUPPORTED,
|
||||
@@ -395,7 +395,7 @@ handle_enable_pin_auth_ready (MMBaseModem *modem,
|
||||
return;
|
||||
}
|
||||
|
||||
MM_SIM_GET_CLASS (ctx->self)->enable_pin (ctx->self,
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->enable_pin (ctx->self,
|
||||
ctx->pin,
|
||||
ctx->enabled,
|
||||
(GAsyncReadyCallback)handle_enable_pin_ready,
|
||||
@@ -403,7 +403,7 @@ handle_enable_pin_auth_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_enable_pin (MMSim *self,
|
||||
handle_enable_pin (MMBaseSim *self,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *pin,
|
||||
gboolean enabled)
|
||||
@@ -428,7 +428,7 @@ handle_enable_pin (MMSim *self,
|
||||
/* SEND PIN/PUK (Generic implementation) */
|
||||
|
||||
static gboolean
|
||||
common_send_pin_puk_finish (MMSim *self,
|
||||
common_send_pin_puk_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ send_pin_puk_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
common_send_pin_puk (MMSim *self,
|
||||
common_send_pin_puk (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
const gchar *puk,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -480,7 +480,7 @@ common_send_pin_puk (MMSim *self,
|
||||
}
|
||||
|
||||
static void
|
||||
send_puk (MMSim *self,
|
||||
send_puk (MMBaseSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -490,7 +490,7 @@ send_puk (MMSim *self,
|
||||
}
|
||||
|
||||
static void
|
||||
send_pin (MMSim *self,
|
||||
send_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -502,7 +502,7 @@ send_pin (MMSim *self,
|
||||
/* SEND PIN/PUK (common logic) */
|
||||
|
||||
typedef struct {
|
||||
MMSim *self;
|
||||
MMBaseSim *self;
|
||||
GSimpleAsyncResult *result;
|
||||
GError *save_error;
|
||||
gulong wait_for_unlock_id;
|
||||
@@ -555,17 +555,17 @@ error_for_unlock_check (MMModemLock lock)
|
||||
}
|
||||
|
||||
gboolean
|
||||
mm_sim_send_pin_finish (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
mm_base_sim_send_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
mm_sim_send_puk_finish (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
mm_base_sim_send_puk_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||
}
|
||||
@@ -607,13 +607,13 @@ update_lock_info_ready (MMIfaceModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
send_pin_ready (MMSim *self,
|
||||
send_pin_ready (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
SendPinPukContext *ctx)
|
||||
{
|
||||
MMModemLock known_lock = MM_MODEM_LOCK_UNKNOWN;
|
||||
|
||||
if (!MM_SIM_GET_CLASS (self)->send_pin_finish (self, res, &ctx->save_error)) {
|
||||
if (!MM_BASE_SIM_GET_CLASS (self)->send_pin_finish (self, res, &ctx->save_error)) {
|
||||
if (g_error_matches (ctx->save_error,
|
||||
MM_MOBILE_EQUIPMENT_ERROR,
|
||||
MM_MOBILE_EQUIPMENT_ERROR_SIM_PUK))
|
||||
@@ -629,11 +629,11 @@ send_pin_ready (MMSim *self,
|
||||
}
|
||||
|
||||
static void
|
||||
send_puk_ready (MMSim *self,
|
||||
send_puk_ready (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
SendPinPukContext *ctx)
|
||||
{
|
||||
MM_SIM_GET_CLASS (self)->send_puk_finish (self, res, &ctx->save_error);
|
||||
MM_BASE_SIM_GET_CLASS (self)->send_puk_finish (self, res, &ctx->save_error);
|
||||
|
||||
/* Once pin/puk has been sent, recheck lock */
|
||||
mm_iface_modem_update_lock_info (MM_IFACE_MODEM (self->priv->modem),
|
||||
@@ -643,16 +643,16 @@ send_puk_ready (MMSim *self,
|
||||
}
|
||||
|
||||
void
|
||||
mm_sim_send_pin (MMSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
mm_base_sim_send_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
SendPinPukContext *ctx;
|
||||
|
||||
/* If sending PIN is not implemented, report an error */
|
||||
if (!MM_SIM_GET_CLASS (self)->send_pin ||
|
||||
!MM_SIM_GET_CLASS (self)->send_pin_finish) {
|
||||
if (!MM_BASE_SIM_GET_CLASS (self)->send_pin ||
|
||||
!MM_BASE_SIM_GET_CLASS (self)->send_pin_finish) {
|
||||
g_simple_async_report_error_in_idle (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
@@ -668,26 +668,26 @@ mm_sim_send_pin (MMSim *self,
|
||||
ctx->result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
mm_sim_send_pin);
|
||||
mm_base_sim_send_pin);
|
||||
|
||||
MM_SIM_GET_CLASS (self)->send_pin (self,
|
||||
MM_BASE_SIM_GET_CLASS (self)->send_pin (self,
|
||||
pin,
|
||||
(GAsyncReadyCallback)send_pin_ready,
|
||||
ctx);
|
||||
}
|
||||
|
||||
void
|
||||
mm_sim_send_puk (MMSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
mm_base_sim_send_puk (MMBaseSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
SendPinPukContext *ctx;
|
||||
|
||||
/* If sending PIN is not implemented, report an error */
|
||||
if (!MM_SIM_GET_CLASS (self)->send_puk ||
|
||||
!MM_SIM_GET_CLASS (self)->send_puk_finish) {
|
||||
if (!MM_BASE_SIM_GET_CLASS (self)->send_puk ||
|
||||
!MM_BASE_SIM_GET_CLASS (self)->send_puk_finish) {
|
||||
g_simple_async_report_error_in_idle (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
@@ -703,9 +703,9 @@ mm_sim_send_puk (MMSim *self,
|
||||
ctx->result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
mm_sim_send_puk);
|
||||
mm_base_sim_send_puk);
|
||||
|
||||
MM_SIM_GET_CLASS (self)->send_puk (self,
|
||||
MM_BASE_SIM_GET_CLASS (self)->send_puk (self,
|
||||
puk,
|
||||
new_pin,
|
||||
(GAsyncReadyCallback)send_puk_ready,
|
||||
@@ -716,7 +716,7 @@ mm_sim_send_puk (MMSim *self,
|
||||
/* SEND PIN (DBus call handling) */
|
||||
|
||||
typedef struct {
|
||||
MMSim *self;
|
||||
MMBaseSim *self;
|
||||
GDBusMethodInvocation *invocation;
|
||||
gchar *pin;
|
||||
} HandleSendPinContext;
|
||||
@@ -731,13 +731,13 @@ handle_send_pin_context_free (HandleSendPinContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
handle_send_pin_ready (MMSim *self,
|
||||
handle_send_pin_ready (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
HandleSendPinContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_sim_send_pin_finish (self, res, &error))
|
||||
if (!mm_base_sim_send_pin_finish (self, res, &error))
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
else
|
||||
mm_gdbus_sim_complete_send_pin (MM_GDBUS_SIM (self), ctx->invocation);
|
||||
@@ -758,14 +758,14 @@ handle_send_pin_auth_ready (MMBaseModem *modem,
|
||||
return;
|
||||
}
|
||||
|
||||
mm_sim_send_pin (ctx->self,
|
||||
ctx->pin,
|
||||
(GAsyncReadyCallback)handle_send_pin_ready,
|
||||
ctx);
|
||||
mm_base_sim_send_pin (ctx->self,
|
||||
ctx->pin,
|
||||
(GAsyncReadyCallback)handle_send_pin_ready,
|
||||
ctx);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_send_pin (MMSim *self,
|
||||
handle_send_pin (MMBaseSim *self,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *pin)
|
||||
{
|
||||
@@ -788,7 +788,7 @@ handle_send_pin (MMSim *self,
|
||||
/* SEND PUK (DBus call handling) */
|
||||
|
||||
typedef struct {
|
||||
MMSim *self;
|
||||
MMBaseSim *self;
|
||||
GDBusMethodInvocation *invocation;
|
||||
gchar *puk;
|
||||
gchar *new_pin;
|
||||
@@ -805,13 +805,13 @@ handle_send_puk_context_free (HandleSendPukContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
handle_send_puk_ready (MMSim *self,
|
||||
handle_send_puk_ready (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
HandleSendPukContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_sim_send_puk_finish (self, res, &error))
|
||||
if (!mm_base_sim_send_puk_finish (self, res, &error))
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
else
|
||||
mm_gdbus_sim_complete_send_puk (MM_GDBUS_SIM (self), ctx->invocation);
|
||||
@@ -832,15 +832,15 @@ handle_send_puk_auth_ready (MMBaseModem *modem,
|
||||
return;
|
||||
}
|
||||
|
||||
mm_sim_send_puk (ctx->self,
|
||||
ctx->puk,
|
||||
ctx->new_pin,
|
||||
(GAsyncReadyCallback)handle_send_puk_ready,
|
||||
ctx);
|
||||
mm_base_sim_send_puk (ctx->self,
|
||||
ctx->puk,
|
||||
ctx->new_pin,
|
||||
(GAsyncReadyCallback)handle_send_puk_ready,
|
||||
ctx);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_send_puk (MMSim *self,
|
||||
handle_send_puk (MMBaseSim *self,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin)
|
||||
@@ -864,7 +864,7 @@ handle_send_puk (MMSim *self,
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
mm_sim_dbus_export (MMSim *self)
|
||||
sim_dbus_export (MMBaseSim *self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
@@ -898,7 +898,7 @@ mm_sim_dbus_export (MMSim *self)
|
||||
}
|
||||
|
||||
static void
|
||||
mm_sim_dbus_unexport (MMSim *self)
|
||||
sim_dbus_unexport (MMBaseSim *self)
|
||||
{
|
||||
/* Only unexport if currently exported */
|
||||
if (g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (self)))
|
||||
@@ -908,7 +908,7 @@ mm_sim_dbus_unexport (MMSim *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
const gchar *
|
||||
mm_sim_get_path (MMSim *self)
|
||||
mm_base_sim_get_path (MMBaseSim *self)
|
||||
{
|
||||
return self->priv->path;
|
||||
}
|
||||
@@ -984,7 +984,7 @@ parse_iccid (const gchar *response,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
load_sim_identifier_finish (MMSim *self,
|
||||
load_sim_identifier_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1006,7 +1006,7 @@ load_sim_identifier_finish (MMSim *self,
|
||||
STR_REPLY_READY_FN (load_sim_identifier)
|
||||
|
||||
static void
|
||||
load_sim_identifier (MMSim *self,
|
||||
load_sim_identifier (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -1054,7 +1054,7 @@ parse_imsi (const gchar *response,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
load_imsi_finish (MMSim *self,
|
||||
load_imsi_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1076,7 +1076,7 @@ load_imsi_finish (MMSim *self,
|
||||
STR_REPLY_READY_FN (load_imsi)
|
||||
|
||||
static void
|
||||
load_imsi (MMSim *self,
|
||||
load_imsi (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -1177,7 +1177,7 @@ parse_mnc_length (const gchar *response,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
load_operator_identifier_finish (MMSim *self,
|
||||
load_operator_identifier_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1212,7 +1212,7 @@ load_operator_identifier_finish (MMSim *self,
|
||||
STR_REPLY_READY_FN (load_operator_identifier)
|
||||
|
||||
static void
|
||||
load_operator_identifier (MMSim *self,
|
||||
load_operator_identifier (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -1307,7 +1307,7 @@ parse_spn (const gchar *response,
|
||||
}
|
||||
|
||||
static gchar *
|
||||
load_operator_name_finish (MMSim *self,
|
||||
load_operator_name_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1323,7 +1323,7 @@ load_operator_name_finish (MMSim *self,
|
||||
STR_REPLY_READY_FN (load_operator_name)
|
||||
|
||||
static void
|
||||
load_operator_name (MMSim *self,
|
||||
load_operator_name (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -1359,7 +1359,7 @@ typedef enum {
|
||||
struct _InitAsyncContext {
|
||||
GSimpleAsyncResult *result;
|
||||
GCancellable *cancellable;
|
||||
MMSim *self;
|
||||
MMBaseSim *self;
|
||||
InitializationStep step;
|
||||
guint sim_identifier_tries;
|
||||
};
|
||||
@@ -1374,9 +1374,9 @@ init_async_context_free (InitAsyncContext *ctx)
|
||||
g_free (ctx);
|
||||
}
|
||||
|
||||
MMSim *
|
||||
mm_sim_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
MMBaseSim *
|
||||
mm_base_sim_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
GObject *source;
|
||||
GObject *sim;
|
||||
@@ -1389,9 +1389,9 @@ mm_sim_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1403,14 +1403,14 @@ initable_init_finish (GAsyncInitable *initable,
|
||||
}
|
||||
|
||||
static void
|
||||
load_sim_identifier_ready (MMSim *self,
|
||||
load_sim_identifier_ready (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
InitAsyncContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gchar *simid;
|
||||
|
||||
simid = MM_SIM_GET_CLASS (ctx->self)->load_sim_identifier_finish (self, res, &error);
|
||||
simid = MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier_finish (self, res, &error);
|
||||
if (!simid) {
|
||||
/* TODO: make the retries gobi-specific? */
|
||||
|
||||
@@ -1440,14 +1440,14 @@ load_sim_identifier_ready (MMSim *self,
|
||||
#undef STR_REPLY_READY_FN
|
||||
#define STR_REPLY_READY_FN(NAME,DISPLAY) \
|
||||
static void \
|
||||
load_##NAME##_ready (MMSim *self, \
|
||||
load_##NAME##_ready (MMBaseSim *self, \
|
||||
GAsyncResult *res, \
|
||||
InitAsyncContext *ctx) \
|
||||
{ \
|
||||
GError *error = NULL; \
|
||||
gchar *val; \
|
||||
\
|
||||
val = MM_SIM_GET_CLASS (ctx->self)->load_##NAME##_finish (self, res, &error); \
|
||||
val = MM_BASE_SIM_GET_CLASS (ctx->self)->load_##NAME##_finish (self, res, &error); \
|
||||
mm_gdbus_sim_set_##NAME (MM_GDBUS_SIM (self), val); \
|
||||
g_free (val); \
|
||||
\
|
||||
@@ -1488,9 +1488,9 @@ interface_initialization_step (InitAsyncContext *ctx)
|
||||
* lifetime of the modem. Therefore, if we already have them loaded,
|
||||
* don't try to load them again. */
|
||||
if (mm_gdbus_sim_get_sim_identifier (MM_GDBUS_SIM (ctx->self)) == NULL &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_sim_identifier &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_sim_identifier_finish) {
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_sim_identifier (
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier &&
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier_finish) {
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_sim_identifier (
|
||||
ctx->self,
|
||||
(GAsyncReadyCallback)load_sim_identifier_ready,
|
||||
ctx);
|
||||
@@ -1504,9 +1504,9 @@ interface_initialization_step (InitAsyncContext *ctx)
|
||||
* lifetime of the modem. Therefore, if we already have them loaded,
|
||||
* don't try to load them again. */
|
||||
if (mm_gdbus_sim_get_imsi (MM_GDBUS_SIM (ctx->self)) == NULL &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_imsi &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_imsi_finish) {
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_imsi (
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_imsi &&
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_imsi_finish) {
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_imsi (
|
||||
ctx->self,
|
||||
(GAsyncReadyCallback)load_imsi_ready,
|
||||
ctx);
|
||||
@@ -1520,9 +1520,9 @@ interface_initialization_step (InitAsyncContext *ctx)
|
||||
* lifetime of the modem. Therefore, if we already have them loaded,
|
||||
* don't try to load them again. */
|
||||
if (mm_gdbus_sim_get_operator_identifier (MM_GDBUS_SIM (ctx->self)) == NULL &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_operator_identifier &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_operator_identifier_finish) {
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_operator_identifier (
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_identifier &&
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_identifier_finish) {
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_identifier (
|
||||
ctx->self,
|
||||
(GAsyncReadyCallback)load_operator_identifier_ready,
|
||||
ctx);
|
||||
@@ -1536,9 +1536,9 @@ interface_initialization_step (InitAsyncContext *ctx)
|
||||
* lifetime of the modem. Therefore, if we already have them loaded,
|
||||
* don't try to load them again. */
|
||||
if (mm_gdbus_sim_get_operator_name (MM_GDBUS_SIM (ctx->self)) == NULL &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_operator_name &&
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_operator_name_finish) {
|
||||
MM_SIM_GET_CLASS (ctx->self)->load_operator_name (
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_name &&
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_name_finish) {
|
||||
MM_BASE_SIM_GET_CLASS (ctx->self)->load_operator_name (
|
||||
ctx->self,
|
||||
(GAsyncReadyCallback)load_operator_name_ready,
|
||||
ctx);
|
||||
@@ -1599,33 +1599,33 @@ initable_init_async (GAsyncInitable *initable,
|
||||
}
|
||||
|
||||
void
|
||||
mm_sim_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
mm_base_sim_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_async_initable_new_async (MM_TYPE_SIM,
|
||||
g_async_initable_new_async (MM_TYPE_BASE_SIM,
|
||||
G_PRIORITY_DEFAULT,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
mm_sim_initialize_finish (MMSim *self,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
mm_base_sim_initialize_finish (MMBaseSim *self,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
return initable_init_finish (G_ASYNC_INITABLE (self), result, error);
|
||||
}
|
||||
|
||||
void
|
||||
mm_sim_initialize (MMSim *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
mm_base_sim_initialize (MMBaseSim *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
common_init_async (G_ASYNC_INITABLE (self),
|
||||
cancellable,
|
||||
@@ -1639,7 +1639,7 @@ set_property (GObject *object,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MMSim *self = MM_SIM (object);
|
||||
MMBaseSim *self = MM_BASE_SIM (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PATH:
|
||||
@@ -1649,7 +1649,7 @@ set_property (GObject *object,
|
||||
/* Export when we get a DBus connection AND we have a path */
|
||||
if (self->priv->path &&
|
||||
self->priv->connection)
|
||||
mm_sim_dbus_export (self);
|
||||
sim_dbus_export (self);
|
||||
break;
|
||||
case PROP_CONNECTION:
|
||||
g_clear_object (&self->priv->connection);
|
||||
@@ -1657,9 +1657,9 @@ set_property (GObject *object,
|
||||
|
||||
/* Export when we get a DBus connection AND we have a path */
|
||||
if (!self->priv->connection)
|
||||
mm_sim_dbus_unexport (self);
|
||||
sim_dbus_unexport (self);
|
||||
else if (self->priv->path)
|
||||
mm_sim_dbus_export (self);
|
||||
sim_dbus_export (self);
|
||||
break;
|
||||
case PROP_MODEM:
|
||||
g_clear_object (&self->priv->modem);
|
||||
@@ -1668,7 +1668,7 @@ set_property (GObject *object,
|
||||
/* Bind the modem's connection (which is set when it is exported,
|
||||
* and unset when unexported) to the SIM's connection */
|
||||
g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION,
|
||||
self, MM_SIM_CONNECTION,
|
||||
self, MM_BASE_SIM_CONNECTION,
|
||||
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||
}
|
||||
break;
|
||||
@@ -1684,7 +1684,7 @@ get_property (GObject *object,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MMSim *self = MM_SIM (object);
|
||||
MMBaseSim *self = MM_BASE_SIM (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PATH:
|
||||
@@ -1703,39 +1703,37 @@ get_property (GObject *object,
|
||||
}
|
||||
|
||||
static void
|
||||
mm_sim_init (MMSim *self)
|
||||
mm_base_sim_init (MMBaseSim *self)
|
||||
{
|
||||
/* Initialize private data */
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
MM_TYPE_SIM,
|
||||
MMSimPrivate);
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_BASE_SIM, MMBaseSimPrivate);
|
||||
}
|
||||
|
||||
static void
|
||||
finalize (GObject *object)
|
||||
{
|
||||
MMSim *self = MM_SIM (object);
|
||||
MMBaseSim *self = MM_BASE_SIM (object);
|
||||
|
||||
g_free (self->priv->path);
|
||||
|
||||
G_OBJECT_CLASS (mm_sim_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (mm_base_sim_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
MMSim *self = MM_SIM (object);
|
||||
MMBaseSim *self = MM_BASE_SIM (object);
|
||||
|
||||
if (self->priv->connection) {
|
||||
/* If we arrived here with a valid connection, make sure we unexport
|
||||
* the object */
|
||||
mm_sim_dbus_unexport (self);
|
||||
sim_dbus_unexport (self);
|
||||
g_clear_object (&self->priv->connection);
|
||||
}
|
||||
|
||||
g_clear_object (&self->priv->modem);
|
||||
|
||||
G_OBJECT_CLASS (mm_sim_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (mm_base_sim_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1746,11 +1744,11 @@ async_initable_iface_init (GAsyncInitableIface *iface)
|
||||
}
|
||||
|
||||
static void
|
||||
mm_sim_class_init (MMSimClass *klass)
|
||||
mm_base_sim_class_init (MMBaseSimClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMSimPrivate));
|
||||
g_type_class_add_private (object_class, sizeof (MMBaseSimPrivate));
|
||||
|
||||
/* Virtual methods */
|
||||
object_class->get_property = get_property;
|
||||
@@ -1776,7 +1774,7 @@ mm_sim_class_init (MMSimClass *klass)
|
||||
klass->change_pin_finish = change_pin_finish;
|
||||
|
||||
properties[PROP_CONNECTION] =
|
||||
g_param_spec_object (MM_SIM_CONNECTION,
|
||||
g_param_spec_object (MM_BASE_SIM_CONNECTION,
|
||||
"Connection",
|
||||
"GDBus connection to the system bus.",
|
||||
G_TYPE_DBUS_CONNECTION,
|
||||
@@ -1784,7 +1782,7 @@ mm_sim_class_init (MMSimClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_CONNECTION, properties[PROP_CONNECTION]);
|
||||
|
||||
properties[PROP_PATH] =
|
||||
g_param_spec_string (MM_SIM_PATH,
|
||||
g_param_spec_string (MM_BASE_SIM_PATH,
|
||||
"Path",
|
||||
"DBus path of the SIM",
|
||||
NULL,
|
||||
@@ -1792,7 +1790,7 @@ mm_sim_class_init (MMSimClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]);
|
||||
|
||||
properties[PROP_MODEM] =
|
||||
g_param_spec_object (MM_SIM_MODEM,
|
||||
g_param_spec_object (MM_BASE_SIM_MODEM,
|
||||
"Modem",
|
||||
"The Modem which owns this SIM",
|
||||
MM_TYPE_BASE_MODEM,
|
||||
@@ -1801,10 +1799,10 @@ mm_sim_class_init (MMSimClass *klass)
|
||||
|
||||
/* Signals */
|
||||
signals[SIGNAL_PIN_LOCK_ENABLED] =
|
||||
g_signal_new (MM_SIM_PIN_LOCK_ENABLED,
|
||||
g_signal_new (MM_BASE_SIM_PIN_LOCK_ENABLED,
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (MMSimClass, pin_lock_enabled),
|
||||
G_STRUCT_OFFSET (MMBaseSimClass, pin_lock_enabled),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_generic,
|
||||
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
|
||||
@@ -0,0 +1,168 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details:
|
||||
*
|
||||
* Author: Aleksander Morgado <aleksander@lanedo.com>
|
||||
*
|
||||
* Copyright (C) 2011 Google, Inc.
|
||||
*/
|
||||
|
||||
#ifndef MM_BASE_SIM_H
|
||||
#define MM_BASE_SIM_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include <mm-gdbus-sim.h>
|
||||
#include "mm-base-modem.h"
|
||||
|
||||
#define MM_TYPE_BASE_SIM (mm_base_sim_get_type ())
|
||||
#define MM_BASE_SIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_SIM, MMBaseSim))
|
||||
#define MM_BASE_SIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BASE_SIM, MMBaseSimClass))
|
||||
#define MM_IS_BASE_SIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BASE_SIM))
|
||||
#define MM_IS_BASE_SIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BASE_SIM))
|
||||
#define MM_BASE_SIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BASE_SIM, MMBaseSimClass))
|
||||
|
||||
typedef struct _MMBaseSim MMBaseSim;
|
||||
typedef struct _MMBaseSimClass MMBaseSimClass;
|
||||
typedef struct _MMBaseSimPrivate MMBaseSimPrivate;
|
||||
|
||||
/* Properties */
|
||||
#define MM_BASE_SIM_PATH "sim-path"
|
||||
#define MM_BASE_SIM_CONNECTION "sim-connection"
|
||||
#define MM_BASE_SIM_MODEM "sim-modem"
|
||||
|
||||
/* Signals */
|
||||
#define MM_BASE_SIM_PIN_LOCK_ENABLED "sim-pin-lock-enabled"
|
||||
|
||||
struct _MMBaseSim {
|
||||
MmGdbusSimSkeleton parent;
|
||||
MMBaseSimPrivate *priv;
|
||||
};
|
||||
|
||||
struct _MMBaseSimClass {
|
||||
MmGdbusSimSkeletonClass parent;
|
||||
|
||||
/* Load SIM identifier (async) */
|
||||
void (* load_sim_identifier) (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_sim_identifier_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Load IMSI (async) */
|
||||
void (* load_imsi) (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_imsi_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Load operator identifier (async) */
|
||||
void (* load_operator_identifier) (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_operator_identifier_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Load operator name (async) */
|
||||
void (* load_operator_name) (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_operator_name_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Change PIN (async) */
|
||||
void (* change_pin) (MMBaseSim *self,
|
||||
const gchar *old_pin,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* change_pin_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Enable PIN (async) */
|
||||
void (* enable_pin) (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
gboolean enabled,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* enable_pin_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Send PIN (async) */
|
||||
void (* send_pin) (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* send_pin_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Send PUK (async) */
|
||||
void (* send_puk) (MMBaseSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* send_puk_finish) (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Signals */
|
||||
void (* pin_lock_enabled) (MMBaseSim *self,
|
||||
gboolean enabled);
|
||||
};
|
||||
|
||||
GType mm_base_sim_get_type (void);
|
||||
|
||||
void mm_base_sim_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_base_sim_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_base_sim_initialize (MMBaseSim *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_base_sim_initialize_finish (MMBaseSim *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
void mm_base_sim_send_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_base_sim_send_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_base_sim_send_puk (MMBaseSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_base_sim_send_puk_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_base_sim_export (MMBaseSim *self);
|
||||
|
||||
const gchar *mm_base_sim_get_path (MMBaseSim *sim);
|
||||
|
||||
#endif /* MM_BASE_SIM_H */
|
||||
@@ -1161,7 +1161,7 @@ modem_create_bearer (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
@@ -2691,7 +2691,7 @@ load_power_state (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
|
||||
+10
-10
@@ -43,7 +43,7 @@
|
||||
#include "mm-bearer-list.h"
|
||||
#include "mm-sms-list.h"
|
||||
#include "mm-sms-part-3gpp.h"
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
#include "mm-log.h"
|
||||
#include "mm-modem-helpers.h"
|
||||
#include "mm-error-helpers.h"
|
||||
@@ -122,7 +122,7 @@ struct _MMBroadbandModemPrivate {
|
||||
/*<--- Modem interface --->*/
|
||||
/* Properties */
|
||||
GObject *modem_dbus_skeleton;
|
||||
MMSim *modem_sim;
|
||||
MMBaseSim *modem_sim;
|
||||
MMBearerList *modem_bearer_list;
|
||||
MMModemState modem_state;
|
||||
/* Implementation helpers */
|
||||
@@ -294,12 +294,12 @@ modem_create_bearer (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create SIM (Modem interface) */
|
||||
|
||||
static MMSim *
|
||||
static MMBaseSim *
|
||||
modem_create_sim_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return mm_sim_new_finish (res, error);
|
||||
return mm_base_sim_new_finish (res, error);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -308,10 +308,10 @@ modem_create_sim (MMIfaceModem *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
/* New generic SIM */
|
||||
mm_sim_new (MM_BASE_MODEM (self),
|
||||
NULL, /* cancellable */
|
||||
callback,
|
||||
user_data);
|
||||
mm_base_sim_new (MM_BASE_MODEM (self),
|
||||
NULL, /* cancellable */
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -1866,7 +1866,7 @@ initialization_context_complete_and_free_if_cancelled (InitializationContext *ct
|
||||
}
|
||||
|
||||
static void
|
||||
sim_pin_lock_enabled_cb (MMSim *self,
|
||||
sim_pin_lock_enabled_cb (MMBaseSim *self,
|
||||
gboolean enabled,
|
||||
MmGdbusModem3gpp *skeleton)
|
||||
{
|
||||
@@ -1896,7 +1896,7 @@ load_enabled_facility_locks_ready (MMIfaceModem3gpp *self,
|
||||
mm_warn ("couldn't load facility locks: '%s'", error->message);
|
||||
g_error_free (error);
|
||||
} else {
|
||||
MMSim *sim = NULL;
|
||||
MMBaseSim *sim = NULL;
|
||||
|
||||
/* We loaded the initial list of facility locks; but we do need to update
|
||||
* the SIM PIN lock status when that changes. We'll connect to the signal
|
||||
@@ -1906,7 +1906,7 @@ load_enabled_facility_locks_ready (MMIfaceModem3gpp *self,
|
||||
MM_IFACE_MODEM_SIM, &sim,
|
||||
NULL);
|
||||
g_signal_connect (sim,
|
||||
MM_SIM_PIN_LOCK_ENABLED,
|
||||
MM_BASE_SIM_PIN_LOCK_ENABLED,
|
||||
G_CALLBACK (sim_pin_lock_enabled_cb),
|
||||
ctx->skeleton);
|
||||
g_object_unref (sim);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <libmm-glib.h>
|
||||
|
||||
#include "mm-bearer-list.h"
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
#include "mm-error-helpers.h"
|
||||
#include "mm-iface-modem.h"
|
||||
#include "mm-iface-modem-3gpp.h"
|
||||
@@ -336,13 +336,13 @@ wait_for_initialized_ready (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
static void
|
||||
send_pin_ready (MMSim *sim,
|
||||
send_pin_ready (MMBaseSim *sim,
|
||||
GAsyncResult *res,
|
||||
ConnectionContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_sim_send_pin_finish (sim, res, &error)) {
|
||||
if (!mm_base_sim_send_pin_finish (sim, res, &error)) {
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
connection_context_free (ctx);
|
||||
return;
|
||||
@@ -360,7 +360,7 @@ update_lock_info_ready (MMIfaceModem *self,
|
||||
{
|
||||
GError *error = NULL;
|
||||
MMModemLock lock;
|
||||
MMSim *sim;
|
||||
MMBaseSim *sim;
|
||||
|
||||
lock = mm_iface_modem_update_lock_info_finish (self, res, &error);
|
||||
if (error) {
|
||||
@@ -407,10 +407,10 @@ update_lock_info_ready (MMIfaceModem *self,
|
||||
return;
|
||||
}
|
||||
|
||||
mm_sim_send_pin (sim,
|
||||
mm_simple_connect_properties_get_pin (ctx->properties),
|
||||
(GAsyncReadyCallback)send_pin_ready,
|
||||
ctx);
|
||||
mm_base_sim_send_pin (sim,
|
||||
mm_simple_connect_properties_get_pin (ctx->properties),
|
||||
(GAsyncReadyCallback)send_pin_ready,
|
||||
ctx);
|
||||
g_object_unref (sim);
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -22,7 +22,7 @@
|
||||
#include "mm-iface-modem.h"
|
||||
#include "mm-base-modem.h"
|
||||
#include "mm-base-modem-at.h"
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
#include "mm-bearer-list.h"
|
||||
#include "mm-log.h"
|
||||
#include "mm-context.h"
|
||||
@@ -4037,7 +4037,7 @@ sim_new_ready (GAsyncInitable *initable,
|
||||
GAsyncResult *res,
|
||||
InitializationContext *ctx)
|
||||
{
|
||||
MMSim *sim;
|
||||
MMBaseSim *sim;
|
||||
GError *error = NULL;
|
||||
|
||||
sim = MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->create_sim_finish (ctx->self, res, &error);
|
||||
@@ -4051,7 +4051,7 @@ sim_new_ready (GAsyncInitable *initable,
|
||||
/* We may get error with !sim, when the implementation doesn't want to
|
||||
* handle any (e.g. CDMA) */
|
||||
if (sim) {
|
||||
g_object_bind_property (sim, MM_SIM_PATH,
|
||||
g_object_bind_property (sim, MM_BASE_SIM_PATH,
|
||||
ctx->skeleton, "sim",
|
||||
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||
|
||||
@@ -4067,13 +4067,13 @@ sim_new_ready (GAsyncInitable *initable,
|
||||
}
|
||||
|
||||
static void
|
||||
sim_reinit_ready (MMSim *sim,
|
||||
sim_reinit_ready (MMBaseSim *sim,
|
||||
GAsyncResult *res,
|
||||
InitializationContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_sim_initialize_finish (sim, res, &error)) {
|
||||
if (!mm_base_sim_initialize_finish (sim, res, &error)) {
|
||||
mm_warn ("SIM re-initialization failed: '%s'",
|
||||
error ? error->message : "Unknown error");
|
||||
g_clear_error (&error);
|
||||
@@ -4544,7 +4544,7 @@ interface_initialization_step (InitializationContext *ctx)
|
||||
if (!mm_iface_modem_is_cdma_only (ctx->self) &&
|
||||
MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->create_sim &&
|
||||
MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->create_sim_finish) {
|
||||
MMSim *sim = NULL;
|
||||
MMBaseSim *sim = NULL;
|
||||
|
||||
g_object_get (ctx->self,
|
||||
MM_IFACE_MODEM_SIM, &sim,
|
||||
@@ -4560,10 +4560,10 @@ interface_initialization_step (InitializationContext *ctx)
|
||||
/* If already available the sim object, relaunch initialization.
|
||||
* This will try to load any missing property value that couldn't be
|
||||
* retrieved before due to having the SIM locked. */
|
||||
mm_sim_initialize (sim,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)sim_reinit_ready,
|
||||
ctx);
|
||||
mm_base_sim_initialize (sim,
|
||||
ctx->cancellable,
|
||||
(GAsyncReadyCallback)sim_reinit_ready,
|
||||
ctx);
|
||||
g_object_unref (sim);
|
||||
return;
|
||||
}
|
||||
@@ -5082,7 +5082,7 @@ iface_modem_init (gpointer g_iface)
|
||||
g_param_spec_object (MM_IFACE_MODEM_SIM,
|
||||
"SIM",
|
||||
"SIM object",
|
||||
MM_TYPE_SIM,
|
||||
MM_TYPE_BASE_SIM,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_interface_install_property
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "mm-charsets.h"
|
||||
#include "mm-port-serial-at.h"
|
||||
#include "mm-base-bearer.h"
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_IFACE_MODEM (mm_iface_modem_get_type ())
|
||||
#define MM_IFACE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_IFACE_MODEM, MMIfaceModem))
|
||||
@@ -315,9 +315,9 @@ struct _MMIfaceModem {
|
||||
void (*create_sim) (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim * (*create_sim_finish) (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
MMBaseSim * (*create_sim_finish) (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Create bearer */
|
||||
void (*create_bearer) (MMIfaceModem *self,
|
||||
|
||||
+39
-39
@@ -28,7 +28,7 @@
|
||||
#include "mm-log.h"
|
||||
#include "mm-sim-mbim.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimMbim, mm_sim_mbim, MM_TYPE_SIM)
|
||||
G_DEFINE_TYPE (MMSimMbim, mm_sim_mbim, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -42,7 +42,7 @@ peek_device (gpointer self,
|
||||
MMPortMbim *port;
|
||||
|
||||
g_object_get (G_OBJECT (self),
|
||||
MM_SIM_MODEM, &modem,
|
||||
MM_BASE_SIM_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (MM_IS_BASE_MODEM (modem));
|
||||
|
||||
@@ -67,7 +67,7 @@ peek_device (gpointer self,
|
||||
/* Load SIM identifier */
|
||||
|
||||
static gchar *
|
||||
load_sim_identifier_finish (MMSim *self,
|
||||
load_sim_identifier_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -108,7 +108,7 @@ simid_subscriber_ready_state_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
load_sim_identifier (MMSim *self,
|
||||
load_sim_identifier (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -135,7 +135,7 @@ load_sim_identifier (MMSim *self,
|
||||
/* Load IMSI */
|
||||
|
||||
static gchar *
|
||||
load_imsi_finish (MMSim *self,
|
||||
load_imsi_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -176,7 +176,7 @@ imsi_subscriber_ready_state_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
load_imsi (MMSim *self,
|
||||
load_imsi (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -203,7 +203,7 @@ load_imsi (MMSim *self,
|
||||
/* Load operator identifier */
|
||||
|
||||
static gchar *
|
||||
load_operator_identifier_finish (MMSim *self,
|
||||
load_operator_identifier_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -243,7 +243,7 @@ load_operator_identifier_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
load_operator_identifier (MMSim *self,
|
||||
load_operator_identifier (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -270,7 +270,7 @@ load_operator_identifier (MMSim *self,
|
||||
/* Load operator name */
|
||||
|
||||
static gchar *
|
||||
load_operator_name_finish (MMSim *self,
|
||||
load_operator_name_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -310,7 +310,7 @@ load_operator_name_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
load_operator_name (MMSim *self,
|
||||
load_operator_name (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ load_operator_name (MMSim *self,
|
||||
/* Send PIN */
|
||||
|
||||
static gboolean
|
||||
send_pin_finish (MMSim *self,
|
||||
send_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -386,7 +386,7 @@ pin_set_enter_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
send_pin (MMSim *self,
|
||||
send_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -428,7 +428,7 @@ send_pin (MMSim *self,
|
||||
/* Send PUK */
|
||||
|
||||
static gboolean
|
||||
send_puk_finish (MMSim *self,
|
||||
send_puk_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -478,7 +478,7 @@ puk_set_enter_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
send_puk (MMSim *self,
|
||||
send_puk (MMBaseSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -521,7 +521,7 @@ send_puk (MMSim *self,
|
||||
/* Enable PIN */
|
||||
|
||||
static gboolean
|
||||
enable_pin_finish (MMSim *self,
|
||||
enable_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -558,7 +558,7 @@ pin_set_enable_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
enable_pin (MMSim *self,
|
||||
enable_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
gboolean enabled,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -601,7 +601,7 @@ enable_pin (MMSim *self,
|
||||
/* Change PIN */
|
||||
|
||||
static gboolean
|
||||
change_pin_finish (MMSim *self,
|
||||
change_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -638,7 +638,7 @@ pin_set_change_ready (MbimDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
change_pin (MMSim *self,
|
||||
change_pin (MMBaseSim *self,
|
||||
const gchar *old_pin,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -679,7 +679,7 @@ change_pin (MMSim *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_mbim_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -694,9 +694,9 @@ mm_sim_mbim_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -710,7 +710,7 @@ mm_sim_mbim_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -722,22 +722,22 @@ mm_sim_mbim_init (MMSimMbim *self)
|
||||
static void
|
||||
mm_sim_mbim_class_init (MMSimMbimClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
sim_class->load_sim_identifier = load_sim_identifier;
|
||||
sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
sim_class->load_imsi = load_imsi;
|
||||
sim_class->load_imsi_finish = load_imsi_finish;
|
||||
sim_class->load_operator_identifier = load_operator_identifier;
|
||||
sim_class->load_operator_identifier_finish = load_operator_identifier_finish;
|
||||
sim_class->load_operator_name = load_operator_name;
|
||||
sim_class->load_operator_name_finish = load_operator_name_finish;
|
||||
sim_class->send_pin = send_pin;
|
||||
sim_class->send_pin_finish = send_pin_finish;
|
||||
sim_class->send_puk = send_puk;
|
||||
sim_class->send_puk_finish = send_puk_finish;
|
||||
sim_class->enable_pin = enable_pin;
|
||||
sim_class->enable_pin_finish = enable_pin_finish;
|
||||
sim_class->change_pin = change_pin;
|
||||
sim_class->change_pin_finish = change_pin_finish;
|
||||
base_sim_class->load_sim_identifier = load_sim_identifier;
|
||||
base_sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
base_sim_class->load_imsi = load_imsi;
|
||||
base_sim_class->load_imsi_finish = load_imsi_finish;
|
||||
base_sim_class->load_operator_identifier = load_operator_identifier;
|
||||
base_sim_class->load_operator_identifier_finish = load_operator_identifier_finish;
|
||||
base_sim_class->load_operator_name = load_operator_name;
|
||||
base_sim_class->load_operator_name_finish = load_operator_name_finish;
|
||||
base_sim_class->send_pin = send_pin;
|
||||
base_sim_class->send_pin_finish = send_pin_finish;
|
||||
base_sim_class->send_puk = send_puk;
|
||||
base_sim_class->send_puk_finish = send_puk_finish;
|
||||
base_sim_class->enable_pin = enable_pin;
|
||||
base_sim_class->enable_pin_finish = enable_pin_finish;
|
||||
base_sim_class->change_pin = change_pin;
|
||||
base_sim_class->change_pin_finish = change_pin_finish;
|
||||
}
|
||||
|
||||
+9
-9
@@ -19,7 +19,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_MBIM (mm_sim_mbim_get_type ())
|
||||
#define MM_SIM_MBIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_MBIM, MMSimMbim))
|
||||
@@ -32,20 +32,20 @@ typedef struct _MMSimMbim MMSimMbim;
|
||||
typedef struct _MMSimMbimClass MMSimMbimClass;
|
||||
|
||||
struct _MMSimMbim {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimMbimClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_mbim_get_type (void);
|
||||
|
||||
void mm_sim_mbim_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_mbim_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_mbim_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_mbim_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_MBIM_H */
|
||||
|
||||
+35
-35
@@ -27,7 +27,7 @@
|
||||
#include "mm-log.h"
|
||||
#include "mm-sim-qmi.h"
|
||||
|
||||
G_DEFINE_TYPE (MMSimQmi, mm_sim_qmi, MM_TYPE_SIM);
|
||||
G_DEFINE_TYPE (MMSimQmi, mm_sim_qmi, MM_TYPE_BASE_SIM)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -43,7 +43,7 @@ ensure_qmi_client (MMSimQmi *self,
|
||||
MMPortQmi *port;
|
||||
|
||||
g_object_get (self,
|
||||
MM_SIM_MODEM, &modem,
|
||||
MM_BASE_SIM_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (MM_IS_BASE_MODEM (modem));
|
||||
|
||||
@@ -82,7 +82,7 @@ ensure_qmi_client (MMSimQmi *self,
|
||||
/* Load SIM ID (ICCID) */
|
||||
|
||||
static gchar *
|
||||
load_sim_identifier_finish (MMSim *self,
|
||||
load_sim_identifier_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -128,7 +128,7 @@ dms_uim_get_iccid_ready (QmiClientDms *client,
|
||||
}
|
||||
|
||||
static void
|
||||
load_sim_identifier (MMSim *self,
|
||||
load_sim_identifier (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -158,7 +158,7 @@ load_sim_identifier (MMSim *self,
|
||||
/* Load IMSI */
|
||||
|
||||
static gchar *
|
||||
load_imsi_finish (MMSim *self,
|
||||
load_imsi_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ dms_uim_get_imsi_ready (QmiClientDms *client,
|
||||
}
|
||||
|
||||
static void
|
||||
load_imsi (MMSim *self,
|
||||
load_imsi (MMBaseSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ pin_qmi_error_to_mobile_equipment_error (GError *qmi_error)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
send_pin_finish (MMSim *self,
|
||||
send_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -296,7 +296,7 @@ dms_uim_verify_pin_ready (QmiClientDms *client,
|
||||
}
|
||||
|
||||
static void
|
||||
send_pin (MMSim *self,
|
||||
send_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -335,7 +335,7 @@ send_pin (MMSim *self,
|
||||
/* Send PUK */
|
||||
|
||||
static gboolean
|
||||
send_puk_finish (MMSim *self,
|
||||
send_puk_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -370,7 +370,7 @@ dms_uim_unblock_pin_ready (QmiClientDms *client,
|
||||
}
|
||||
|
||||
static void
|
||||
send_puk (MMSim *self,
|
||||
send_puk (MMBaseSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -412,7 +412,7 @@ send_puk (MMSim *self,
|
||||
/* Change PIN */
|
||||
|
||||
static gboolean
|
||||
change_pin_finish (MMSim *self,
|
||||
change_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -447,7 +447,7 @@ dms_uim_change_pin_ready (QmiClientDms *client,
|
||||
}
|
||||
|
||||
static void
|
||||
change_pin (MMSim *self,
|
||||
change_pin (MMBaseSim *self,
|
||||
const gchar *old_pin,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -489,7 +489,7 @@ change_pin (MMSim *self,
|
||||
/* Enable PIN */
|
||||
|
||||
static gboolean
|
||||
enable_pin_finish (MMSim *self,
|
||||
enable_pin_finish (MMBaseSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -524,7 +524,7 @@ dms_uim_set_pin_protection_ready (QmiClientDms *client,
|
||||
}
|
||||
|
||||
static void
|
||||
enable_pin (MMSim *self,
|
||||
enable_pin (MMBaseSim *self,
|
||||
const gchar *pin,
|
||||
gboolean enabled,
|
||||
GAsyncReadyCallback callback,
|
||||
@@ -565,7 +565,7 @@ enable_pin (MMSim *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMSim *
|
||||
MMBaseSim *
|
||||
mm_sim_qmi_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -580,9 +580,9 @@ mm_sim_qmi_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid SIMs */
|
||||
mm_sim_export (MM_SIM (sim));
|
||||
mm_base_sim_export (MM_BASE_SIM (sim));
|
||||
|
||||
return MM_SIM (sim);
|
||||
return MM_BASE_SIM (sim);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -596,7 +596,7 @@ mm_sim_qmi_new (MMBaseModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_SIM_MODEM, modem,
|
||||
MM_BASE_SIM_MODEM, modem,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -608,22 +608,22 @@ mm_sim_qmi_init (MMSimQmi *self)
|
||||
static void
|
||||
mm_sim_qmi_class_init (MMSimQmiClass *klass)
|
||||
{
|
||||
MMSimClass *sim_class = MM_SIM_CLASS (klass);
|
||||
MMBaseSimClass *base_sim_class = MM_BASE_SIM_CLASS (klass);
|
||||
|
||||
sim_class->load_sim_identifier = load_sim_identifier;
|
||||
sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
sim_class->load_imsi = load_imsi;
|
||||
sim_class->load_imsi_finish = load_imsi_finish;
|
||||
sim_class->load_operator_identifier = NULL;
|
||||
sim_class->load_operator_identifier_finish = NULL;
|
||||
sim_class->load_operator_name = NULL;
|
||||
sim_class->load_operator_name_finish = NULL;
|
||||
sim_class->send_pin = send_pin;
|
||||
sim_class->send_pin_finish = send_pin_finish;
|
||||
sim_class->send_puk = send_puk;
|
||||
sim_class->send_puk_finish = send_puk_finish;
|
||||
sim_class->change_pin = change_pin;
|
||||
sim_class->change_pin_finish = change_pin_finish;
|
||||
sim_class->enable_pin = enable_pin;
|
||||
sim_class->enable_pin_finish = enable_pin_finish;
|
||||
base_sim_class->load_sim_identifier = load_sim_identifier;
|
||||
base_sim_class->load_sim_identifier_finish = load_sim_identifier_finish;
|
||||
base_sim_class->load_imsi = load_imsi;
|
||||
base_sim_class->load_imsi_finish = load_imsi_finish;
|
||||
base_sim_class->load_operator_identifier = NULL;
|
||||
base_sim_class->load_operator_identifier_finish = NULL;
|
||||
base_sim_class->load_operator_name = NULL;
|
||||
base_sim_class->load_operator_name_finish = NULL;
|
||||
base_sim_class->send_pin = send_pin;
|
||||
base_sim_class->send_pin_finish = send_pin_finish;
|
||||
base_sim_class->send_puk = send_puk;
|
||||
base_sim_class->send_puk_finish = send_puk_finish;
|
||||
base_sim_class->change_pin = change_pin;
|
||||
base_sim_class->change_pin_finish = change_pin_finish;
|
||||
base_sim_class->enable_pin = enable_pin;
|
||||
base_sim_class->enable_pin_finish = enable_pin_finish;
|
||||
}
|
||||
|
||||
+9
-9
@@ -19,7 +19,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-sim.h"
|
||||
#include "mm-base-sim.h"
|
||||
|
||||
#define MM_TYPE_SIM_QMI (mm_sim_qmi_get_type ())
|
||||
#define MM_SIM_QMI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_QMI, MMSimQmi))
|
||||
@@ -32,20 +32,20 @@ typedef struct _MMSimQmi MMSimQmi;
|
||||
typedef struct _MMSimQmiClass MMSimQmiClass;
|
||||
|
||||
struct _MMSimQmi {
|
||||
MMSim parent;
|
||||
MMBaseSim parent;
|
||||
};
|
||||
|
||||
struct _MMSimQmiClass {
|
||||
MMSimClass parent;
|
||||
MMBaseSimClass parent;
|
||||
};
|
||||
|
||||
GType mm_sim_qmi_get_type (void);
|
||||
|
||||
void mm_sim_qmi_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_qmi_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_sim_qmi_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseSim *mm_sim_qmi_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_SIM_QMI_H */
|
||||
|
||||
-168
@@ -1,168 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details:
|
||||
*
|
||||
* Author: Aleksander Morgado <aleksander@lanedo.com>
|
||||
*
|
||||
* Copyright (C) 2011 Google, Inc.
|
||||
*/
|
||||
|
||||
#ifndef MM_SIM_H
|
||||
#define MM_SIM_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include <mm-gdbus-sim.h>
|
||||
#include "mm-base-modem.h"
|
||||
|
||||
#define MM_TYPE_SIM (mm_sim_get_type ())
|
||||
#define MM_SIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM, MMSim))
|
||||
#define MM_SIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SIM, MMSimClass))
|
||||
#define MM_IS_SIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SIM))
|
||||
#define MM_IS_SIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SIM))
|
||||
#define MM_SIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SIM, MMSimClass))
|
||||
|
||||
typedef struct _MMSim MMSim;
|
||||
typedef struct _MMSimClass MMSimClass;
|
||||
typedef struct _MMSimPrivate MMSimPrivate;
|
||||
|
||||
/* Properties */
|
||||
#define MM_SIM_PATH "sim-path"
|
||||
#define MM_SIM_CONNECTION "sim-connection"
|
||||
#define MM_SIM_MODEM "sim-modem"
|
||||
|
||||
/* Signals */
|
||||
#define MM_SIM_PIN_LOCK_ENABLED "pin-lock-enabled"
|
||||
|
||||
struct _MMSim {
|
||||
MmGdbusSimSkeleton parent;
|
||||
MMSimPrivate *priv;
|
||||
};
|
||||
|
||||
struct _MMSimClass {
|
||||
MmGdbusSimSkeletonClass parent;
|
||||
|
||||
/* Load SIM identifier (async) */
|
||||
void (* load_sim_identifier) (MMSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_sim_identifier_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Load IMSI (async) */
|
||||
void (* load_imsi) (MMSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_imsi_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Load operator identifier (async) */
|
||||
void (* load_operator_identifier) (MMSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_operator_identifier_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Load operator name (async) */
|
||||
void (* load_operator_name) (MMSim *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (* load_operator_name_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Change PIN (async) */
|
||||
void (* change_pin) (MMSim *self,
|
||||
const gchar *old_pin,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* change_pin_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Enable PIN (async) */
|
||||
void (* enable_pin) (MMSim *self,
|
||||
const gchar *pin,
|
||||
gboolean enabled,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* enable_pin_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Send PIN (async) */
|
||||
void (* send_pin) (MMSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* send_pin_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Send PUK (async) */
|
||||
void (* send_puk) (MMSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* send_puk_finish) (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Signals */
|
||||
void (*pin_lock_enabled) (MMSim *self,
|
||||
gboolean enabled);
|
||||
};
|
||||
|
||||
GType mm_sim_get_type (void);
|
||||
|
||||
void mm_sim_new (MMBaseModem *modem,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMSim *mm_sim_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_sim_initialize (MMSim *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_sim_initialize_finish (MMSim *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
void mm_sim_send_pin (MMSim *self,
|
||||
const gchar *pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_sim_send_pin_finish (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_sim_send_puk (MMSim *self,
|
||||
const gchar *puk,
|
||||
const gchar *new_pin,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_sim_send_puk_finish (MMSim *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_sim_export (MMSim *self);
|
||||
|
||||
const gchar *mm_sim_get_path (MMSim *sim);
|
||||
|
||||
#endif /* MM_SIM_H */
|
||||
Reference in New Issue
Block a user