ModemManager.Modem

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.DBusInterface Gio.DBusInterface GObject.GInterface->Gio.DBusInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable ModemManager.GdbusModem ModemManager.GdbusModem GObject.GInterface->ModemManager.GdbusModem GObject.Object GObject.Object Gio.DBusProxy Gio.DBusProxy GObject.Object->Gio.DBusProxy Gio.AsyncInitable->Gio.DBusProxy Gio.DBusInterface->Gio.DBusProxy ModemManager.GdbusModemProxy ModemManager.GdbusModemProxy Gio.DBusProxy->ModemManager.GdbusModemProxy Gio.Initable->Gio.DBusProxy ModemManager.GdbusModem->ModemManager.GdbusModemProxy ModemManager.Modem ModemManager.Modem ModemManager.GdbusModemProxy->ModemManager.Modem

Subclasses:

None

Methods

Inherited:

ModemManager.GdbusModemProxy (6), Gio.DBusProxy (25), GObject.Object (37), Gio.AsyncInitable (4), Gio.DBusInterface (3), Gio.Initable (2), ModemManager.GdbusModem (55)

Structs:

GObject.ObjectClass (5)

class

get_pending_network_initiated_sessions (self)

class

peek_pending_network_initiated_sessions (self)

command (cmd, timeout, cancellable, callback, *user_data)

command_finish (res)

command_sync (cmd, timeout, cancellable)

create_bearer (properties, cancellable, callback, *user_data)

create_bearer_finish (res)

create_bearer_sync (properties, cancellable)

delete_bearer (bearer, cancellable, callback, *user_data)

delete_bearer_finish (res)

delete_bearer_sync (bearer, cancellable)

disable (cancellable, callback, *user_data)

disable_finish (res)

disable_sync (cancellable)

dup_bearer_paths ()

dup_carrier_configuration ()

dup_carrier_configuration_revision ()

dup_device ()

dup_device_identifier ()

dup_drivers ()

dup_equipment_identifier ()

dup_hardware_revision ()

dup_manufacturer ()

dup_model ()

dup_own_numbers ()

dup_path ()

dup_physdev ()

dup_plugin ()

dup_primary_port ()

dup_revision ()

dup_sim_path ()

dup_sim_slot_paths ()

enable (cancellable, callback, *user_data)

enable_finish (res)

enable_sync (cancellable)

factory_reset (code, cancellable, callback, *user_data)

factory_reset_finish (res)

factory_reset_sync (code, cancellable)

get_access_technologies ()

get_bearer_paths ()

get_carrier_configuration ()

get_carrier_configuration_revision ()

get_cell_info (cancellable, callback, *user_data)

get_cell_info_finish (res)

get_cell_info_sync (cancellable)

get_current_bands ()

get_current_capabilities ()

get_current_modes ()

get_device ()

get_device_identifier ()

get_drivers ()

get_equipment_identifier ()

get_hardware_revision ()

get_manufacturer ()

get_max_active_bearers ()

get_max_active_multiplexed_bearers ()

get_max_bearers ()

get_model ()

get_physdev ()

get_plugin ()

get_ports ()

get_power_state ()

get_primary_port ()

get_primary_sim_slot ()

get_revision ()

get_signal_quality ()

get_sim (cancellable, callback, *user_data)

get_sim_finish (res)

get_sim_slot_paths ()

get_sim_sync (cancellable)

get_state ()

get_state_failed_reason ()

get_supported_bands ()

get_supported_capabilities ()

get_supported_ip_families ()

get_supported_modes ()

get_unlock_required ()

get_unlock_retries ()

list_bearers (cancellable, callback, *user_data)

list_bearers_finish (res)

list_bearers_sync (cancellable)

list_sim_slots (cancellable, callback, *user_data)

list_sim_slots_finish (res)

list_sim_slots_sync (cancellable)

peek_current_bands ()

peek_ports ()

peek_supported_bands ()

peek_supported_capabilities ()

peek_supported_modes ()

peek_unlock_retries ()

reset (cancellable, callback, *user_data)

reset_finish (res)

reset_sync (cancellable)

set_current_bands (bands, n_bands, cancellable, callback, *user_data)

set_current_bands_finish (res)

set_current_bands_sync (bands, n_bands, cancellable)

set_current_capabilities (capabilities, cancellable, callback, *user_data)

set_current_capabilities_finish (res)

set_current_capabilities_sync (capabilities, cancellable)

set_current_modes (modes, preferred, cancellable, callback, *user_data)

set_current_modes_finish (res)

set_current_modes_sync (modes, preferred, cancellable)

set_power_state (state, cancellable, callback, *user_data)

set_power_state_finish (res)

set_power_state_sync (state, cancellable)

set_primary_sim_slot (sim_slot, cancellable, callback, *user_data)

set_primary_sim_slot_finish (res)

