## QmiClient QmiClient — Generic QMI client handling routines |

## Synopsis

    #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;
    GObject *           qmi_client_get_device               (QmiClient *self);
    GObject *           qmi_client_peek_device              (QmiClient *self);
    QmiService          qmi_client_get_service              (QmiClient *self);
    guint8              qmi_client_get_cid                  (QmiClient *self);
    gboolean            qmi_client_get_version              (QmiClient *self,
                                                             guint *major,
                                                             guint *minor);
    gboolean            qmi_client_check_version            (QmiClient *self,
                                                             guint major,
                                                             guint minor);
    guint16             qmi_client_get_next_transaction_id  (QmiClient *self);
    void                qmi_client_process_indication       (QmiClient *self,
                                                             QmiMessage *message);

## Object Hierarchy

      GObject
       +----QmiClient
             +----QmiClientDms
             +----QmiClientNas
             +----QmiClientPds
             +----QmiClientWds
             +----QmiClientWms

## Properties

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

## 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.

## Details

### 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.

### qmi_client_get_device ()

    GObject *           qmi_client_get_device               (QmiClient *self);

Get the QmiDevice associated with this QmiClient.

`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.

`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.

`self` : | A QmiClient
Returns : | a QmiService.

### qmi_client_get_cid ()

    guint8              qmi_client_get_cid                  (QmiClient *self);

Get the client ID of this QmiClient.

`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.

`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.

`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.

`self` : | A QmiClient
Returns : | the next transaction ID.

### qmi_client_process_indication ()

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

## Property Details

### The `"client-cid"` property

      "client-cid"               guint                 : Read / Write

ID of the client registered into the QMI device.

Allowed values: <= 255

Default value: 0

### The `"client-device"` property

      "client-device"            QmiDevice*            : Read / Write

The QMI device.

### The `"client-service"` property

      "client-service"           QmiService            : Read / Write

QMI service this client is using.

Default value: QMI_SERVICE_UNKNOWN

### The `"client-version-major"` property

      "client-version-major"     guint                 : Read / Write

Major version of the service handled by this client.

Default value: 0

### The `"client-version-minor"` property

      "client-version-minor"     guint                 : Read / Write

Minor version of the service handled by this client.

Default value: 0