QmiClient: libqmi-glib Reference Manual

## QmiClient QmiClient — Generic QMI client handling routines |

## Functions

GObject * | qmi_client_get_device ()
GObject * | qmi_client_peek_device ()
QmiService | qmi_client_get_service ()
guint8 | qmi_client_get_cid ()
gboolean | qmi_client_get_version ()
gboolean | qmi_client_check_version ()
guint16 | qmi_client_get_next_transaction_id ()
void | qmi_client_process_indication ()

## Properties

guint | client-cid | Read / Write
QmiDevice * | client-device | Read / Write
QmiService | client-service | Read / Write
guint | client-version-major | Read / Write
guint | client-version-minor | Read / Write

## Types and Values

#define | QMI_CID_NONE
#define | QMI_CID_BROADCAST
#define | QMI_CLIENT_DEVICE
#define | QMI_CLIENT_SERVICE
#define | QMI_CLIENT_CID
#define | QMI_CLIENT_VERSION_MAJOR
#define | QMI_CLIENT_VERSION_MINOR
struct | QmiClient

## Object Hierarchy

        GObject
        ╰── QmiClient
            ├── QmiClientDms
            ├── QmiClientNas
            ├── QmiClientOma
            ├── QmiClientPbm
            ├── QmiClientPds
            ├── QmiClientUim
            ├── QmiClientVoice
            ├── QmiClientWda
            ├── QmiClientWds
            ╰── QmiClientWms

## Description

QmiClient is a generic type representing a QMI client for any kind of QmiService.

These objects are created by a QmiDevice with `qmi_device_allocate_client()`, and before completely disposing them `qmi_device_release_client()` needs to be called in order to release the unique client ID reserved.

## Functions

### qmi_client_get_device ()

    GObject *
    qmi_client_get_device (QmiClient *self);

Get the QmiDevice associated with this QmiClient.

#### Parameters

self | a QmiClient |

#### Returns

a GObject that must be freed with `g_object_unref()`.

### qmi_client_peek_device ()

    GObject *
    qmi_client_peek_device (QmiClient *self);

Get the QmiDevice associated with this QmiClient, without increasing the reference count on the returned object.

#### Parameters

self | a QmiClient. |

#### Returns

a GObject. Do not free the returned object, it is owned by `self` .

### qmi_client_get_service ()

    QmiService
    qmi_client_get_service (QmiClient *self);

Get the service being used by this QmiClient.

#### Parameters

self | A QmiClient |

#### Returns

a QmiService.

### qmi_client_get_cid ()

    guint8
    qmi_client_get_cid (QmiClient *self);

Get the client ID of this QmiClient.

#### Parameters

self | A QmiClient |

#### Returns

the client ID.

### qmi_client_get_version ()

    gboolean
    qmi_client_get_version (QmiClient *self,
                            guint *major,
                            guint *minor);

Get the version of the service handled by this QmiClient.

#### Parameters

self | A QmiClient |
major | placeholder for the output major version. |
minor | placeholder for the output minor version. |

#### Returns

`TRUE` if the version was properly reported, `FALSE` otherwise.

### qmi_client_check_version ()

    gboolean
    qmi_client_check_version (QmiClient *self,
                              guint major,
                              guint minor);

Checks if the version of the service handled by this QmiClient is greater or equal than the given version.

#### Parameters

self | A QmiClient |
major | a major version. |
minor | a minor version. |

#### Returns

`TRUE` if the version of the service is greater or equal than the one given, `FALSE` otherwise.

### qmi_client_get_next_transaction_id ()

    guint16
    qmi_client_get_next_transaction_id (QmiClient *self);

Acquire the next transaction ID of this QmiClient. The internal transaction ID gets incremented.

#### Parameters

self | A QmiClient |

#### Returns

the next transaction ID.

### qmi_client_process_indication ()

    void
    qmi_client_process_indication (QmiClient *self,
                                   QmiMessage *message);

## Types and Values

### QMI_CID_NONE

    #define QMI_CID_NONE      0x00

### QMI_CID_BROADCAST

    #define QMI_CID_BROADCAST 0xFF

### QMI_CLIENT_DEVICE

    #define QMI_CLIENT_DEVICE        "client-device"

### QMI_CLIENT_SERVICE

    #define QMI_CLIENT_SERVICE       "client-service"

### QMI_CLIENT_CID

    #define QMI_CLIENT_CID           "client-cid"

### QMI_CLIENT_VERSION_MAJOR

    #define QMI_CLIENT_VERSION_MAJOR "client-version-major"

### QMI_CLIENT_VERSION_MINOR

    #define QMI_CLIENT_VERSION_MINOR "client-version-minor"

### struct QmiClient

    struct QmiClient;

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

## Property Details

### The `“client-cid”` property

      “client-cid”               guint

ID of the client registered into the QMI device.

Flags: Read / Write

Allowed values: <= 255

Default value: 0

### The `“client-device”` property

      “client-device”            QmiDevice *

The QMI device.

Flags: Read / Write

### The `“client-service”` property

      “client-service”           QmiService

QMI service this client is using.

Flags: Read / Write

Default value: QMI_SERVICE_UNKNOWN

### The `“client-version-major”` property

      “client-version-major”     guint

Major version of the service handled by this client.

Flags: Read / Write

Default value: 0

### The `“client-version-minor”` property

      “client-version-minor”     guint

Minor version of the service handled by this client.

Flags: Read / Write

Default value: 0