### Function

# Qmi message_tlv_read_guint16

since: 1.12

#### Declaration [src]

    gboolean
    qmi_message_tlv_read_guint16 (
      QmiMessage* self,
      gsize tlv_offset,
      gsize* offset,
      QmiEndian endian,
      guint16* out,
      GError** error
    )

#### Description [src]

Reads an unsigned 16-bit integer from the TLV, in host byte order.

`offset` needs to point to a valid `gsize` specifying the index to start reading from within the TLV value (0 for the first item). If the variable is successfully read, `offset` will be updated to point past the read item.

Available since: 1.12

#### Parameters

`self`

  Type: `QmiMessage`

  A `QmiMessage`.

  The data is owned by the caller of the function.

`tlv_offset`

  Type: `gsize`

  Offset that was returned by qmi_message_tlv_read_init().

`offset`

  Type: `gsize*`

  Address of a the offset within the TLV value.

  The argument will be modified by the function.

`endian`

  Type: `QmiEndian`

  Source endianness, which will be swapped to host byte order if necessary.

`out`

  Type: `guint16*`

  Return location for the read #guint16.

  The argument will be set by the function.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the function if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gboolean`

`TRUE` if the variable is successfully read, otherwise `FALSE` is returned and `error` is set.