diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-11-22 17:40:52 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:22 +0100 |
commit | 9852433095eca82cb6efd842c74be85bbacb7ea6 (patch) | |
tree | 859df0a2be0496f10cc6bd75545cdf2c82f207cd /src/mm-iface-modem.c | |
parent | 7a9b0d9faced7c960b7e35d48df9d705feb1932b (diff) |
iface-modem: load `EquipmentIdentifier' and `DeviceIdentifier' during init
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r-- | src/mm-iface-modem.c | 34 |
1 files changed, 34 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); |