## 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_is_valid ()
gboolean | qmi_client_get_version ()
gboolean | qmi_client_check_version ()
guint16 | qmi_client_get_next_transaction_id ()

## Properties

guint | client-cid | Read / Write
QmiDevice * | client-device | Read / Write
QmiService | client-service | Read / Write
gboolean | client-valid | Read
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
#define | QMI_CLIENT_VALID
struct | QmiClient

## Object Hierarchy

        GObject
        ╰── QmiClient
            ├── QmiClientDms
            ├── QmiClientLoc
            ├── QmiClientNas
            ├── QmiClientOma
            ├── QmiClientPbm
            ├── QmiClientPdc
            ├── 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()`.

Since: 1.0

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

Since: 1.0

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

Since: 1.0

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

Since: 1.0

### qmi_client_is_valid ()

    gboolean
    qmi_client_is_valid (QmiClient *self);

Checks whether QmiClient is a valid and usable client.

The client is marked as invalid as soon as the client id is released or when the associated QmiDevice is closed.

This method may be used if the caller needs to ensure validity before a command is attempted, e.g. if the lifecycle of the object is managed in some other place and the caller just has a reference to the QmiClient.

#### Parameters

self | a QmiClient. |

#### Returns

`TRUE` if the client is valid, `FALSE` otherwise.

Since: 1.20

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

Since: 1.0

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

Since: 1.0

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

Since: 1.0

## Types and Values

### QMI_CID_NONE

    #define QMI_CID_NONE 0x00

A symbol specifying a special CID value that references no CID.

Since: 1.0

### QMI_CID_BROADCAST

    #define QMI_CID_BROADCAST 0xFF

A symbol specifying the broadcast CID.

Since: 1.0

### QMI_CLIENT_DEVICE

    #define QMI_CLIENT_DEVICE "client-device"

Symbol defining the “client-device” property.

Since: 1.0

### QMI_CLIENT_SERVICE

    #define QMI_CLIENT_SERVICE "client-service"

Symbol defining the “client-service” property.

Since: 1.0

### QMI_CLIENT_CID

    #define QMI_CLIENT_CID "client-cid"

Symbol defining the “client-cid” property.

Since: 1.0

### QMI_CLIENT_VERSION_MAJOR

    #define QMI_CLIENT_VERSION_MAJOR "client-version-major"

Symbol defining the “client-version-major” property.

Since: 1.0

### QMI_CLIENT_VERSION_MINOR

    #define QMI_CLIENT_VERSION_MINOR "client-version-minor"

Symbol defining the “client-version-minor” property.

Since: 1.0

### QMI_CLIENT_VALID

    #define QMI_CLIENT_VALID "client-valid"

Symbol defining the “valid” property.

Since: 1.20

### struct QmiClient

    struct QmiClient;

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

Since: 1.0

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

Since: 1.0

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

      “client-device”            QmiDevice *

The QMI device.

Flags: Read / Write

Since: 1.0

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

      “client-service”           QmiService

QMI service this client is using.

Flags: Read / Write

Default value: QMI_SERVICE_UNKNOWN

Since: 1.0

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

      “client-valid”             gboolean

Whether the client is valid and usable.

Flags: Read

Default value: FALSE

Since: 1.20

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

      “client-version-major”     guint

Major version of the service handled by this client.

Flags: Read / Write

Default value: 0

Since: 1.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

Since: 1.0