Top |
guint | device-consecutive-timeouts | Read |
GFile * | device-file | Read / Write / Construct Only |
gboolean | device-in-session | Read / Write |
guint | device-transaction-id | Read / Write |
void | device-error | Run Last |
void | device-indicate-status | Run Last |
void | device-removed | Run Last |
#define | MBIM_DEVICE_FILE |
#define | MBIM_DEVICE_IN_SESSION |
#define | MBIM_DEVICE_TRANSACTION_ID |
#define | MBIM_DEVICE_CONSECUTIVE_TIMEOUTS |
#define | MBIM_DEVICE_SIGNAL_REMOVED |
#define | MBIM_DEVICE_SIGNAL_INDICATE_STATUS |
#define | MBIM_DEVICE_SIGNAL_ERROR |
struct | MbimDevice |
enum | MbimDeviceOpenFlags |
#define | MBIM_DEVICE_SESSION_ID_AUTOMATIC |
#define | MBIM_DEVICE_SESSION_ID_MIN |
#define | MBIM_DEVICE_SESSION_ID_MAX |
MbimDevice is a generic type in charge of controlling the access to the managed MBIM port.
A MbimDevice can only handle one single MBIM port.
void mbim_device_new (GFile *file
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously creates a MbimDevice object to manage file
.
When the operation is finished, callback
will be invoked. You can then call
mbim_device_new_finish()
to get the result of the operation.
file |
a GFile. |
|
cancellable |
optional GCancellable object, NULL to ignore. |
|
callback |
a GAsyncReadyCallback to call when the initialization is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.0
MbimDevice * mbim_device_new_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with mbim_device_new()
.
Since: 1.0
GFile *
mbim_device_get_file (MbimDevice *self
);
Get the GFile associated with this MbimDevice.
[skip]
Since: 1.0
GFile *
mbim_device_peek_file (MbimDevice *self
);
Get the GFile associated with this MbimDevice, without increasing the reference count on the returned object.
[skip]
Since: 1.0
const gchar *
mbim_device_get_path (MbimDevice *self
);
Get the system path of the underlying MBIM device.
Since: 1.0
const gchar *
mbim_device_get_path_display (MbimDevice *self
);
Get the system path of the underlying MBIM device in UTF-8.
Since: 1.0
gboolean
mbim_device_is_open (MbimDevice *self
);
Checks whether the MbimDevice is open for I/O.
Since: 1.0
guint8 mbim_device_get_ms_mbimex_version (MbimDevice *self
,guint8 *out_ms_mbimex_version_minor
);
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 explicit MBIM_DEVICE_OPEN_FLAGS_MS_MBIMEX_V2
or
MBIM_DEVICE_OPEN_FLAGS_MS_MBIMEX_V3
flag).
self |
a MbimDevice. |
|
out_ms_mbimex_version_minor |
output location for the minor version number of
the MS MBIMEx support, or |
Since: 1.28
gboolean mbim_device_set_ms_mbimex_version (MbimDevice *self
,guint8 ms_mbimex_version_major
,guint8 ms_mbimex_version_minor
,GError **error
);
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 explicit
MBIM_DEVICE_OPEN_FLAGS_MS_MBIMEX_V2
or MBIM_DEVICE_OPEN_FLAGS_MS_MBIMEX_V3
flag.
self |
a MbimDevice. |
|
ms_mbimex_version_major |
major version number of the MS MBIMEx support. |
|
ms_mbimex_version_minor |
minor version number of the MS MBIMEx support. |
|
error |
Return location for error or |
Since: 1.28
gboolean mbim_device_check_ms_mbimex_version (MbimDevice *self
,guint8 ms_mbimex_version_major
,guint8 ms_mbimex_version_minor
);
Checks the version number of the MS MBIMEx support in the device instance against the one given as input.
self |
a MbimDevice. |
|
ms_mbimex_version_major |
major version number of the MS MBIMEx support. |
|
ms_mbimex_version_minor |
minor version number of the MS MBIMEx support. |
TRUE
if the version of the device instance is the same as or newer
than the passed-in version.
Since: 1.28
guint
mbim_device_get_consecutive_timeouts (MbimDevice *self
);
Gets the number of consecutive transaction timeouts in the device.
Since: 1.28
void mbim_device_open (MbimDevice *self
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously opens a MbimDevice 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.
self |
a MbimDevice. |
|
timeout |
maximum time, in seconds, to wait for the device to be opened. |
|
cancellable |
optional GCancellable object, NULL to ignore. |
|
callback |
a GAsyncReadyCallback to call when the operation is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.0
gboolean mbim_device_open_finish (MbimDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an asynchronous open operation started with mbim_device_open()
.
Since: 1.0
void mbim_device_open_full (MbimDevice *self
,MbimDeviceOpenFlags flags
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously opens a MbimDevice for I/O.
This method is an extension of the generic mbim_device_open()
, which allows
launching the MbimDevice 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.
self |
a MbimDevice. |
|
flags |
a set of MbimDeviceOpenFlags. |
|
timeout |
maximum time, in seconds, to wait for the device to be opened. |
|
cancellable |
optional GCancellable object, NULL to ignore. |
|
callback |
a GAsyncReadyCallback to call when the operation is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.10
gboolean mbim_device_open_full_finish (MbimDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an asynchronous open operation started with mbim_device_open_full()
.
Since: 1.10
void mbim_device_close (MbimDevice *self
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously closes a MbimDevice 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.
self |
a MbimDevice. |
|
timeout |
maximum time, in seconds, to wait for the device to be closed. |
|
cancellable |
optional GCancellable object, NULL to ignore. |
|
callback |
a GAsyncReadyCallback to call when the operation is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.0
gboolean mbim_device_close_finish (MbimDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an asynchronous close operation started with mbim_device_close()
.
Since: 1.0
gboolean mbim_device_close_force (MbimDevice *self
,GError **error
);
Forces the MbimDevice to be closed.
Since: 1.0
guint32
mbim_device_get_transaction_id (MbimDevice *self
);
Acquire the transaction ID of this MbimDevice without incrementing the internal transaction ID.
Since: 1.24.4
guint32
mbim_device_get_next_transaction_id (MbimDevice *self
);
Acquire the next transaction ID of this MbimDevice. The internal transaction ID gets incremented.
Since: 1.0
void mbim_device_command (MbimDevice *self
,MbimMessage *message
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously sends a MbimMessage 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.
self |
a MbimDevice. |
|
message |
the message to send. |
|
timeout |
maximum time, in seconds, to wait for the response. |
|
cancellable |
a GCancellable, or |
|
callback |
a GAsyncReadyCallback to call when the operation is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.0
MbimMessage * mbim_device_command_finish (MbimDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an operation started with mbim_device_command()
.
The returned MbimMessage is ensured to be valid and complete (i.e. not a
partial fragment). There is no need to call mbim_message_validate()
again.
a MbimMessage response, or NULL if error
is set. The returned value should be freed with mbim_message_unref()
.
Since: 1.0
gboolean mbim_device_check_link_supported (MbimDevice *self
,GError **error
);
Checks whether link management is supported by the kernel.
Since: 1.26
gboolean mbim_device_list_links (MbimDevice *self
,const gchar *base_ifname
,GPtrArray **out_links
,GError **error
);
Synchronously lists all virtual network interfaces that have been previously
created with mbim_device_add_link()
in base_ifname
.
self |
a MbimDevice. |
|
base_ifname |
the base interface. |
|
out_links |
a placeholder for the output GPtrArray of link names. |
[out][transfer full][element-type utf8] |
error |
Return location for error or |
Since: 1.26
void mbim_device_add_link (MbimDevice *self
,guint session_id
,const gchar *base_ifname
,const gchar *ifname_prefix
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
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_CORE_ERROR_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 MbimDevice.
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.
self |
a MbimDevice. |
|
session_id |
the session id for the link, in the [MBIM_DEVICE_SESSION_ID_MIN,MBIM_DEVICE_SESSION_ID_MAX] range, or MBIM_DEVICE_SESSION_ID_AUTOMATIC to find the first available session id. |
|
base_ifname |
the interface which the new link will be created on. |
|
ifname_prefix |
the prefix suggested to be used for the name of the new link created. |
|
cancellable |
a GCancellable, or |
|
callback |
a GAsyncReadyCallback to call when the operation is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.26
gchar * mbim_device_add_link_finish (MbimDevice *self
,GAsyncResult *res
,guint *session_id
,GError **error
);
Finishes an operation started with mbim_device_add_link()
.
self |
a MbimDevice. |
|
res |
a GAsyncResult. |
|
session_id |
the session ID for the link created. |
|
error |
Return location for error or |
Since: 1.26
void mbim_device_delete_link (MbimDevice *self
,const gchar *ifname
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
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_CORE_ERROR_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.
self |
a MbimDevice. |
|
ifname |
the name of the link to remove. |
|
cancellable |
a GCancellable, or |
|
callback |
a GAsyncReadyCallback to call when the operation is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.26
gboolean mbim_device_delete_link_finish (MbimDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an operation started with mbim_device_delete_link()
.
Since: 1.26
void mbim_device_delete_all_links (MbimDevice *self
,const gchar *base_ifname
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
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.
self |
a MbimDevice. |
|
base_ifname |
the interface where all links are available. |
|
cancellable |
a GCancellable, or |
|
callback |
a GAsyncReadyCallback to call when the operation is finished. |
|
user_data |
the data to pass to callback function. |
Since: 1.26
gboolean mbim_device_delete_all_links_finish (MbimDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an operation started with mbim_device_delete_all_links()
.
Since: 1.26
#define MBIM_DEVICE_FILE "device-file"
Symbol defining the “device-file” property.
Since: 1.0
#define MBIM_DEVICE_IN_SESSION "device-in-session"
Symbol defining the “device-in-session” property.
Since: 1.4
#define MBIM_DEVICE_TRANSACTION_ID "device-transaction-id"
Symbol defining the “device-transaction-id” property.
Since: 1.2
#define MBIM_DEVICE_CONSECUTIVE_TIMEOUTS "device-consecutive-timeouts"
Symbol defining the “device-consecutive-timeouts” property.
Since: 1.28
#define MBIM_DEVICE_SIGNAL_REMOVED "device-removed"
Symbol defining the “device-removed” signal.
Since: 1.10
#define MBIM_DEVICE_SIGNAL_INDICATE_STATUS "device-indicate-status"
Symbol defining the “device-indicate-status” signal.
Since: 1.0
#define MBIM_DEVICE_SIGNAL_ERROR "device-error"
Symbol defining the “device-error” signal.
Since: 1.0
struct MbimDevice;
The MbimDevice structure contains private data and should only be accessed using the provided API.
Since: 1.0
Flags to specify which actions to be performed when the device is open.
Since: 1.10
#define MBIM_DEVICE_SESSION_ID_AUTOMATIC G_MAXUINT
Symbol defining a session id that will be automatically allocated during runtime when creating net links.
Since: 1.26
#define MBIM_DEVICE_SESSION_ID_MIN 0
Symbol defining the minimum supported session id..
Since: 1.26
#define MBIM_DEVICE_SESSION_ID_MAX 0xFF
Symbol defining the maximum supported session id.
Since: 1.26
“device-consecutive-timeouts”
property“device-consecutive-timeouts” guint
Number of consecutive timeouts detected in requests sent to the device.
Owner: MbimDevice
Flags: Read
Default value: 0
Since: 1.28
“device-file”
property“device-file” GFile *
File to the underlying MBIM device.
Owner: MbimDevice
Flags: Read / Write / Construct Only
Since: 1.0
“device-in-session”
property“device-in-session” gboolean
Flag to specify if the device is within a session.
Owner: MbimDevice
Flags: Read / Write
Default value: FALSE
Since: 1.4
“device-error”
signalvoid user_function (MbimDevice *self, GError *message, gpointer user_data)
The ::device-error signal is emitted when a MBIM error is received.
self |
the MbimDevice |
|
message |
the MbimMessage error |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.0
“device-indicate-status”
signalvoid user_function (MbimDevice *self, MbimMessage *message, gpointer user_data)
The ::device-indication-status signal is emitted when a MBIM indication is received.
self |
the MbimDevice |
|
message |
the MbimMessage indication |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.0
“device-removed”
signalvoid user_function (MbimDevice *self, gpointer user_data)
The ::device-removed signal is emitted when an unexpected port hang-up is received.
self |
the MbimDevice |
|
message |
None |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.10