描述

A Collection item identifies a relationship between two or more data (Input, Output, or Feature.) For example, a mouse could be described as a collection of two to four data (x, y, button 1, button 2). While the Collection item opens a collection of data, the End Collection item closes a collection.

集合项用于标识两个或多个数据项(输入、输出或特征)之间的关联关系。例如,一个鼠标可以被描述为由二到四个数据项(X轴、Y轴、按键1、按键2)组成的集合。集合项用于开启一个数据集合,而结束集合项则用于关闭该集合。

格式

有效数据值的字节含义:(不要理解 0x00 0x01 … 是第*个索引位置)

  • 0x00 Physical ★
    A physical collection is used for a set of data items that represent data points collected at one geometric point. This is useful for sensing devices which may need to associate sets of measured or sensed data with a single point. It does not indicate that a set of data values comes from one device, such as a keyboard. In the case of device which reports the position of multiple sensors, physical collections are used to show which data comes from each separate sensor.

    物理集合用于将表示在同一几何点采集的数据点的一组数据项组合起来。这对于需要将多组测量或感知数据与单个点关联的传感设备非常有用。它表示一组数据值来自同一个设备(如键盘)。对于需要报告多个传感器位置的设备,物理集合用于指明哪些数据来自每个独立的传感器。

  • 0x01 Application ★
    A group of Main items that might be familiar to applications. It could also be used to identify item groups serving different purposes in a single device. Common examples are a keyboard or mouse. A keyboard with an integrated pointing device could be defined as two different application collections. Data reports are usually (but not necessarily) associated with application collections (at least one report ID per application).

    应用集合是一组应用程序可能熟悉的主项。它也可用于标识单个设备中服务于不同目的的项组。常见的例子是键盘或鼠标。一个集成了指针设备的键盘可以被定义为两个不同的应用集合。数据报告通常(但非必然)与应用集合相关联(每个应用集合至少有一个报告ID)。

  • 0x02 Logical
    A logical collection is used when a set of data items form a composite data structure. An example of this is the association between a data buffer and a byte count of the data. The collection establishes the link between the count and the buffer.

    逻辑集合用于将一组形成一个复合数据结构的数据项组合起来。一个典型的例子是数据缓冲区与其数据字节数之间的关联。这个集合在计数值缓冲区之间建立了链接。

  • 0x03 Report
    Defines a logical collection that wraps all the fields in a report. A unique report ID will be contained in this collection. An application can easily determine whether a device supports a certain function. Note that any valid Report ID value can be declared for a Report collection.

    报告集合定义了一个包含报告中所有字段的逻辑集合。此集合中将包含一个唯一的报告ID。通过此ID,应用程序可以轻松判断设备是否支持某项特定功能。需要注意的是,可以为报告集合声明任何有效的报告ID值

  • 0x04 Named Array
    A named array is a logical collection contains an array of selector usages. For a given function the set of selectors used by similar devices may vary. The naming of fields is common practice when documenting hardware registers. To determine whether a device supports a particular function like Status, an application might have to query for several known Status selector usages before it could determine whether the device supported Status. The Named Array usages allows the Array field that contains the selectors to be named, thus the application only needs to query for the Status usage to determine that a device supports status information.

    命名数组是一种包含一组选择器用途的逻辑集合。对于特定功能,不同类似设备所使用的选择器集合可能各不相同。在为硬件寄存器编写文档时,对字段进行命名是常见做法。为了判断设备是否支持某项特定功能(例如“状态”),应用程序可能需要查询多个已知的“状态”选择器用途,才能最终确定设备是否支持该功能。而命名数组用途允许为包含这些选择器的数组字段命名,这样应用程序只需查询“状态”这个用途,就能确定设备是否支持状态信息功能。

  • 0x05 Usage Switch
    A Usage Switch is a logical collection that modifies the meaning of the usages that it contains. This collection type indicates to an application that the usages found in this collection must be special cased. For instance, rather than declaring a usage on the LED page for every possible function, an Indicator usage can be applied to a Usage Switch collection and the standard usages defined in that collection can now be identified as indicators for a function rather than the function itself. Note that this collection type is not used for the labeling Ordinal collections, a Logical collection type is used for that.

    用途开关是一种逻辑集合,它修改了其所包含的“用途”的含义。此集合类型向应用程序表明,必须对本集合内的用途进行特殊处理。例如,与其为每个可能的功能在LED用途页面上声明一个单独的用途,不如将“指示器”用途应用于一个“用途开关”集合。这样一来,该集合内定义的标准用途现在可以被识别为某个功能的指示器,而非功能本身。请注意,此集合类型不用于标记“序数”集合,后者应使用逻辑集合类型。

  • 0x06 Usage Modifier
    Modifies the meaning of the usage attached to the encompassing collection. A usage typically defines a single operating mode for a control. The usage modifier allows the operating mode of a control to be extended. For instance, an LED is typically on or off. For particular states a device may want a generic method of blinking or choosing the color of a standard LED. Attaching the LED usage to a Usage Modifier collection will indicate to an application that the usage supports a new operating mode.

    用途修饰符用于修改附加到其所包含集合上的“用途”的含义。一个“用途”通常定义一个控件的单一操作模式。“用途修饰符”则允许扩展控件的操作模式。例如,一个LED通常只有“亮”或“灭”两种状态。对于某些特定状态,设备可能希望有一种通用方法来实现闪烁选择标准LED的颜色。将LED用途附加到一个“用途修饰符”集合上,会向应用程序表明该用途支持一种新的操作模式

  • 0x07 - 0x7F 保留

  • 0x80 - 0xFF 工厂自定义

注释

  • All Main items between the Collection item and the End Collection item are included in the collection. Collections may contain other nested collections.

    位于集合项结束集合项之间的所有主项都包含在该集合内。集合内可以嵌套包含其他集合。

  • Collection items do not generate data. However, a Usage item tag must be associated with any collection (such as a mouse or throttle). Collection items may be nested, and they are always optional, except for the top-level application collection.

    集合项本身不产生数据。 但是,任何集合(如鼠标或油门)必须关联一个用途项标签。集合项可以嵌套,并且除了最顶层的应用集合外,它们都是可选的

  • If an unknown Vendor-defined collection type is encountered, then an application must ignore all main items declared in that collection. Note that global items declared in that collection will effect the state table.

    如果遇到未知的供应商自定义集合类型,则应用程序必须忽略在该集合中声明的所有主项。请注意, 在该集合中声明的全局项仍然会影响状态表

  • If an unknown usage is attached to a known collection type then the contents of that collection should be ignored. Note that global items declared in that collection will effect the state table.

    如果已知的集合类型附加了一个未知的用途,则应忽略该集合中的内容。请注意, 在该集合中声明的全局项仍然会影响状态表

  • String and Physical indices, as well as delimiters may be associated with collections.

    字符串索引物理描述符索引以及分隔符都可以与集合相关联。