iface-modem: add hook to load hardware revision
This commit is contained in:
committed by
Aleksander Morgado
parent
e32510418a
commit
daa59aeb4c
@@ -3831,6 +3831,7 @@ typedef enum {
|
||||
INITIALIZATION_STEP_MANUFACTURER,
|
||||
INITIALIZATION_STEP_MODEL,
|
||||
INITIALIZATION_STEP_REVISION,
|
||||
INITIALIZATION_STEP_HARDWARE_REVISION,
|
||||
INITIALIZATION_STEP_EQUIPMENT_ID,
|
||||
INITIALIZATION_STEP_DEVICE_ID,
|
||||
INITIALIZATION_STEP_SUPPORTED_MODES,
|
||||
@@ -4050,6 +4051,7 @@ load_supported_capabilities_ready (MMIfaceModem *self,
|
||||
STR_REPLY_READY_FN (manufacturer, "Manufacturer")
|
||||
STR_REPLY_READY_FN (model, "Model")
|
||||
STR_REPLY_READY_FN (revision, "Revision")
|
||||
STR_REPLY_READY_FN (hardware_revision, "HardwareRevision")
|
||||
STR_REPLY_READY_FN (equipment_identifier, "Equipment Identifier")
|
||||
STR_REPLY_READY_FN (device_identifier, "Device Identifier")
|
||||
|
||||
@@ -4587,6 +4589,22 @@ interface_initialization_step (GTask *task)
|
||||
/* Fall down to next step */
|
||||
ctx->step++;
|
||||
|
||||
case INITIALIZATION_STEP_HARDWARE_REVISION:
|
||||
/* HardwareRevision 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_hardware_revision (ctx->skeleton) == NULL &&
|
||||
MM_IFACE_MODEM_GET_INTERFACE (self)->load_hardware_revision &&
|
||||
MM_IFACE_MODEM_GET_INTERFACE (self)->load_hardware_revision_finish) {
|
||||
MM_IFACE_MODEM_GET_INTERFACE (self)->load_hardware_revision (
|
||||
self,
|
||||
(GAsyncReadyCallback)load_hardware_revision_ready,
|
||||
task);
|
||||
return;
|
||||
}
|
||||
/* Fall down to next step */
|
||||
ctx->step++;
|
||||
|
||||
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,
|
||||
|
||||
@@ -84,6 +84,14 @@ struct _MMIfaceModem {
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Loading of the HardwareRevision property */
|
||||
void (*load_hardware_revision) (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gchar * (*load_hardware_revision_finish) (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Loading of the EquipmentIdentifier property */
|
||||
void (*load_equipment_identifier) (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
|
||||
Reference in New Issue
Block a user