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 sint32min,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.