HidP_SetUsageValue (Windows Embedded CE 6.0)
1/6/2010
This function sets a HID control value in a specified HID report.
Syntax
NTSTATUS HidP_SetUsageValue(
HIDP_REPORT_TYPE ReportType,
USAGE UsagePage,
USHORT LinkCollection,
USAGE Usage,
ULONG UsageValue,
PHIDP_PREPARSED_DATA PreparsedData,
PCHAR Report,
ULONG ReportLength
);
Parameters
- ReportType
[in] HIDP_REPORT_TYPE enumerator value that indicates the type of HID report located at Report.
- UsagePage
[in] Usage page of a usage.
- LinkCollection
[in] Link collection that contains the usage. If LinkCollection is nonzero, the function only sets the usage, if one exists, in this link collection. If LinkCollection is zero, the function sets the first usage it finds in the top-level collection associated with PreparsedData.
- Usage
[in] Usage.
- UsageValue
[in] Usage value.
- PreparsedData
[in] Pointer to a top-level's preparsed data.
- Report
[in, out] On input, an initialized HID report. On output, a pointer to a HID report.
- ReportLength
[in] Size, in bytes, of the HID report located at Report, which must be equal to the report length for the specified report type that HidP_GetCaps returns in a collection's HIDP_CAPS structure.
Return Value
The following table shows the possible return values.
Value | Description |
---|---|
HIDP_STATUS_SUCCESS |
The function has successfully set the usage value. |
HIDP_STATUS_INCOMPATIBLE_REPORT_ID |
Usage does not exist in the specified report, but it does exist in a different report of the specified type. |
HIDP_STATUS_INVALID_PREPARSED_DATA |
Preparsed data is not valid. |
HIDP_STATUS_REPORT_DOES_NOT_EXIST |
No reports of the specified type exist. |
HIDP_STATUS_USAGE_NOT_FOUND |
Report contains a requested usage that is not in any report supported by the top-level collection. |
HIDP_STATUS_INVALID_REPORT_LENGTH |
Report length is not valid. |
HIDP_STATUS_INVALID_REPORT_TYPE |
Specified report type is not valid. |
Remarks
The terms button and usage are used synonymously.
HidP_SetUsageValue does not sign the value. A HID client must sign the value at the position provided in the HIDP_VALUE_CAPS structure for this value, or call HidP_SetScaledUsageValue.
Requirements
Header | hidpi.h |
Library | Hidparse_lib.lib |
Windows Embedded CE | Windows CE .NET 4.2 and later |
See Also
Reference
HID Parser Functions
HIDP_CAPS
HidP_GetCaps
HIDP_REPORT_TYPE
HidP_SetScaledUsageValue
HIDP_VALUE_CAPS