---
name: "giiQueryValInfo"
section: "3gii"
platform: "linux"
package: "libgii0-dev"
version: "1:0.8.1-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/giiQueryValInfo/3gii"
---

# giiQueryValInfo(3gii)

Get data about valuators

## NAME

giiQueryValInfo - Get data about valuators

## SYNOPSIS

**#include \<ggi/gii.h\>**

**int giiQueryValInfo(gii\_input\_t\****inp***, uint32** *origin***,** **uint32** *valnumber***,** **gii\_cmddata\_getdevinfo \****info***);** .SH "DESCRIPTION"

Though when using GII inputs the exact type of device is fully  transparent to the program, information about the device that is actually attached to a given gii input and origin id can be queried, e.g. for configuration interfaces.

For **giiQueryValInfo** is used on devices, where **giiQueryDeviceInfo**  has indicated that the device has one or more valuator axes and you want to gather additional info about the physical equivalent of each axis.The parameters *inp* and *origin* select the input to query and *valnumber* selects the specific valuator (an input can have multiple valuators).

The queried data is put into *info*, which has the following fields:

- *number*

  Number of the queried valuator.

- *longname*

  Name of the device (string, 74+\\0 chars max)

- *shortname*

  Abbreviated devicename (string, 4+\\0 chars max)

- *gii\_valrange range*

  struct with **sint32** **min**,**center**, **max**; Contains the minimum, center and maximum values for this valuator. Note, that this range may change on some devices due to calibration, but it is usually not  expected that a device recalibrates while in use. You should react gracefully to values received from the valuator that are outside the specified range, though.

- *gii\_phystype phystype*

  gives the physical quantity the device measures. The idea is to report the thing the user actually controls. I.e. a Joystick actually measures resistance, but should report GII\_PT\_ANGLE or  GII\_PT\_FORCE, as that is what the user does to the stick and what results in the changed resistance.

- **sint32** *SI\_add***,***SI\_mul***,***SI\_div***,***SI\_shift*

  Using these values, it is possible to give calibration data to the application. In gii.h there is a base unit (according to SI) specified for each phystype. The SI value can be computed using these values and the following formula (unless SI\_mul is 0, which means the device is non-linear or the factor is unknown). SI = (float) (SI\_add + value\[n\]) \* (float) SI\_mul / (float) SI\_div \* pow(2.0, SI\_shift);

## RETURN VALUE

Returns 0 on success (info is valid, then) or -1 otherwise.

## SEE ALSO

giiQueryDeviceInfo
