Цитата(Golikov A. @ Sep 10 2014, 17:12)

в HID данные от компа в устройство идут по 2 путям
через контрольную точку и через OUT точку.
зависит от того как посылаете. Если используете hid.dll, то HID_SendOutReport - шлет через контрольную точку WriteFile - через оут точку, возможно еще нужно чтобы были правильно описаны выходные репорты для данной точки в дескрипторах начальных
Посылаю через hidapi.dll функцией hid_write. В описании к функции написано "hid_write() will send the data on the first OUT endpoint, if one exists. If it does not, it will send the data through the Control Endpoint (Endpoint 0)." Соответственно предположил, что проблебма в контроллере.
Вот дескриптор конфигурации:
CODE
__ALIGN_BEGIN static uint8_t USBD_HID_CfgDesc[USB_HID_CONFIG_DESC_SIZ] __ALIGN_END =
{
0x09, /* bLength: Configuration Descriptor size */
USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */
USB_HID_CONFIG_DESC_SIZ,
/* wTotalLength: Bytes returned */
0x00,
0x01, /*bNumInterfaces: 1 interface*/
0x01, /*bConfigurationValue: Configuration value*/
0x00, /*iConfiguration: Index of string descriptor describing
the configuration*/
0xE0, /*bmAttributes: bus powered and Support Remote Wake-up */
0x32, /*MaxPower 100 mA: this current is used for detecting Vbus*/ //!!!!!!!!!!!!!!!!!!!!!!!!
/************** Descriptor of interface ****************/
/* 09 */
0x09, /*bLength: Interface Descriptor size*/
USB_INTERFACE_DESCRIPTOR_TYPE,/*bDescriptorType: Interface descriptor type*/
0x00, /*bInterfaceNumber: Number of Interface*/
0x00, /*bAlternateSetting: Alternate setting*/
0x01, /*bNumEndpoints*/ //!!!!!!!!!!!!!!!!!!!!
0x03, /*bInterfaceClass: HID*/
0x00,//0x01, /*bInterfaceSubClass : 1=BOOT, 0=no boot*/ //!!!!!!!!!!!!!!!!!!!!!!!!
0x00,//0x02, /*nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/ //!!!!!!!!!!!!!!!!!!!!!!!!
0, /*iInterface: Index of string descriptor*/
/******************** Descriptor of HID ********************/
/* 18 */
0x09, /*bLength: HID Descriptor size*/
HID_DESCRIPTOR_TYPE, /*bDescriptorType: HID*/
0x11, /*bcdHID: HID Class Spec release number*/
0x01,
0x00, /*bCountryCode: Hardware target country*/ //0x17 - Russia
0x01, /*bNumDescriptors: Number of HID class descriptors to follow*/
0x22, /*bDescriptorType*/
HID_MOUSE_REPORT_DESC_SIZE,/*wItemLength: Total length of Report descriptor*/
0x00,
/******************** Descriptor of IN endpoint ********************/
/* 27 */
0x07, /*bLength: Endpoint Descriptor size*/
USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/
HID_IN_EP, /*bEndpointAddress: Endpoint Address (IN)*/
0x03, /*bmAttributes: Interrupt endpoint*/ //???????
HID_IN_PACKET, /*wMaxPacketSize: 64 Byte max */ //!!!!!!!!!!!!!!!!!!!!!!!!
0x00,
0x01,//0x0A, /*bInterval: Polling Interval (10 ms)*/ //!!!!!!!!!!!!!!!!!!!!!!!!
/******************** Descriptor of OUT endpoint ********************/
/* 34 */
0x07, /*bLength: Endpoint Descriptor size*/
USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/
HID_OUT_EP, /*bEndpointAddress: Endpoint Address (OUT)*/
0x03, /*bmAttributes: Interrupt endpoint*/ //???????
HID_IN_PACKET, /*wMaxPacketSize: 64 Byte max */ //!!!!!!!!!!!!!!!!!!!!!!!!
0x00,
0x01,//0x0A, /*bInterval: Polling Interval (10 ms)*/ //!!!!!!!!!!!!!!!!!!!!!!!!
/* 41 */
};
А вот репорт:
CODE
__ALIGN_BEGIN static uint8_t HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE] __ALIGN_END =
{
0x06, 0x00, 0xff, // USAGE_PAGE (Generic Desktop)
0x09, 0x01, // USAGE (Vendor Usage 1)
0xA1, 0x01, // COLLECTION (Application)
// Input report
0x09, 0x01, // USAGE (Vendor Usage 1)
0x15, 0x00, // Logical Minimum (data bytes in the report may have minimum value = 0x00)
0x26, 0xFF, 0x00, // Logical Maximum (data bytes in the report may have maximum value = 0x00FF = unsigned 255)
0x75, 0x08, // Report Size: 8-bit field size
0x95, 0x40, // Report Count
0x81, 0x00, // Input (Data, Array, Abs)
// Output report
0x09, 0x01, // USAGE (Vendor Usage 1)
0x15, 0x00, // Logical Minimum (data bytes in the report may have minimum value = 0x00)
0x26, 0xFF, 0x00, // Logical Maximum (data bytes in the report may have maximum value = 0x00FF = unsigned 255)
0x75, 0x08, // Report Size: 8-bit field size
0x95, 0x40, // Report Count
0x91, 0x00, // Output (Data, Array, Abs)
0xC0 // End Collection