Ports
May 19, 2013, 06:50:30 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: usb Usage type for HID not the same for windows.  (Read 3128 times)
ulao
Member
*
Posts: 7


« on: February 28, 2011, 09:12:52 am »

In windows I can use this list and its correct.

Generic Desktop
0x00 Undefined
0x01 Pointer
0x02 Mouse
0x03 Reserved
0x04 Joystick
0x05 Game Pad
0x06 Keyboard
0x07 Keypad
0x08 Multi-axis Controller

My devise is a  Game Pad  as it uses force feed back so I must use 0x05. Now in linux 0x05 shows up as a mouse? Does anyone have the list for linux ubuntu (debian). If the list is in fact not the same, how is a developer going to deal with that?



« Last Edit: February 28, 2011, 09:14:56 am by ulao » Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #1 on: February 28, 2011, 09:31:57 am »

These values are from the USB-IF's HID Usage tables document.

I don't know what you mean by "in linux 0x05 shows up as a mouse."

Jan
Logged
ulao
Member
*
Posts: 7


« Reply #2 on: February 28, 2011, 09:37:05 am »

Just simply that. If I do the following.

0x05,0x01, // Usage Page Generic Desktop
0x09,0x05, // Usage gamepad
0xA1,0x01, // Collection Application

In windows I get a gamepad. In linux ubuntu (debian) I get a mouse. Even if I move the x/y analogs on my stick it will move the mouse. Looking in the device folder its a mouse.

On a side note:If I change 0x05 to 0x04 it now shows as a joystick and works that way. Though , this is no good because its now a joystick not a game pad, so windows wont use the FFB.

I'm told this implementation may not be the same for linux.




« Last Edit: February 28, 2011, 09:43:06 am by ulao » Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #3 on: February 28, 2011, 10:09:39 am »

Can you post the complete report descriptor?

Jan
Logged
ulao
Member
*
Posts: 7


« Reply #4 on: February 28, 2011, 10:15:15 am »

OMG, you crazzy! LOL .. ok you asked for it.


urr,ok I cant  
Quote
The following error or errors occurred while posting this message:The message exceeds the maximum allowed length (20000 characters).

I will have to remove the FFB stuff.

Code:
///// gampad
0x05,0x01,  //    Usage Page Generic Desktop
0x09,0x05,  //    Usage gamepad
0xA1,0x01,  //    Collection Application
//axis
   0x85,0x01,        //    Report ID 1
0x09, 0x01,                    //     usage pointer
0xA1, 0x00,   // COLLECTION (phys)
0x75, 0x08,                    //     REPORT_SIZE (8)
0x95, 0x06,                    //     REPORT_COUNT (6)
0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00,              //     LOGICAL_MAXIMUM (255)
0x35, 0x00,                    //     Physical Minimum (0)
0x46, 0xFF, 0x00,              //     Physical Minimum (255)
0x09, 0x30,                    //     USAGE (X)
0x09, 0x31,                    //     USAGE (Y)
0x09, 0x32,   //  USAGE (Z)
0x09, 0x33,   //     USAGE (Rx)
0x09, 0x34, //  USAGE (Ry)
0x09, 0x35, //  USAGE (Rz)
0x81, 0x02,                    //     INPUT
0xC0,   // COLLECTION (phys)

0x09, 0x01,                    //     usage pointer
0xA1, 0x00,   // COLLECTION (phys)
0x75, 0x08,                    //     REPORT_SIZE (8)
0x95, 0x02,                    //     REPORT_COUNT (2)

0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00,              //     LOGICAL_MAXIMUM (255)

0x09, 0x36, //  slider
0x09, 0x37, //  dial
//0x09, 0x38, // wheel ( cant figure this out )
//0x09, 0x39, // hat ( can use many dirrections... )
0x81, 0x02,                    //     INPUT
0xC0,   // COLLECTION (phys)


//buttons
0x05, 0x09,                    // USAGE_PAGE (Button)
0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
0x75, 0x01,                    // REPORT_SIZE (1)
0x95, 0x18,                    // REPORT_COUNT (24)
0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)
0x29, 0x18,                    //   USAGE_MAXIMUM (Button 24)
0x81, 0x02,                    // INPUT

0xC0

If you need to see the FFB stuff see here
http://www.microchip.com/forums/tm.aspx?m=320225&mpage=2
post 35.
« Last Edit: February 28, 2011, 10:30:31 am by ulao » Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #5 on: February 28, 2011, 10:41:30 am »

You could start with a basic report descriptor like the one here:

http://ww1.microchip.com/downloads/en/AppNotes/91054c.pdf

or model your descriptor on one from a working gamepad.

If it works under Windows, check Device Manager to see if it's using additional drivers.

Jan
Logged
ulao
Member
*
Posts: 7


« Reply #6 on: February 28, 2011, 10:45:00 am »

Yeah I did all that basic testing and it still just as I described. So based on your response, you would say this is not the case? In that the implementation should be the same x-plat form? So it must be a kernel issue ( bug ).

It only uses the one HID gamepad driver.
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #7 on: February 28, 2011, 11:21:44 am »

Do your descriptors match those for a gamepad that works under Linux?

Jan
Logged
ulao
Member
*
Posts: 7


« Reply #8 on: February 28, 2011, 11:30:12 am »

hmm you lost me a bit there? Unless you mean do my descriptors match another games pads descriptors . I will have to see if I have another usb "gamePad" type around.
Logged
ulao
Member
*
Posts: 7


« Reply #9 on: February 28, 2011, 08:55:12 pm »

Well I found another gamepad but I can not see in windows what it is? DM calls it a game controller but that is a lot of good? So here is usbView. This device does not show the descriptor, any idea what it is?

Connection Status Device connected
Current Configuration 1
Speed Low
Device Address 3
Number Of Open Pipes 1

Device Descriptor
Offset Field Size Value Description
0 bLength 1 12h 
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0100h USB Spec 1.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h 
6 bDeviceProtocol 1 00h 
7 bMaxPacketSize0 1 08h 8 bytes
8 idVendor 2 6666h Prototype product Vendor ID
10 idProduct 2 0667h 
12 bcdDevice 2 0288h 2.88
14 iManufacturer 1 00h 
15 iProduct 1 00h 
16 iSerialNumber 1 00h 
17 bNumConfigurations 1 01h 

Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 0022h 
4 bNumInterfaces 1 01h 
5 bConfigurationValue 1 01h 
6 iConfiguration 1 00h 
7 bmAttributes 1 80h Bus Powered
 4..0: Reserved  ...00000   
 5: Remote Wakeup  ..0.....  No
 6: Self Powered  .0......  No, Bus Powered
 7: Reserved (set to one)
(bus-powered for 1.0)  1.......   
8 bMaxPower 1 32h 100 mA

Interface Descriptor 0/0 HID, 1 Endpoint
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 04h Interface
2 bInterfaceNumber 1 00h 
3 bAlternateSetting 1 00h 
4 bNumEndpoints 1 01h 
5 bInterfaceClass 1 03h HID
6 bInterfaceSubClass 1 00h 
7 bInterfaceProtocol 1 00h 
8 iInterface 1 00h 

HID Descriptor
Offset Field Size Value Description
0 bLength 1 09h 
1 bDescriptorType 1 21h HID
2 bcdHID 2 0100h 1.00
4 bCountryCode 1 00h 
5 bNumDescriptors 1 01h 
6 bDescriptorType 1 22h Report
7 wDescriptorLength 2 0052h 82 bytes

Endpoint Descriptor 81 1 In, Interrupt, 10 ms
Offset Field Size Value Description
0 bLength 1 07h 
1 bDescriptorType 1 05h Endpoint
2 bEndpointAddress 1 81h 1 In
3 bmAttributes 1 03h Interrupt
 1..0: Transfer Type  ......11  Interrupt
 7..2: Reserved  000000..   
4 wMaxPacketSize 2 0006h 6 bytes
6 bInterval 1 0Ah 10 ms
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1625


WWW
« Reply #10 on: February 28, 2011, 09:57:20 pm »

According to:

http://www.linux-usb.org/usb.ids

6666  Prototype product Vendor ID
0667  WiseGroup Smart Joy PSX, PS-PC Smart JoyPad

Jan
Logged
ulao
Member
*
Posts: 7


« Reply #11 on: March 01, 2011, 08:12:33 am »

but that does not tell my what the 0x09 usage is.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!