libqmi-glib Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#define QMI_DEVICE_FILE #define QMI_DEVICE_SIGNAL_INDICATION struct QmiDevice; void qmi_device_new (GFile *file
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); QmiDevice * qmi_device_new_finish (GAsyncResult *res
,GError **error
); GFile * qmi_device_get_file (QmiDevice *self
); GFile * qmi_device_peek_file (QmiDevice *self
); const gchar * qmi_device_get_path (QmiDevice *self
); const gchar * qmi_device_get_path_display (QmiDevice *self
); gboolean qmi_device_is_open (QmiDevice *self
); enum QmiDeviceOpenFlags; void qmi_device_open (QmiDevice *self
,QmiDeviceOpenFlags flags
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean qmi_device_open_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
); gboolean qmi_device_close (QmiDevice *self
,GError **error
); void qmi_device_allocate_client (QmiDevice *self
,QmiService service
,guint8 cid
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); QmiClient * qmi_device_allocate_client_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
); enum QmiDeviceReleaseClientFlags; void qmi_device_release_client (QmiDevice *self
,QmiClient *client
,QmiDeviceReleaseClientFlags flags
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean qmi_device_release_client_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
); void qmi_device_set_instance_id (QmiDevice *self
,guint8 instance_id
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean qmi_device_set_instance_id_finish (QmiDevice *self
,GAsyncResult *res
,guint16 *link_id
,GError **error
); void qmi_device_command (QmiDevice *self
,QmiMessage *message
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); QmiMessage * qmi_device_command_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
); QmiDeviceServiceVersionInfo; void qmi_device_get_service_version_info (QmiDevice *self
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GArray * qmi_device_get_service_version_info_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
);
QmiDevice is a generic type in charge of controlling the access of multiple QmiClient objects to the managed QMI port.
A QmiDevice can only handle one single QMI port.
struct QmiDevice;
The QmiDevice structure contains private data and should only be accessed using the provided API.
void qmi_device_new (GFile *file
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously creates a QmiDevice object to manage file
.
When the operation is finished, callback
will be invoked. You can then call
qmi_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. |
QmiDevice * qmi_device_new_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with qmi_device_new()
.
|
a GAsyncResult. |
|
Return location for error or NULL . |
Returns : |
A newly created QmiDevice, or NULL if error is set. |
GFile * qmi_device_get_file (QmiDevice *self
);
Get the GFile associated with this QmiDevice.
|
a QmiDevice. |
Returns : |
a GFile that must be freed with g_object_unref() . |
GFile * qmi_device_peek_file (QmiDevice *self
);
Get the GFile associated with this QmiDevice, without increasing the reference count on the returned object.
const gchar * qmi_device_get_path (QmiDevice *self
);
Get the system path of the underlying QMI device.
|
a QmiDevice. |
Returns : |
the system path of the device. |
const gchar * qmi_device_get_path_display (QmiDevice *self
);
Get the system path of the underlying QMI device in UTF-8.
|
a QmiDevice. |
Returns : |
UTF-8 encoded system path of the device. |
gboolean qmi_device_is_open (QmiDevice *self
);
Checks whether the QmiDevice is open for I/O.
typedef enum { QMI_DEVICE_OPEN_FLAGS_NONE = 0, QMI_DEVICE_OPEN_FLAGS_VERSION_INFO = 1 << 0, QMI_DEVICE_OPEN_FLAGS_SYNC = 1 << 1, QMI_DEVICE_OPEN_FLAGS_NET_802_3 = 1 << 2, QMI_DEVICE_OPEN_FLAGS_NET_RAW_IP = 1 << 3, QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER = 1 << 4, QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER = 1 << 5, QMI_DEVICE_OPEN_FLAGS_PROXY = 1 << 6 } QmiDeviceOpenFlags;
Flags to specify which actions to be performed when the device is open.
No flags. | |
Run version info check when opening. | |
Synchronize with endpoint once the device is open. Will release any previously allocated client ID. | |
set network port to "802.3" mode; mutually exclusive with QMI_DEVICE_OPEN_FLAGS_NET_RAW_IP
|
|
set network port to "raw IP" mode; mutally exclusive with QMI_DEVICE_OPEN_FLAGS_NET_802_3
|
|
set network port to transmit/receive QoS headers; mutually exclusive with QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER
|
|
set network port to not transmit/receive QoS headers; mutually exclusive with QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER
|
|
Try to open the port through the 'qmi-proxy'. |
void qmi_device_open (QmiDevice *self
,QmiDeviceOpenFlags flags
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously opens a QmiDevice for I/O.
When the operation is finished callback
will be called. You can then call
qmi_device_open_finish()
to get the result of the operation.
|
a QmiDevice. |
|
mask of QmiDeviceOpenFlags specifying how the device should be opened. |
|
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 qmi_device_open_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an asynchronous open operation started with qmi_device_open()
.
|
a QmiDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL . |
Returns : |
TRUE if successful, FALSE if error is set. |
gboolean qmi_device_close (QmiDevice *self
,GError **error
);
Synchronously closes a QmiDevice, preventing any further I/O.
Closing a QmiDevice multiple times will not return an error.
void qmi_device_allocate_client (QmiDevice *self
,QmiService service
,guint8 cid
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously allocates a new QmiClient in self
.
If QMI_CID_NONE is given in cid
, a new client ID will be allocated;
otherwise a client with the given cid
will be generated.
When the operation is finished callback
will be called. You can then call
qmi_device_allocate_client_finish()
to get the result of the operation.
Note: Clients for the QMI_SERVICE_CTL cannot be created with this method;
instead get/peek the implicit one from self
.
|
a QmiDevice. |
|
a valid QmiService. |
|
a valid client ID, or QMI_CID_NONE. |
|
maximum time to wait. |
|
optional GCancellable object, NULL to ignore. |
|
a GAsyncReadyCallback to call when the operation is finished. |
|
the data to pass to callback function. |
QmiClient * qmi_device_allocate_client_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an operation started with qmi_device_allocate_client()
.
|
a QmiDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL . |
Returns : |
a newly allocated QmiClient, or NULL if error is set. |
typedef enum { QMI_DEVICE_RELEASE_CLIENT_FLAGS_NONE = 0, QMI_DEVICE_RELEASE_CLIENT_FLAGS_RELEASE_CID = 1 << 0 } QmiDeviceReleaseClientFlags;
Flags to specify which actions to be performed when releasing the client.
void qmi_device_release_client (QmiDevice *self
,QmiClient *client
,QmiDeviceReleaseClientFlags flags
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously releases the QmiClient from the QmiDevice.
Once the QmiClient has been released, it cannot be used any more to perform operations.
When the operation is finished callback
will be called. You can then call
qmi_device_release_client_finish()
to get the result of the operation.
|
a QmiDevice. |
|
the QmiClient to release. |
|
mask of QmiDeviceReleaseClientFlags specifying how the client should be released. |
|
maximum time to wait. |
|
optional GCancellable object, NULL to ignore. |
|
a GAsyncReadyCallback to call when the operation is finished. |
|
the data to pass to callback function. |
gboolean qmi_device_release_client_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an operation started with qmi_device_release_client()
.
Note that even if the release operation returns an error, the client should anyway be considered released, and shouldn't be used afterwards.
|
a QmiDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL . |
Returns : |
TRUE if successful, or NULL if error is set. |
void qmi_device_set_instance_id (QmiDevice *self
,guint8 instance_id
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Sets the instance ID of the QmiDevice.
When the operation is finished callback
will be called. You can then call
qmi_device_set_instance_id_finish()
to get the result of the operation.
|
a QmiDevice. |
|
the instance ID. |
|
maximum time to wait. |
|
optional GCancellable object, NULL to ignore. |
|
a GAsyncReadyCallback to call when the operation is finished. |
|
the data to pass to callback function. |
gboolean qmi_device_set_instance_id_finish (QmiDevice *self
,GAsyncResult *res
,guint16 *link_id
,GError **error
);
Finishes an operation started with qmi_device_set_instance_id()
.
void qmi_device_command (QmiDevice *self
,QmiMessage *message
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously sends a QmiMessage to the device.
When the operation is finished callback
will be called. You can then call
qmi_device_command_finish()
to get the result of the operation.
|
a QmiDevice. |
|
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. |
QmiMessage * qmi_device_command_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an operation started with qmi_device_command()
.
|
a QmiDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL . |
Returns : |
a QmiMessage response, or NULL if error is set. The returned value should be freed with qmi_message_unref() . |
typedef struct { QmiService service; guint16 major_version; guint16 minor_version; } QmiDeviceServiceVersionInfo;
Version information for a service.
QmiService |
a QmiService. |
guint16 |
major version of the service. |
guint16 |
minor version of the service. |
void qmi_device_get_service_version_info (QmiDevice *self
,guint timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously requests the service version information of the device.
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 qmi_device_get_service_version_info_finish()
to get the result of the operation.
|
a QmiDevice. |
|
maximum time to wait for the method to complete, in seconds. |
|
a GCancellable or NULL . |
|
a GAsyncReadyCallback to call when the request is satisfied. |
|
user data to pass to callback . |
GArray * qmi_device_get_service_version_info_finish (QmiDevice *self
,GAsyncResult *res
,GError **error
);
Finishes an operation started with qmi_device_get_service_version_info()
.
|
a QmiDevice. |
|
a GAsyncResult. |
|
Return location for error or NULL . |
Returns : |
a GArray of QmiDeviceServiceVersionInfo elements, or NULL if error is set. The returned value should be freed with g_array_unref() . |
"device-file"
property"device-file" GFile* : Read / Write / Construct Only
File to the underlying QMI device.
"indication"
signalvoid user_function (QmiDevice *qmidevice,
GByteArray *arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |