Поделиться через


HidP_SetUsages (Windows Embedded CE 6.0)

1/6/2010

This function sets the specified HID control buttons On (one) in a HID report.

Syntax

NTSTATUS HidP_SetUsages(
  HIDP_REPORT_TYPE ReportType,
  USAGE UsagePage,
  USHORT LinkCollection,
  PUSAGE UsageList,
  PULONG UsageLength,
  PHIDP_PREPARSED_DATA PreparsedData,
  PCHAR Report,
  ULONG ReportLength
);

Parameters

  • ReportType
    [in] HIDP_REPORT_TYPE enumerator value that indicates the type of report located at Report.
  • UsagePage
    [in] Usage page for the usages specified by UsageList.
  • LinkCollection
    [in] Optional. Link collection that contains the usages. If LinkCollection is nonzero, the function only sets the usages, if they exist, in this link collection. If LinkCollection is zero, the function sets the first usage for each specified usage in the top-level collection associated with PreparsedData.
  • UsageList
    [in] Pointer to the array of usages.
  • UsageLength
    [in, out] On input, the number of usages in UsageList. On output, if HidP_SetUsages cannot set a usage in UsageList, the function sets UsageLength to the index of the usage that cannot be set, and returns a status value that indicates the error.
  • PreparsedData
    [in] Pointer to the preparsed data of the top-level collection associated with the report located at Report.
  • Report
    [in, out] On input, an initialized HID report. On output, a pointer to a HID report.
  • ReportLength
    [in] Size, in bytes, of the 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_BUFFER_TOO_SMALL

Usage in a button array cannot be set because the array is already fully set.

HIDP_STATUS_INVALID_REPORT_LENGTH

Report length is not valid.

HIDP_STATUS_INVALID_REPORT_TYPE

Specified report type is not valid.

HIDP_STATUS_INCOMPATIBLE_REPORT_ID

Report contains a collection with buttons in the specified usage page, but there are no such usages in the report.

HIDP_STATUS_INVALID_PREPARSED_DATA

Preparsed data is not valid.

HIDP_STATUS_USAGE_NOT_FOUND

Report contains a requested usage that is not in any report supported by the top-level collection.

Remarks

The terms button and usage are used synonymously.

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_GetButtons
HidP_GetCaps
HidP_GetUsages
HIDP_REPORT_TYPE
HidP_SetButtons
HidP_UnsetButtons
HidP_UnsetUsages