<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Supporting multiple HID device class instances (via HUB class) in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Supporting-multiple-HID-device-class-instances-via-HUB-class/m-p/734785#M17681</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to create a MQX USB host application which supports attachment of multiple HID-class USB devices (several device instances of the same class) connected through a USB hub. There are MQX USB HID example applications (e.g. the HID mouse example and mouse+keyboard examples). This examples will work with a device connected via a HUB, but the examples only support one device instance within each class (separate mouse and keyboard tasks).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MQX USB release note states:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;"...&lt;STRONG&gt;USB Host HUB Examples&lt;/STRONG&gt;&lt;BR /&gt;HUB class support is enabled in HID example applications. The applications run correctly with the USB device&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;attached&amp;nbsp;either directly or through the hub. &lt;STRONG&gt;However, the example code only handles a single device.&amp;nbsp;A combined Mouse+Keyboard&amp;nbsp;demo handles one mouse and one keyboard simultaneously.&amp;nbsp;The same kind of multiple devices, which are attached through&amp;nbsp;the hub, cannot be used in the&amp;nbsp;example applications&lt;/STRONG&gt;. ..."&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;I interpret this release note to indicate that the example applications are not designed to support multiple device handle / device interface instances for a single HID class.&amp;nbsp; Does this also mean it is not possible (in general) to design an application to support multiple devices of the same class, or only that the specific examples provided are&amp;nbsp;not designed to support multiple instances?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mouse+keyboard example uses separate tasks for each device class: HID mouse and HID keyboard. A separate event flag is used to send notifications of status changes for an event flag (bit mask) that combines&amp;nbsp; USB_EVENT_CTRL,&amp;nbsp;USB_EVENT_DATA, and&amp;nbsp;USB_EVENT_DATA_CORRUPTED bits&amp;nbsp;for each of the mouse and keyboard tasks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I tried to redesign an HID task based on the hidmouse.c code, I would need a separate &lt;SPAN&gt;DEVICE_STRUCT hid_device array element for each&amp;nbsp;&lt;/SPAN&gt;HID device instance, a corresponding LWEVENT_STRUCT USB_Event event flag for each device, and a mechanism to lookup which event flag I should use to correspond to the particular DEVICE_STRUCT hid_device instance and device interface handle provided in the callback notification.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone implemented a multiple instance HID class client (more than one interface instance per device class task)?&lt;/P&gt;&lt;P&gt;Are there any examples of multi-instance HID class devices?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Feb 2018 22:19:49 GMT</pubDate>
    <dc:creator>gordonfinlay</dc:creator>
    <dc:date>2018-02-09T22:19:49Z</dc:date>
    <item>
      <title>Supporting multiple HID device class instances (via HUB class)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Supporting-multiple-HID-device-class-instances-via-HUB-class/m-p/734785#M17681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to create a MQX USB host application which supports attachment of multiple HID-class USB devices (several device instances of the same class) connected through a USB hub. There are MQX USB HID example applications (e.g. the HID mouse example and mouse+keyboard examples). This examples will work with a device connected via a HUB, but the examples only support one device instance within each class (separate mouse and keyboard tasks).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MQX USB release note states:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;"...&lt;STRONG&gt;USB Host HUB Examples&lt;/STRONG&gt;&lt;BR /&gt;HUB class support is enabled in HID example applications. The applications run correctly with the USB device&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;attached&amp;nbsp;either directly or through the hub. &lt;STRONG&gt;However, the example code only handles a single device.&amp;nbsp;A combined Mouse+Keyboard&amp;nbsp;demo handles one mouse and one keyboard simultaneously.&amp;nbsp;The same kind of multiple devices, which are attached through&amp;nbsp;the hub, cannot be used in the&amp;nbsp;example applications&lt;/STRONG&gt;. ..."&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;I interpret this release note to indicate that the example applications are not designed to support multiple device handle / device interface instances for a single HID class.&amp;nbsp; Does this also mean it is not possible (in general) to design an application to support multiple devices of the same class, or only that the specific examples provided are&amp;nbsp;not designed to support multiple instances?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mouse+keyboard example uses separate tasks for each device class: HID mouse and HID keyboard. A separate event flag is used to send notifications of status changes for an event flag (bit mask) that combines&amp;nbsp; USB_EVENT_CTRL,&amp;nbsp;USB_EVENT_DATA, and&amp;nbsp;USB_EVENT_DATA_CORRUPTED bits&amp;nbsp;for each of the mouse and keyboard tasks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I tried to redesign an HID task based on the hidmouse.c code, I would need a separate &lt;SPAN&gt;DEVICE_STRUCT hid_device array element for each&amp;nbsp;&lt;/SPAN&gt;HID device instance, a corresponding LWEVENT_STRUCT USB_Event event flag for each device, and a mechanism to lookup which event flag I should use to correspond to the particular DEVICE_STRUCT hid_device instance and device interface handle provided in the callback notification.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone implemented a multiple instance HID class client (more than one interface instance per device class task)?&lt;/P&gt;&lt;P&gt;Are there any examples of multi-instance HID class devices?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2018 22:19:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Supporting-multiple-HID-device-class-instances-via-HUB-class/m-p/734785#M17681</guid>
      <dc:creator>gordonfinlay</dc:creator>
      <dc:date>2018-02-09T22:19:49Z</dc:date>
    </item>
  </channel>
</rss>

