HidP_GetScaledUsageValue

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This function returns the signed and scaled result of a HID control value extracted from a HID report.

Syntax

NTSTATUS HidP_GetScaledUsageValue(
  HIDP_REPORT_TYPE ReportType,
  USAGE UsagePage,
  USHORT LinkCollection,
  USAGE Usage,
  PLONG UsageValue,
  PHIDP_PREPARSED_DATA PreparsedData,
  PCHAR Report,
  ULONG ReportLength
);

Parameters

  • ReportType
    [in] HIDP_REPORT_TYPE enumerator value that identifies the type of HID report that contains the HID usage value.
  • UsagePage
    [in] Usage page of the value to extract.
  • LinkCollection
    [in] Optional. Link collection identifier of the value to extract. A LinkCollection value of zero identifies the top-level collection.
  • Usage
    [in] Usage of the value to extract.
  • UsageValue
    [out] Pointer to the buffer in which the function returns the signed and scaled value.
  • PreparsedData
    [in] Pointer to the preparsed data of the top-level collection that generated the report located at Report.
  • Report
    [in] Pointer to the report that contains the usage.
  • ReportLength
    [in] Length, in bytes, of the report located at Report.

Return Value

The following table shows the possible return values.

Value Description

HIDP_STATUS_SUCCESS

Function successfully returned the value.

HIDP_STATUS_INVALID_REPORT_TYPE

Specified report type is not valid.

HIDP_STATUS_INVALID_REPORT_LENGTH

Specified report length is not valid.

HIDP_STATUS_BAD_LOG_PHY_VALUES

Collection returned an illegal logical or physical value. To extract the value returned by the collection, call HidP_GetUsageValue.

HIDP_STATUS_NULL

Current state of the scaled value from the collection is less than the logical minimum or is greater than the logical maximum, and the scaled value has a NULL state.

HIDP_STATUS_VALUE_OUT_OF_RANGE

Current state of the scaled value data from the collection is less than the logical minimum or is greater than the logical maximum.

HIDP_STATUS_USAGE_NOT_FOUND

Specified usage, usage page, or link collection cannot be found in any report supported by the specified top-level collection.

HIDP_STATUS_INCOMPATIBLE_REPORT_ID

Specified value is not contained in the specified report, but is contained in another report supported by the specified top-level collection.

Remarks

The terms button and usage are used synonymously.

The caller-allocated buffers supplied at PreparsedData, UsageValue, and Report must be allocated from the nonpaged pool.

HID clients must use HidP_GetUsageValueArray to extract data for a usage value array.

If the function returns status HIDP_STATUS_BAD_LOG_PHY_VALUES, an application or driver can call HidP_GetUsageValue to extract the raw usage data.

Requirements

Header hidpi.h
Library Hidparse_lib.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

HidP_GetUsageValue
HidP_GetUsageValueArray
HIDP_REPORT_TYPE