Mbim.Device¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Number of consecutive timeouts detected in requests sent to the device |
||
r/w/co |
File to the underlying MBIM device |
||
r/w |
Flag to specify if the device is within a session |
||
r/w |
Current transaction ID |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Mbim.Device(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Mbim.Device
structure contains private data and should only be accessed using the provided API.New in version 1.0.
- classmethod new(file, cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the initialization is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously creates a
Mbim.Device
object to manage file. When the operation is finished, callback will be invoked. You can then callMbim.Device.new_finish
() to get the result of the operation.New in version 1.0.
- classmethod new_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
a newly created
Mbim.Device
, orNone
if error is set.- Return type:
Finishes an operation started with
Mbim.Device.new
().New in version 1.0.
- add_link(session_id, base_ifname, ifname_prefix, cancellable, callback, *user_data)¶
- Parameters:
session_id (
int
) – the session id for the link, in the [Mbim.DEVICE_SESSION_ID_MIN
,:obj:Mbim.DEVICE_SESSION_ID_MAX] range, or #MBIM_DEVICE_SESSION_ID_AUTOMATIC to find the first available session id.base_ifname (
str
) – the interface which the new link will be created on.ifname_prefix (
str
) – the prefix suggested to be used for the name of the new link created.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the operation is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously creates a new virtual network device node on top of base_ifname. This allows having multiple net interfaces running on top of another using multiplexing.
If the kernel driver doesn’t allow this functionality, a
Mbim.CoreError.UNSUPPORTED
error will be returned.The operation may fail if the given interface name is not associated to the MBIM control port managed by the
Mbim.Device
.Depending on the kernel driver in use, the given ifname_prefix may be ignored. The user should not assume that the returned link interface name is prefixed with ifname_prefix as it may not be the case.
When the operation is finished callback will be called. You can then call
Mbim.Device.add_link_finish
() to get the result of the operation.New in version 1.26.
- add_link_finish(res, session_id)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.session_id (
int
) – the session ID for the link created.
- Raises:
- Returns:
The name of the net interface created,
None
if error is set.- Return type:
Finishes an operation started with
Mbim.Device.add_link
().New in version 1.26.
- check_link_supported()¶
-
Checks whether link management is supported by the kernel.
New in version 1.26.
- check_ms_mbimex_version(ms_mbimex_version_major, ms_mbimex_version_minor)¶
- Parameters:
- Returns:
True
if the version of the device instance is the same as or newer than the passed-in version.- Return type:
Checks the version number of the MS MBIMEx support in the device instance against the one given as input.
New in version 1.28.
- close(timeout, cancellable, callback, *user_data)¶
- Parameters:
timeout (
int
) – maximum time, in seconds, to wait for the device to be closed.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the operation is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously closes a
Mbim.Device
for I/O.When the operation is finished callback will be called. You can then call
Mbim.Device.close_finish
() to get the result of the operation.New in version 1.0.
- close_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
- Return type:
Finishes an asynchronous close operation started with
Mbim.Device.close
().New in version 1.0.
- close_force()¶
-
Forces the
Mbim.Device
to be closed.New in version 1.0.
- command(message, timeout, cancellable, callback, *user_data)¶
- Parameters:
message (
Mbim.Message
) – the message to send.timeout (
int
) – maximum time, in seconds, to wait for the response.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the operation is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously sends a
Mbim.Message
to the device.When the operation is finished callback will be called. You can then call
Mbim.Device.command_finish
() to get the result of the operation.New in version 1.0.
- command_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
a
Mbim.Message
response, orNone
if error is set. The returned value should be freed withMbim.Message.unref
().- Return type:
Finishes an operation started with
Mbim.Device.command
().The returned
Mbim.Message
is ensured to be valid and complete (i.e. not a partial fragment). There is no need to callMbim.Message.validate
() again.New in version 1.0.
- delete_all_links(base_ifname, cancellable, callback, *user_data)¶
- Parameters:
base_ifname (
str
) – the interface where all links are available.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the operation is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously deletes all virtual network interfaces that have been previously created with
Mbim.Device.add_link
() in base_ifname.When the operation is finished callback will be called. You can then call
Mbim.Device.delete_link_finish
() to get the result of the operation.There is no guarantee that other processes haven’t created new links by the time this method returns. This method should be used with caution, or in setups where only one single process is expected to do MBIM network interface link management.
New in version 1.26.
- delete_all_links_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
- Return type:
Finishes an operation started with
Mbim.Device.delete_all_links
().New in version 1.26.
- delete_link(ifname, cancellable, callback, *user_data)¶
- Parameters:
ifname (
str
) – the name of the link to remove.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the operation is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously deletes a virtual network interface that has been previously created with
Mbim.Device.add_link
().If the kernel driver doesn’t allow this functionality, a
Mbim.CoreError.UNSUPPORTED
error will be returned.When the operation is finished callback will be called. You can then call
Mbim.Device.delete_link_finish
() to get the result of the operation.New in version 1.26.
- delete_link_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
- Return type:
Finishes an operation started with
Mbim.Device.delete_link
().New in version 1.26.
- get_consecutive_timeouts()¶
-
Gets the number of consecutive transaction timeouts in the device.
New in version 1.28.
- get_ms_mbimex_version(out_ms_mbimex_version_minor)¶
- Parameters:
out_ms_mbimex_version_minor (
int
) – output location for the minor version number of the MS MBIMEx support, orNone
if not needed.- Returns:
the major version number of the MS MBIMEx support.
- Return type:
Get the version number of the MS MBIMEx support.
The reported version will be 1 if the initialization sequence to agree on which version to use hasn’t been run (e.g. with
Mbim.Device.open_full
() and the explicitMbim.DeviceOpenFlags.MS_MBIMEX_V2
orMbim.DeviceOpenFlags.MS_MBIMEX_V3
flag).New in version 1.28.
- get_next_transaction_id()¶
- Returns:
the next transaction ID.
- Return type:
Acquire the next transaction ID of this
Mbim.Device
. The internal transaction ID gets incremented.New in version 1.0.
- get_path()¶
- Returns:
the system path of the device.
- Return type:
Get the system path of the underlying MBIM device.
New in version 1.0.
- get_path_display()¶
- Returns:
UTF-8 encoded system path of the device.
- Return type:
Get the system path of the underlying MBIM device in UTF-8.
New in version 1.0.
- get_transaction_id()¶
- Returns:
the current transaction ID.
- Return type:
Acquire the transaction ID of this
Mbim.Device
without incrementing the internal transaction ID.New in version 1.24.4.
- is_open()¶
-
Checks whether the
Mbim.Device
is open for I/O.New in version 1.0.
- list_links(base_ifname)¶
- Parameters:
base_ifname (
str
) – the base interface.- Raises:
- Returns:
True
if successful,False
if error is set.- out_links:
a placeholder for the output
GLib.PtrArray
of link names.
- Return type:
Synchronously lists all virtual network interfaces that have been previously created with
Mbim.Device.add_link
() in base_ifname.New in version 1.26.
- open(timeout, cancellable, callback, *user_data)¶
- Parameters:
timeout (
int
) – maximum time, in seconds, to wait for the device to be opened.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the operation is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously opens a
Mbim.Device
for I/O.When the operation is finished callback will be called. You can then call
Mbim.Device.open_finish
() to get the result of the operation.New in version 1.0.
- open_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
- Return type:
Finishes an asynchronous open operation started with
Mbim.Device.open
().New in version 1.0.
- open_full(flags, timeout, cancellable, callback, *user_data)¶
- Parameters:
flags (
Mbim.DeviceOpenFlags
) – a set ofMbim.DeviceOpenFlags
.timeout (
int
) – maximum time, in seconds, to wait for the device to be opened.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the operation is finished.user_data (
object
orNone
) – the data to pass to callback function.
Asynchronously opens a
Mbim.Device
for I/O.This method is an extension of the generic
Mbim.Device.open
(), which allows launching theMbim.Device
with proxy support.When the operation is finished callback will be called. You can then call
Mbim.Device.open_full_finish
() to get the result of the operation.New in version 1.10.
- open_full_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
- Return type:
Finishes an asynchronous open operation started with
Mbim.Device.open_full
().New in version 1.10.
- set_ms_mbimex_version(ms_mbimex_version_major, ms_mbimex_version_minor)¶
- Parameters:
- Raises:
- Returns:
- Return type:
Set the version number of the MS MBIMEx support assumed in the device instance, which may have been set already by a different process or device instance.
If this operation specifies the wrong MBIMEx version agreed between host and device, the message processing on this device instance may fail.
This operation does not do any MBIMEx version exchange with the device, the only way to do that is with
Mbim.Device.open_full
() and the explicitMbim.DeviceOpenFlags.MS_MBIMEX_V2
orMbim.DeviceOpenFlags.MS_MBIMEX_V3
flag.New in version 1.28.
Signal Details¶
- Mbim.Device.signals.device_error(device, object)¶
- Signal Name:
device-error
- Flags:
- Parameters:
device (
Mbim.Device
) – The object which received the signalobject (
GLib.Error
) –
- Mbim.Device.signals.device_indicate_status(device, object)¶
- Signal Name:
device-indicate-status
- Flags:
- Parameters:
device (
Mbim.Device
) – The object which received the signalobject (
Mbim.Message
) –
- Mbim.Device.signals.device_removed(device)¶
- Signal Name:
device-removed
- Flags:
- Parameters:
device (
Mbim.Device
) – The object which received the signal
Property Details¶
- Mbim.Device.props.device_consecutive_timeouts¶
-
Number of consecutive timeouts detected in requests sent to the device
- Mbim.Device.props.device_file¶
- Name:
device-file
- Type:
- Default Value:
- Flags:
File to the underlying MBIM device
- Mbim.Device.props.device_in_session¶
-
Flag to specify if the device is within a session