| libmbim-glib Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ||||
struct MbimDevice; void mbim_device_new (GFile *file,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); MbimDevice * mbim_device_new_finish (GAsyncResult *res,GError **error); GFile * mbim_device_get_file (MbimDevice *self); GFile * mbim_device_peek_file (MbimDevice *self); const gchar * mbim_device_get_path (MbimDevice *self); const gchar * mbim_device_get_path_display (MbimDevice *self); gboolean mbim_device_is_open (MbimDevice *self); void mbim_device_open (MbimDevice *self,guint timeout,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean mbim_device_open_finish (MbimDevice *self,GAsyncResult *res,GError **error); void mbim_device_close (MbimDevice *self,guint timeout,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean mbim_device_close_finish (MbimDevice *self,GAsyncResult *res,GError **error); gboolean mbim_device_close_force (MbimDevice *self,GError **error); guint32 mbim_device_get_next_transaction_id (MbimDevice *self); void mbim_device_command (MbimDevice *self,MbimMessage *message,guint timeout,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); MbimMessage * mbim_device_command_finish (MbimDevice *self,GAsyncResult *res,GError **error);
"device-file" GFile* : Read / Write / Construct Only "device-in-session" gboolean : Read / Write "device-transaction-id" guint : Read / Write
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.
struct MbimDevice;
The MbimDevice structure contains private data and should only be accessed using the provided API.
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.
|
a GFile. |
|
optional GCancellable object, NULL to ignore. |
|
a GAsyncReadyCallback to call when the initialization is finished. |
|
the data to pass to callback function. |
MbimDevice * mbim_device_new_finish (GAsyncResult *res,GError **error);
Finishes an operation started with mbim_device_new().
|
a GAsyncResult. |
|
Return location for error or NULL. |
Returns : |
A newly created MbimDevice, or NULL if error is set. |
GFile * mbim_device_get_file (MbimDevice *self);
Get the GFile associated with this MbimDevice.
|
a MbimDevice. |
Returns : |
a GFile that must be freed with g_object_unref(). |
GFile * mbim_device_peek_file (MbimDevice *self);
Get the GFile associated with this MbimDevice, without increasing the reference count on the returned object.
|
a MbimDevice. |
Returns : |
a GFile. Do not free the returned object, it is owned by self. |
const gchar * mbim_device_get_path (MbimDevice *self);
Get the system path of the underlying MBIM device.
|
a MbimDevice. |
Returns : |
the system path of the device. |
const gchar * mbim_device_get_path_display (MbimDevice *self);
Get the system path of the underlying MBIM device in UTF-8.
|
a MbimDevice. |
Returns : |
UTF-8 encoded system path of the device. |
gboolean mbim_device_is_open (MbimDevice *self);
Checks whether the MbimDevice is open for I/O.
|
a MbimDevice. |
Returns : |
TRUE if self is open, FALSE otherwise. |
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.
|
a MbimDevice. |
|
maximum time, in seconds, to wait for the device to be opened. |
|
optional GCancellable object, NULL to ignore. |
|
a GAsyncReadyCallback to call when the operation is finished. |
|
the data to pass to callback function. |
gboolean mbim_device_open_finish (MbimDevice *self,GAsyncResult *res,GError **error);
Finishes an asynchronous open operation started with mbim_device_open().
|
a MbimDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL. |
Returns : |
TRUE if successful, FALSE if error is set. |
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.
|
a MbimDevice. |
|
maximum time, in seconds, to wait for the device to be closed. |
|
optional GCancellable object, NULL to ignore. |
|
a GAsyncReadyCallback to call when the operation is finished. |
|
the data to pass to callback function. |
gboolean mbim_device_close_finish (MbimDevice *self,GAsyncResult *res,GError **error);
Finishes an asynchronous close operation started with mbim_device_close().
|
a MbimDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL. |
Returns : |
TRUE if successful, FALSE if error is set. |
gboolean mbim_device_close_force (MbimDevice *self,GError **error);
Forces the MbimDevice to be closed.
|
a MbimDevice. |
|
Return location for error or NULL. |
Returns : |
TRUE if self if no error happens, otherwise FALSE and error is set. |
guint32 mbim_device_get_next_transaction_id (MbimDevice *self);
Acquire the next transaction ID of this MbimDevice. The internal transaction ID gets incremented.
|
A MbimDevice. |
Returns : |
the next transaction ID. |
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.
|
a MbimDevice. |
|
the message to send. |
|
maximum time, in seconds, to wait for the response. |
|
a GCancellable, or NULL. |
|
a GAsyncReadyCallback to call when the operation is finished. |
|
the data to pass to callback function. |
MbimMessage * mbim_device_command_finish (MbimDevice *self,GAsyncResult *res,GError **error);
Finishes an operation started with mbim_device_command().
|
a MbimDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL. |
Returns : |
a MbimMessage response, or NULL if error is set. The returned value should be freed with mbim_message_unref(). |
"device-file" property"device-file" GFile* : Read / Write / Construct Only
File to the underlying MBIM device.
"device-in-session" property"device-in-session" gboolean : Read / Write
Flag to specify if the device is within a session.
Default value: FALSE
"device-transaction-id" property"device-transaction-id" guint : Read / Write
Current transaction ID.
Allowed values: >= 1
Default value: 1
"device-error" signalvoid user_function (MbimDevice *self,
GError *message,
gpointer user_data) : Run Last
The ::device-error signal is emitted when a MBIM error is received.
|
the MbimDevice |
|
the MbimMessage error |
|
user data set when the signal handler was connected. |
"device-indicate-status" signalvoid user_function (MbimDevice *self,
MbimMessage *message,
gpointer user_data) : Run Last
The ::device-indication-status signal is emitted when a MBIM indication is received.
|
the MbimDevice |
|
the MbimMessage indication |
|
user data set when the signal handler was connected. |