set_primary_sim_slot_sync (sim_slot, cancellable)

Virtual Methods

Inherited:

Gio.DBusProxy (2), GObject.Object (7), Gio.AsyncInitable (2), Gio.DBusInterface (3), Gio.Initable (1), ModemManager.GdbusModem (14)

Properties

Inherited:

Gio.DBusProxy (9), ModemManager.GdbusModem (36)

Signals

Inherited:

Gio.DBusProxy (2), GObject.Object (1), ModemManager.GdbusModem (14)

Fields

Inherited:

Gio.DBusProxy (2), GObject.Object (1), ModemManager.GdbusModem (14)

Name

Type

Access

Description

parent

ModemManager.GdbusModemProxy

r

Class Details

class ModemManager.Modem(**kwargs)
Bases:

ModemManager.GdbusModemProxy

Abstract:

No

Structure:

ModemManager.ModemClass

The ModemManager.Modem structure contains private data and should only be accessed using the provided API.

classmethod get_pending_network_initiated_sessions(self)
Parameters:

self (ModemManager.ModemOma) – A ModemManager.Modem.

Returns:

True if sessions and n_sessions are set, False otherwise.

sessions:

Return location for the array of ModemManager.OmaPendingNetworkInitiatedSession structs. The returned array should be freed with GLib.free() when no longer needed.

Return type:

(bool, sessions: [ModemManager.OmaPendingNetworkInitiatedSession])

Gets the list of pending network-initiated OMA sessions.

New in version 1.2.

Deprecated since version 1.18: Use ModemManager.ModemOma.get_pending_network_initiated_sessions() instead.

classmethod peek_pending_network_initiated_sessions(self)
Parameters:

self (ModemManager.ModemOma) – A ModemManager.Modem.

Returns:

True if sessions and n_sessions are set, False otherwise.

sessions:

Return location for the array of ModemManager.OmaPendingNetworkInitiatedSession values. Do not free the returned array, it is owned by self.

Return type:

(bool, sessions: [ModemManager.OmaPendingNetworkInitiatedSession])

Gets the list of pending network-initiated OMA sessions.

New in version 1.2.

Deprecated since version 1.18: Use ModemManager.ModemOma.peek_pending_network_initiated_sessions() instead.

command(cmd, timeout, cancellable, callback, *user_data)
Parameters:

Asynchronously runs an AT command in the modem.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.command_finish() to get the result of the operation.

See ModemManager.Modem.command_sync() for the synchronous, blocking version of this method.

New in version 1.0.

command_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.command().

Raises:

GLib.Error

Returns:

A newly allocated string with the reply to the command, or None if error is set. The returned value should be freed with GLib.free().

Return type:

str

Finishes an operation started with ModemManager.Modem.command().

New in version 1.0.

