aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-11-22 17:40:52 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:22 +0100
commit9852433095eca82cb6efd842c74be85bbacb7ea6 (patch)
tree859df0a2be0496f10cc6bd75545cdf2c82f207cd
parent7a9b0d9faced7c960b7e35d48df9d705feb1932b (diff)
iface-modem: load `EquipmentIdentifier' and `DeviceIdentifier' during init
-rw-r--r--src/mm-iface-modem.c34
-rw-r--r--src/mm-iface-modem.h16
2 files changed, 50 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index c8adfcd3..1d76f9bc 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -114,6 +114,8 @@ typedef enum {
INITIALIZATION_STEP_MANUFACTURER,
INITIALIZATION_STEP_MODEL,
INITIALIZATION_STEP_REVISION,
+ INITIALIZATION_STEP_EQUIPMENT_ID,
+ INITIALIZATION_STEP_DEVICE_ID,
INITIALIZATION_STEP_LAST
} InitializationStep;
@@ -219,6 +221,8 @@ UINT_REPLY_READY_FN (max_active_bearers, "Max Active Bearers")
STR_REPLY_READY_FN (manufacturer, "Manufacturer")
STR_REPLY_READY_FN (model, "Model")
STR_REPLY_READY_FN (revision, "Revision")
+STR_REPLY_READY_FN (equipment_identifier, "Equipment Identifier")
+STR_REPLY_READY_FN (device_identifier, "Device Identifier")
static void
interface_initialization_step (InitializationContext *ctx)
@@ -373,6 +377,36 @@ interface_initialization_step (InitializationContext *ctx)
}
break;
+ case INITIALIZATION_STEP_EQUIPMENT_ID:
+ /* Equipment ID is meant to be loaded only once during the whole
+ * lifetime of the modem. Therefore, if we already have them loaded,
+ * don't try to load them again. */
+ if (mm_gdbus_modem_get_equipment_identifier (ctx->skeleton) == NULL &&
+ MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_equipment_identifier &&
+ MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_equipment_identifier_finish) {
+ MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_equipment_identifier (
+ ctx->self,
+ (GAsyncReadyCallback)load_equipment_identifier_ready,
+ ctx);
+ return;
+ }
+ break;
+
+ case INITIALIZATION_STEP_DEVICE_ID:
+ /* Device ID is meant to be loaded only once during the whole
+ * lifetime of the modem. Therefore, if we already have them loaded,
+ * don't try to load them again. */
+ if (mm_gdbus_modem_get_device_identifier (ctx->skeleton) == NULL &&
+ MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_device_identifier &&
+ MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_device_identifier_finish) {
+ MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_device_identifier (
+ ctx->self,
+ (GAsyncReadyCallback)load_device_identifier_ready,
+ ctx);
+ return;
+ }
+ break;
+
case INITIALIZATION_STEP_LAST:
/* We are done without errors! */
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h
index 1e56415d..56bfe3cf 100644
--- a/src/mm-iface-modem.h
+++ b/src/mm-iface-modem.h
@@ -86,6 +86,22 @@ struct _MMIfaceModem {
gchar * (*load_revision_finish) (MMIfaceModem *self,
GAsyncResult *res,
GError **error);
+
+ /* Loading of the EquipmentIdentifier property */
+ void (*load_equipment_identifier) (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gchar * (*load_equipment_identifier_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
+
+ /* Loading of the DeviceIdentifier property */
+ void (*load_device_identifier) (MMIfaceModem *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gchar * (*load_device_identifier_finish) (MMIfaceModem *self,
+ GAsyncResult *res,
+ GError **error);
};
GType mm_iface_modem_get_type (void);