command_sync(cmd, timeout, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

A newly allocated string with the reply to the command, or None if error is set. The returned value should be freed with GLib.free().

Return type:

str

Synchronously runs an AT command in the modem.

The calling thread is blocked until a reply is received. See ModemManager.Modem.command() for the asynchronous version of this method.

New in version 1.0.

create_bearer(properties, cancellable, callback, *user_data)
Parameters:

Asynchronously creates a new packet data bearer in the ModemManager.Modem.

This request may fail if the modem does not support additional bearers, if too many bearers are already defined, or if properties are invalid.

See ‘CreateBearer [gdbus-method-org-freedesktop-ModemManager1-Modem.CreateBearer]’ to check which properties may be passed.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.create_bearer_finish() to get the result of the operation.

See ModemManager.Modem.create_bearer_sync() for the synchronous, blocking version of this method.

New in version 1.0.

create_bearer_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.create_bearer().

Raises:

GLib.Error

Returns:

A newly created ModemManager.Bearer, or None if error is set.

Return type:

ModemManager.Bearer

Finishes an operation started with ModemManager.Modem.create_bearer().

New in version 1.0.

create_bearer_sync(properties, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

A newly created ModemManager.Bearer, or None if error is set.

Return type:

ModemManager.Bearer

Synchronously creates a new packet data bearer in the ModemManager.Modem.

This request may fail if the modem does not support additional bearers, if too many bearers are already defined, or if properties are invalid.

See ‘CreateBearer [gdbus-method-org-freedesktop-ModemManager1-Modem.CreateBearer]’ to check which properties may be passed.

The calling thread is blocked until a reply is received. See ModemManager.Modem.create_bearer() for the asynchronous version of this method.

New in version 1.0.

delete_bearer(bearer, cancellable, callback, *user_data)
Parameters:

Asynchronously deletes a given bearer from the ModemManager.Modem.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.delete_bearer_finish() to get the result of the operation.

See ModemManager.Modem.delete_bearer_sync() for the synchronous, blocking version of this method.

New in version 1.0.

delete_bearer_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.delete_bearer().

Raises:

GLib.Error

Returns:

True if the bearer was deleted, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.delete_bearer().

New in version 1.0.

delete_bearer_sync(bearer, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the bearer was deleted, False if error is set.

Return type:

bool

Synchronously deletes a given bearer from the ModemManager.Modem.

The calling thread is blocked until a reply is received. See ModemManager.Modem.delete_bearer() for the asynchronous version of this method.

New in version 1.0.

disable(cancellable, callback, *user_data)
Parameters:

Asynchronously tries to disable the ModemManager.Modem. When disabled, the modem enters low-power state and no network-related operations are available.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.disable_finish() to get the result of the operation.

See ModemManager.Modem.disable_sync() for the synchronous, blocking version of this method.

New in version 1.0.

disable_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.disable().

Raises:

GLib.Error

Returns:

True if the modem was properly disabled, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.disable().

New in version 1.0.

disable_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if the modem was properly disabled, False if error is set.

Return type:

bool

Synchronously tries to disable the ModemManager.Modem. When disabled, the modem enters low-power state and no network-related operations are available.

The calling thread is blocked until a reply is received. See ModemManager.Modem.disable() for the asynchronous version of this method.

New in version 1.0.

dup_bearer_paths()
Returns:

The DBus paths of the ModemManager.Bearer handled in this ModemManager.Modem, or None if none available. The returned value should be freed with GLib.strfreev().

Return type:

[str]

Gets a copy of the DBus paths of the ModemManager.Bearer handled in this ModemManager.Modem.

New in version 1.0.

dup_carrier_configuration()
Returns:

The carrier configuration, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the carrier-specific configuration (MCFG) in use, as reported by this ModemManager.Modem.

New in version 1.12.

dup_carrier_configuration_revision()
Returns:

The carrier configuration revision, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the carrier-specific configuration revision in use, as reported by this ModemManager.Modem.

New in version 1.12.

dup_device()
Returns:

The device, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the physical modem device reference (ie, USB, PCI, PCMCIA device), which may be dependent upon the operating system.

New in version 1.0.

dup_device_identifier()
Returns:

The device identifier, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of a best-effort device identifier based on various device information like model name, firmware revision, USB/PCI/PCMCIA IDs, and other properties.

This ID is not guaranteed to be unique and may be shared between identical devices with the same firmware, but is intended to be “unique enough” for use as a casual device identifier for various user experience operations.

This is not the device’s IMEI or ESN since those may not be available before unlocking the device via a PIN.

New in version 1.0.

dup_drivers()
Returns:

The drivers, or None if none available. The returned value should be freed with GLib.strfreev().

Return type:

[str]

Gets a copy of the Operating System device driver handling communication with the modem hardware.

New in version 1.0.

dup_equipment_identifier()
Returns:

The equipment identifier, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the identity of the ModemManager.Modem.

This will be the IMEI number for GSM devices and the hex-format ESN/MEID for CDMA devices.

New in version 1.0.

dup_hardware_revision()
Returns:

The equipment hardware revision, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the equipment hardware revision, as reported by this ModemManager.Modem.

New in version 1.8.

dup_manufacturer()
Returns:

The equipment manufacturer, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the equipment manufacturer, as reported by this ModemManager.Modem.

New in version 1.0.

dup_model()
Returns:

The equipment model, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the equipment model, as reported by this ModemManager.Modem.

New in version 1.0.

dup_own_numbers()
Returns:

The list of own numbers or None if none is available. The returned value should be freed with GLib.strfreev().

Return type:

[str]

Gets a copy of the list of numbers (e.g. MSISDN in 3GPP) being currently handled by this modem.

New in version 1.0.

dup_path()
Returns:

The DBus path of the ModemManager.Object. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the DBus path of the ModemManager.Object object which implements this interface.

New in version 1.0.

dup_physdev()
Returns:

The physdev path, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the physical modem device path (ie, USB, PCI, PCMCIA device), which may be dependent upon the operating system.

New in version 1.22.

dup_plugin()
Returns:

The name of the plugin, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the name of the plugin handling this ModemManager.Modem.

New in version 1.0.

dup_primary_port()
Returns:

The name of the primary port. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the name of the primary port controlling this ModemManager.Modem.

New in version 1.0.

dup_revision()
Returns:

The equipment revision, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the equipment revision, as reported by this ModemManager.Modem.

New in version 1.0.

dup_sim_path()
Returns:

The DBus path of the ModemManager.Sim handled in this ModemManager.Modem, or None if none available. The returned value should be freed with GLib.free().

Return type:

str

Gets a copy of the DBus path of the ModemManager.Sim handled in this ModemManager.Modem.

New in version 1.0.

dup_sim_slot_paths()
Returns:

The DBus paths of the ModemManager.Sim objects handled in this ModemManager.Modem, or None if none available. The returned value should be freed with GLib.strfreev().

Return type:

[str]

Gets a copy of the DBus paths of the ModemManager.Sim objects available in the different SIM slots handled in this ModemManager.Modem. If a given SIM slot at a given index doesn’t have a SIM card available, an empty object path will be given. This list includes the currently active SIM object path.

New in version 1.16.

enable(cancellable, callback, *user_data)
Parameters:

Asynchronously tries to enable the ModemManager.Modem. When enabled, the modem’s radio is powered on and data sessions, voice calls, location services, and Short Message Service may be available.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.enable_finish() to get the result of the operation.

See ModemManager.Modem.enable_sync() for the synchronous, blocking version of this method.

New in version 1.0.

enable_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.enable().

Raises:

GLib.Error

Returns:

True if the modem was properly enabled, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.enable().

New in version 1.0.

enable_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if the modem was properly enabled, False if error is set.

Return type:

bool

Synchronously tries to enable the ModemManager.Modem. When enabled, the modem’s radio is powered on and data sessions, voice calls, location services, and Short Message Service may be available.

The calling thread is blocked until a reply is received. See ModemManager.Modem.enable() for the asynchronous version of this method.

New in version 1.0.

factory_reset(code, cancellable, callback, *user_data)
Parameters:

Asynchronously clears the modem’s configuration (including persistent configuration and state), and returns the device to a factory-default state.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.factory_reset_finish() to get the result of the operation.

See ModemManager.Modem.factory_reset_sync() for the synchronous, blocking version of this method.

New in version 1.0.

factory_reset_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.factory_reset().

Raises:

GLib.Error

Returns:

True if the factory_reset was successful, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.factory_reset().

New in version 1.0.

factory_reset_sync(code, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the factory reset was successful, False if error is set.

Return type:

bool

Synchronously clears the modem’s configuration (including persistent configuration and state), and returns the device to a factory-default state.

The calling thread is blocked until a reply is received. See ModemManager.Modem.factory_reset() for the asynchronous version of this method.

New in version 1.0.

get_access_technologies()
Returns:

A #:obj:ModemManager.ModemAccessTechnology value.

Return type:

ModemManager.ModemAccessTechnology

Gets the current network access technology used by the ModemManager.Modem to communicate with the network.

New in version 1.0.

get_bearer_paths()
Returns:

The DBus paths of the ModemManager.Bearer handled in this ModemManager.Modem, or None if none available. Do not free the returned value, it belongs to self.

Return type:

[str]

Gets the DBus paths of the ModemManager.Bearer handled in this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_bearer_paths() if on another thread.

New in version 1.0.

get_carrier_configuration()
Returns:

The carrier configuration, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the carrier-specific configuration (MCFG) in use, as reported by this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_carrier_configuration() if on another thread.

New in version 1.12.

get_carrier_configuration_revision()
Returns:

The carrier configuration revision, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the carrier-specific configuration revision in use, as reported by this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_carrier_configuration() if on another thread.

New in version 1.12.

get_cell_info(cancellable, callback, *user_data)
Parameters:

Asynchronously requests to get info about serving and neighboring cells.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.get_cell_info_finish() to get the result of the operation.

See ModemManager.Modem.get_cell_info_sync() for the synchronous, blocking version of this method.

New in version 1.20.

get_cell_info_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.get_cell_info().

Raises:

GLib.Error

Returns:

a list of ModemManager.CellInfo objects, or None if error is set. The returned value should be freed with g_list_free_full() using GObject.Object.unref() as GLib.DestroyNotify function.

Return type:

[ModemManager.CellInfo]

Finishes an operation started with ModemManager.Modem.get_cell_info().

New in version 1.20.

get_cell_info_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

a list of ModemManager.CellInfo objects, or None if error is set. The returned value should be freed with g_list_free_full() using GObject.Object.unref() as GLib.DestroyNotify function.

Return type:

[ModemManager.CellInfo]

Synchronously requests to get info about serving and neighboring cells.

The calling thread is blocked until a reply is received. See ModemManager.Modem.get_cell_info() for the asynchronous version of this method.

New in version 1.20.

get_current_bands()
Returns:

True if bands and n_bands are set, False otherwise.

bands:

Return location for the array of ModemManager.ModemBand values. The returned array should be freed with GLib.free() when no longer needed.

Return type:

(bool, bands: [ModemManager.ModemBand])

Gets the list of radio frequency and technology bands the ModemManager.Modem is currently using when connecting to a network.

For POTS devices, only the ModemManager.ModemBand.ANY band is supported.

New in version 1.0.

get_current_capabilities()
Returns:

A bitmask of ModemManager.ModemCapability flags.

Return type:

ModemManager.ModemCapability

Gets the list of generic families of access technologies supported by this ModemManager.Modem without a firmware reload or reinitialization.

New in version 1.0.

get_current_modes()
Returns:

True if allowed and preferred are set, False otherwise.

allowed:

Return location for a bitmask of ModemManager.ModemMode values.

preferred:

Return location for a ModemManager.ModemMode value.

Return type:

(bool, allowed: ModemManager.ModemMode, preferred: ModemManager.ModemMode)

Gets the list of modes specifying the access technologies (eg 2G/3G/4G) the ModemManager.Modem is currently allowed to use when connecting to a network, as well as the preferred one, if any.

New in version 1.0.

get_device()
Returns:

The device, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the physical modem device reference (ie, USB, PCI, PCMCIA device), which may be dependent upon the operating system.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_device() if on another thread.

New in version 1.0.

get_device_identifier()
Returns:

The device identifier, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets a best-effort device identifier based on various device information like model name, firmware revision, USB/PCI/PCMCIA IDs, and other properties.

This ID is not guaranteed to be unique and may be shared between identical devices with the same firmware, but is intended to be “unique enough” for use as a casual device identifier for various user experience operations.

This is not the device’s IMEI or ESN since those may not be available before unlocking the device via a PIN.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_device_identifier() if on another thread.

New in version 1.0.

get_drivers()
Returns:

The drivers, or None if none available. Do not free the returned value, it belongs to self.

Return type:

[str]

Gets the Operating System device drivers handling communication with the modem hardware.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_drivers() if on another thread.

New in version 1.0.

get_equipment_identifier()
Returns:

The equipment identifier, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the identity of the ModemManager.Modem.

This will be the IMEI number for GSM devices and the hex-format ESN/MEID for CDMA devices.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_equipment_identifier() if on another thread.

New in version 1.0.

get_hardware_revision()
Returns:

The equipment hardware revision, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the equipment hardware revision, as reported by this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_hardware_revision() if on another thread.

New in version 1.8.

get_manufacturer()
Returns:

The equipment manufacturer, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the equipment manufacturer, as reported by this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_manufacturer() if on another thread.

New in version 1.0.

get_max_active_bearers()
Returns:

the maximum number of active packet data bearers.

Return type:

int

Gets the maximum number of active packet data bearers this ModemManager.Modem supports without enabling multiplexing support.

POTS and CDMA2000-only devices support one active bearer, while GSM/UMTS and LTE/5GNR capable devices (including 3GPP+3GPP3 multimode devices) may support one or more active bearers, depending on the amount of physical ports exposed by the device.

New in version 1.0.

get_max_active_multiplexed_bearers()
Returns:

the maximum number of active packet data bearers, or 0 if multiplexing is not supported.

Return type:

int

Gets the maximum number of active packet data bearers this ModemManager.Modem supports after enabling multiplexing support on one single network interface.

New in version 1.18.

get_max_bearers()
Returns:

the maximum number of defined packet data bearers.

Return type:

int

Gets the maximum number of defined packet data bearers this ModemManager.Modem supports.

This is not the number of active/connected bearers the modem supports, but simply the number of bearers that may be defined at any given time. For example, POTS and CDMA2000-only devices support only one bearer, while GSM/UMTS devices typically support three or more, and any LTE-capable device (whether LTE-only, GSM/UMTS-capable, and/or CDMA2000-capable) also typically support three or more.

New in version 1.0.

Deprecated since version 1.18.: There is no way to query the modem how many bearers it supports, so the value exposed in this property in all the different implementations is always equal to the one retrieved with ModemManager.Modem.get_max_active_bearers(), so there is no point in using this method.

get_model()
Returns:

The equipment model, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the equipment model, as reported by this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_model() if on another thread.

New in version 1.0.

get_physdev()
Returns:

The physdev path, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the physical modem device path (ie, USB, PCI, PCMCIA device), which may be dependent upon the operating system.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_physdev() if on another thread.

New in version 1.22.

get_plugin()
Returns:

The name of the plugin, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the name of the plugin handling this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_plugin() if on another thread.

New in version 1.0.

get_ports()
Returns:

True if ports and n_ports are set, False otherwise.

ports:

Return location for the array of ModemManager.ModemPortInfo values. The returned array should be freed with ModemManager.ModemPortInfo.array_free() when no longer needed.

Return type:

(bool, ports: [ModemManager.ModemPortInfo])

Gets the list of ports in the modem.

New in version 1.0.

get_power_state()
Returns:

A ModemManager.ModemPowerState value.

Return type:

ModemManager.ModemPowerState

Gets the power state of the ModemManager.Modem.

New in version 1.0.

get_primary_port()
Returns:

The name of the primary port. Do not free the returned value, it belongs to self.

Return type:

str

Gets the name of the primary port controlling this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_primary_port() if on another thread.

New in version 1.0.

get_primary_sim_slot()
Returns:

slot number, in the [1,N] range.

Return type:

int

Gets the SIM slot number of the primary active SIM.

New in version 1.16.

get_revision()
Returns:

The equipment revision, or None if none available. Do not free the returned value, it belongs to self.

Return type:

str

Gets the equipment revision, as reported by this ModemManager.Modem.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_revision() if on another thread.

New in version 1.0.

get_signal_quality()
Returns:

The signal quality.

recent:

Return location for the flag specifying if the signal quality value was recent or not.

Return type:

(int, recent: bool)

Gets the signal quality value in percent (0 - 100) of the dominant access technology the ModemManager.Modem is using to communicate with the network.

Always 0 for POTS devices.

New in version 1.0.

get_sim(cancellable, callback, *user_data)
Parameters:

Asynchronously gets the ModemManager.Sim object managed by this ModemManager.Modem.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.get_sim_finish() to get the result of the operation.

See ModemManager.Modem.get_sim_sync() for the synchronous, blocking version of this method.

New in version 1.0.

get_sim_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.get_sim().

Raises:

GLib.Error

Returns:

a ModemManager.Sim or None if error is set. The returned value should be freed with GObject.Object.unref().

Return type:

ModemManager.Sim

Finishes an operation started with ModemManager.Modem.get_sim().

New in version 1.0.

get_sim_slot_paths()
Returns:

The DBus paths of the ModemManager.Sim objects handled in this ModemManager.Modem, or None if none available. Do not free the returned value, it belongs to self.

Return type:

[str]

Gets the DBus paths of the ModemManager.Sim objects available in the different SIM slots handled in this ModemManager.Modem. If a given SIM slot at a given index doesn’t have a SIM card available, an empty object path will be given. This list includes the currently active SIM object path.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.dup_sim_slot_paths() if on another thread.

New in version 1.16.

get_sim_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

a ModemManager.Sim or None if error is set. The returned value should be freed with GObject.Object.unref().

Return type:

ModemManager.Sim

Synchronously gets the ModemManager.Sim object managed by this ModemManager.Modem.

The calling thread is blocked until a reply is received. See ModemManager.Modem.get_sim() for the asynchronous version of this method.

New in version 1.0.

get_state()
Returns:

A ModemManager.ModemState value.

Return type:

ModemManager.ModemState

Gets the overall state of the ModemManager.Modem.

New in version 1.0.

get_state_failed_reason()
Returns:

A ModemManager.ModemStateFailedReason value.

Return type:

ModemManager.ModemStateFailedReason

Gets the reason specifying why the modem is in ModemManager.ModemState.FAILED state.

New in version 1.0.

get_supported_bands()
Returns:

True if bands and n_bands are set, False otherwise.

bands:

Return location for the array of ModemManager.ModemBand values. The returned array should be freed with GLib.free() when no longer needed.

Return type:

(bool, bands: [ModemManager.ModemBand])

Gets the list of radio frequency and technology bands supported by the ModemManager.Modem.

For POTS devices, only ModemManager.ModemBand.ANY will be returned in bands.

New in version 1.0.

get_supported_capabilities()
Returns:

True if capabilities and n_capabilities are set, False otherwise.

capabilities:

Return location for the array of ModemManager.ModemCapability values. The returned array should be freed with GLib.free() when no longer needed.

Return type:

(bool, capabilities: [ModemManager.ModemCapability])

Gets the list of combinations of generic families of access technologies supported by this ModemManager.Modem.

New in version 1.0.

get_supported_ip_families()
Returns:

A bitmask of ModemManager.BearerIpFamily values.

Return type:

ModemManager.BearerIpFamily

Gets the list of supported IP families.

New in version 1.0.

get_supported_modes()
Returns:

True if modes and n_modes are set, False otherwise.

modes:

Return location for the array of ModemManager.ModemModeCombination structs. The returned array should be freed with GLib.free() when no longer needed.

Return type:

(bool, modes: [ModemManager.ModemModeCombination])

Gets the list of supported mode combinations.

New in version 1.0.

get_unlock_required()
Returns:

A ModemManager.ModemLock value, specifying the current lock state.

Return type:

ModemManager.ModemLock

Gets current lock state of the ModemManager.Modem.

New in version 1.0.

get_unlock_retries()
Returns:

A ModemManager.UnlockRetries that must be freed with GObject.Object.unref() or None if unknown.

Return type:

ModemManager.UnlockRetries

Gets a ModemManager.UnlockRetries object, which provides, for each

ModemManager.ModemLock handled by the modem, the number of PIN tries remaining before the code becomes blocked (requiring a PUK) or permanently blocked.

The values reported by self are not updated when the values in the interface change. Instead, the client is expected to call ModemManager.Modem.get_unlock_retries() again to get a new ModemManager.UnlockRetries with the new values.

New in version 1.0.

list_bearers(cancellable, callback, *user_data)
Parameters:

Asynchronously lists the packet data bearers in the ModemManager.Modem.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.list_bearers_finish() to get the result of the operation.

See ModemManager.Modem.list_bearers_sync() for the synchronous, blocking version of this method.

New in version 1.0.

list_bearers_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.list_bearers().

Raises:

GLib.Error

Returns:

The list of ModemManager.Bearer objects, or None if either none found or if error is set.

Return type:

[ModemManager.Bearer]

Finishes an operation started with ModemManager.Modem.list_bearers().

New in version 1.0.

list_bearers_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

The list of ModemManager.Bearer objects, or None if either none found or if error is set.

Return type:

[ModemManager.Bearer]

Synchronously lists the packet data bearers in the ModemManager.Modem.

The calling thread is blocked until a reply is received. See ModemManager.Modem.list_bearers() for the asynchronous version of this method.

New in version 1.0.

list_sim_slots(cancellable, callback, *user_data)
Parameters:

Asynchronously lists the SIM slots available in the ModemManager.Modem.

The returned array contains one element per slot available in the system; a ModemManager.Sim in each of the slots that contains a valid SIM card or None if no SIM card is found.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.list_sim_slots_finish() to get the result of the operation.

See ModemManager.Modem.list_sim_slots_sync() for the synchronous, blocking version of this method.

New in version 1.16.

list_sim_slots_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.list_sim_slots().

Raises:

GLib.Error

Returns:

The array of ModemManager.Sim objects, or None if error is set.

Return type:

[ModemManager.Sim]

Finishes an operation started with ModemManager.Modem.list_sim_slots().

New in version 1.16.

list_sim_slots_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

The array of ModemManager.Sim objects, or None if error is set.

Return type:

[ModemManager.Sim]

Synchronously lists the SIM slots available in the ModemManager.Modem.

The returned array contains one element per slot available in the system; a ModemManager.Sim in each of the slots that contains a valid SIM card or None if no SIM card is found.

The calling thread is blocked until a reply is received. See ModemManager.Modem.list_sim_slots() for the asynchronous version of this method.

New in version 1.16.

peek_current_bands()
Returns:

True if bands and n_bands are set, False otherwise.

bands:

Return location for the array of ModemManager.ModemBand values. Do not free the returned value, it is owned by self.

Return type:

(bool, bands: [ModemManager.ModemBand])

Gets the list of radio frequency and technology bands the ModemManager.Modem is currently using when connecting to a network.

For POTS devices, only the ModemManager.ModemBand.ANY band is supported.

New in version 1.0.

peek_ports()
Returns:

True if ports and n_ports are set, False otherwise.

ports:

Return location for the array of ModemManager.ModemPortInfo values. Do not free the returned value, it is owned by self.

Return type:

(bool, ports: [ModemManager.ModemPortInfo])

Gets the list of ports in the modem.

New in version 1.0.

peek_supported_bands()
Returns:

True if bands and n_bands are set, False otherwise.

bands:

Return location for the array of ModemManager.ModemBand values. Do not free the returned array, it is owned by self.

Return type:

(bool, bands: [ModemManager.ModemBand])

Gets the list of radio frequency and technology bands supported by the ModemManager.Modem.

For POTS devices, only ModemManager.ModemBand.ANY will be returned in bands.

New in version 1.0.

peek_supported_capabilities()
Returns:

True if capabilities and n_capabilities are set, False otherwise.

capabilities:

Return location for the array of ModemManager.ModemCapability values. Do not free the returned array, it is owned by self.

Return type:

(bool, capabilities: [ModemManager.ModemCapability])

Gets the list of combinations of generic families of access technologies supported by this ModemManager.Modem.

New in version 1.0.

peek_supported_modes()
Returns:

True if modes and n_modes are set, False otherwise.

modes:

Return location for the array of ModemManager.ModemModeCombination values. Do not free the returned array, it is owned by self.

Return type:

(bool, modes: [ModemManager.ModemModeCombination])

Gets the list of supported mode combinations.

New in version 1.0.

peek_unlock_retries()
Returns:

A ModemManager.UnlockRetries. Do not free the returned value, it belongs to self.

Return type:

ModemManager.UnlockRetries

Gets a ModemManager.UnlockRetries object, which provides, for each

ModemManager.ModemLock handled by the modem, the number of PIN tries remaining before the code becomes blocked (requiring a PUK) or permanently blocked.

The returned value is only valid until the property changes so it is only safe to use this function on the thread where self was constructed. Use ModemManager.Modem.get_unlock_retries() if on another thread.

New in version 1.0.

reset(cancellable, callback, *user_data)
Parameters:

Asynchronously clears non-persistent configuration and state, and returns the device to a newly-powered-on state.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.reset_finish() to get the result of the operation.

See ModemManager.Modem.reset_sync() for the synchronous, blocking version of this method.

New in version 1.0.

reset_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.reset().

Raises:

GLib.Error

Returns:

True if the reset was successful, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.reset().

New in version 1.0.

reset_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if the reset was successful, False if error is set.

Return type:

bool

Synchronously clears non-persistent configuration and state, and returns the device to a newly-powered-on state.

The calling thread is blocked until a reply is received. See ModemManager.Modem.reset() for the asynchronous version of this method.

New in version 1.0.

set_current_bands(bands, n_bands, cancellable, callback, *user_data)
Parameters:

Asynchronously sets the radio frequency and technology bands the device is currently allowed to use when connecting to a network.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.set_current_bands_finish() to get the result of the operation.

See ModemManager.Modem.set_current_bands_sync() for the synchronous, blocking version of this method.

New in version 1.0.

set_current_bands_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.set_current_bands().

Raises:

GLib.Error

Returns:

True if the bands were successfully set, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.set_current_bands().

New in version 1.0.

set_current_bands_sync(bands, n_bands, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the bands were successfully set, False if error is set.

Return type:

bool

Synchronously sets the radio frequency and technology bands the device is currently allowed to use when connecting to a network.

The calling thread is blocked until a reply is received. See ModemManager.Modem.set_current_bands() for the asynchronous version of this method.

New in version 1.0.

set_current_capabilities(capabilities, cancellable, callback, *user_data)
Parameters:

Asynchronously sets the capabilities of the device. A restart of the modem may be required.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.set_current_capabilities_finish() to get the result of the operation.

See ModemManager.Modem.set_current_capabilities_sync() for the synchronous, blocking version of this method.

New in version 1.0.

set_current_capabilities_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.set_current_capabilities().

Raises:

GLib.Error

Returns:

True if the capabilities were successfully set, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.set_current_capabilities().

New in version 1.0.

set_current_capabilities_sync(capabilities, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the capabilities were successfully set, False if error is set.

Return type:

bool

Synchronously sets the capabilities of the device. A restart of the modem may be required.

The calling thread is blocked until a reply is received. See ModemManager.Modem.set_current_capabilities() for the asynchronous version of this method.

New in version 1.0.

set_current_modes(modes, preferred, cancellable, callback, *user_data)
Parameters:

Asynchronously sets the access technologies (e.g. 2G/3G/4G preference) the device is currently allowed to use when connecting to a network.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.set_current_modes_finish() to get the result of the operation.

See ModemManager.Modem.set_current_modes_sync() for the synchronous, blocking version of this method.

New in version 1.0.

set_current_modes_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.set_current_modes().

Raises:

GLib.Error

Returns:

True if the allowed modes were successfully set, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.set_current_modes().

New in version 1.0.

set_current_modes_sync(modes, preferred, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the allowed modes were successfully set, False if error is set.

Return type:

bool

Synchronously sets the access technologies (e.g. 2G/3G/4G preference) the device is currently allowed to use when connecting to a network.

The calling thread is blocked until a reply is received. See ModemManager.Modem.set_current_modes() for the asynchronous version of this method.

New in version 1.0.

set_power_state(state, cancellable, callback, *user_data)
Parameters:

Asynchronously sets the power state of the device. This method can only be used while the modem is in ModemManager.ModemState.DISABLED state.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.set_power_state_finish() to get the result of the operation.

See ModemManager.Modem.set_power_state_sync() for the synchronous, blocking version of this method.

New in version 1.0.

set_power_state_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.set_power_state().

Raises:

GLib.Error

Returns:

True if the power state was successfully set, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.set_power_state().

New in version 1.0.

set_power_state_sync(state, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the power state was successfully set, False if error is set.

Return type:

bool

Synchronously sets the power state of the device. This method can only be used while the modem is in ModemManager.ModemState.DISABLED state.

The calling thread is blocked until a reply is received. See ModemManager.Modem.set_power_state() for the asynchronous version of this method.

New in version 1.0.

set_primary_sim_slot(sim_slot, cancellable, callback, *user_data)
Parameters:

Asynchronously requests to select which SIM slot to be considered as primary.

When the operation is finished, callback will be invoked in the

thread-default main loop of the thread you are calling this method from. You can then call ModemManager.Modem.set_primary_sim_slot_finish() to get the result of the operation.

See ModemManager.Modem.set_primary_sim_slot_sync() for the synchronous, blocking version of this method.

New in version 1.16.

set_primary_sim_slot_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to ModemManager.Modem.set_primary_sim_slot().

Raises:

GLib.Error

Returns:

True if the SIM slot switch has been successfully requested, False if error is set.

Return type:

bool

Finishes an operation started with ModemManager.Modem.set_primary_sim_slot().

New in version 1.16.

set_primary_sim_slot_sync(sim_slot, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the SIM slot switch has been successfully requested, False if error is set.

Return type:

bool

Synchronously requests to select which SIM slot to be considered as primary.

The calling thread is blocked until a reply is received. See ModemManager.Modem.set_primary_sim_slot() for the asynchronous version of this method.

New in version 1.16.