Discussion:
[libhid-discuss] Opening Microchip Mouse In a Circle Demo in ubuntu
Kim Chuan Lim
2008-08-07 08:37:43 UTC
Permalink
sorry for cross posting..

Hi ya,

I'm using kubuntu with linux kernel version 2.6.24-19.

I'm not sure what is the correct way of reading and writing from the
device. The following is some output from test_libhid.c

device identification of HIDInterface 004/006[0]:
dev_handle: 0x0804b350
device: 0x08057258
location: 004/006
manufacturer: Microchip Technology Inc.
product: Mouse In a Circle Demo
dump tree....
TRACE: hid_reset_parser(): resetting the HID parser for USB device
004/006[0]...
TRACE: hid_dump_tree(): iterating the parse tree for USB device 004/006[0]...
parse tree of HIDInterface 004/006[0]:
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
TRACE: hid_reset_parser(): resetting the HID parser for USB device
004/006[0]...
TRACE: hid_get_input_report(): looking up report ID...
TRACE: hid_prepare_parse_path(): preparing search path of depth 2
for parse tree of USB device 004/006[0]...
TRACE: hid_prepare_parse_path(): search path prepared for parse tree
of USB device 004/006[0].
NOTICE: hid_find_object(): found requested item.
TRACE: hid_get_input_report(): retrieving report ID 0x00 (length:
64) from USB device 004/006[0]...
WARNING: hid_get_input_report(): failed to retrieve report from USB
device 004/006[0]:error sending control message: Broken pipe.
hid_get_input_report failed with return code 20

Can someone tell me what is the correct information to retrieve report?

The following is some system information.
dmesg
[102780.879169] usb 4-1: new full speed USB device using uhci_hcd and address 6
[102780.892127] usb 4-1: configuration #1 chosen from 1 choice
[102780.906887] hiddev96hidraw1: USB HID v1.11 Device [Microchip
Technology Inc. Mouse In a Circle Demo] on usb-0000:00:1d.1-1

sudo lsusb -d 04d8:003f -vvv

Bus 004 Device 006: ID 04d8:003f Microchip Technology, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x04d8 Microchip Technology, Inc.
idProduct 0x003f
bcdDevice 0.02
iManufacturer 1 Microchip Technology Inc.
iProduct 2 Mouse In a Circle Demo
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 28
Report Descriptor: (length is 28)
Item(Global): Usage Page, data= [ 0xff 0xff ] 65535
(null)
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0xff ] 255
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Report Count, data= [ 0x40 ] 64
Item(Main ): Input, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
Item(Main ): Output, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Main ): End Collection, data=none
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
Device Status: 0x0001
Self Powered

Hope you guys can help me.

Regards,
Kim Chuan.
Charles Lepple
2008-08-07 12:22:05 UTC
Permalink
Post by Kim Chuan Lim
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
[...]
Post by Kim Chuan Lim
TRACE: hid_reset_parser(): resetting the HID parser for USB device
004/006[0]...
TRACE: hid_get_input_report(): looking up report ID...
TRACE: hid_prepare_parse_path(): preparing search path of depth 2
for parse tree of USB device 004/006[0]...
TRACE: hid_prepare_parse_path(): search path prepared for parse tree
of USB device 004/006[0].
NOTICE: hid_find_object(): found requested item.
64) from USB device 004/006[0]...
WARNING: hid_get_input_report(): failed to retrieve report from USB
device 004/006[0]:error sending control message: Broken pipe.
Can you send the code you are using for this portion? The "Broken
pipe" error probably means that the device was not expecting a
request for that many bytes.
Post by Kim Chuan Lim
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
The hid_dump_tree() function does not properly print the trace for a
range of Usage IDs. So your "Usage Path" in libhid would probably
look something like { 0xffff0001, 0xffff0001 } through { 0xffff0001,
0xffff0040 }.
--
Charles Lepple
Kim Chuan Lim
2008-08-07 13:07:08 UTC
Permalink
Please find the codes below..

int const PATH_OUT[2] = {0xffff0001,0x81};
int i=0;
char packet[64];
packet[0] =0x0;
ret = hid_get_input_report(hid, PATH_OUT, 2, packet, 64);
if (ret != HID_RET_SUCCESS) {
fprintf(stderr, "hid_get_input_report failed with return code
%d\n", ret);
break;
}else{

fprintf(stderr, " data is availabled \n");
}
Post by Kim Chuan Lim
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
[...]
Post by Kim Chuan Lim
TRACE: hid_reset_parser(): resetting the HID parser for USB device
004/006[0]...
TRACE: hid_get_input_report(): looking up report ID...
TRACE: hid_prepare_parse_path(): preparing search path of depth 2
for parse tree of USB device 004/006[0]...
TRACE: hid_prepare_parse_path(): search path prepared for parse tree
of USB device 004/006[0].
NOTICE: hid_find_object(): found requested item.
64) from USB device 004/006[0]...
WARNING: hid_get_input_report(): failed to retrieve report from USB
device 004/006[0]:error sending control message: Broken pipe.
Can you send the code you are using for this portion? The "Broken pipe"
error probably means that the device was not expecting a request for that
many bytes.
Post by Kim Chuan Lim
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
The hid_dump_tree() function does not properly print the trace for a range
of Usage IDs. So your "Usage Path" in libhid would probably look something
like { 0xffff0001, 0xffff0001 } through { 0xffff0001, 0xffff0040 }.
--
Charles Lepple
Charles Lepple
2008-08-07 13:19:46 UTC
Permalink
Post by Kim Chuan Lim
Please find the codes below..
int const PATH_OUT[2] = {0xffff0001,0x81};
Try changing that to {0xffff0001, 0xffff0000} and see if it works.
Post by Kim Chuan Lim
int i=0;
char packet[64];
packet[0] =0x0;
ret = hid_get_input_report(hid, PATH_OUT, 2, packet, 64);
if (ret != HID_RET_SUCCESS) {
fprintf(stderr, "hid_get_input_report failed with return code
%d\n", ret);
break;
}else{
fprintf(stderr, " data is availabled \n");
}
Post by Kim Chuan Lim
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
[...]
Post by Kim Chuan Lim
TRACE: hid_reset_parser(): resetting the HID parser for USB device
004/006[0]...
TRACE: hid_get_input_report(): looking up report ID...
TRACE: hid_prepare_parse_path(): preparing search path of depth 2
for parse tree of USB device 004/006[0]...
TRACE: hid_prepare_parse_path(): search path prepared for parse tree
of USB device 004/006[0].
NOTICE: hid_find_object(): found requested item.
64) from USB device 004/006[0]...
WARNING: hid_get_input_report(): failed to retrieve report from USB
device 004/006[0]:error sending control message: Broken pipe.
Can you send the code you are using for this portion? The "Broken pipe"
error probably means that the device was not expecting a request for that
many bytes.
Post by Kim Chuan Lim
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
The hid_dump_tree() function does not properly print the trace for a range
of Usage IDs. So your "Usage Path" in libhid would probably look something
like { 0xffff0001, 0xffff0001 } through { 0xffff0001, 0xffff0040 }.
--
Charles Lepple
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
--
Charles Lepple
clepple at ghz.cc
Kim Chuan Lim
2008-08-07 13:50:16 UTC
Permalink
TRACE: hid_get_input_report(): looking up report ID...
TRACE: hid_prepare_parse_path(): preparing search path of depth 2
for parse tree of USB device 004/007[0]...
TRACE: hid_prepare_parse_path(): search path prepared for parse tree
of USB device 004/007[0].
NOTICE: hid_find_object(): found requested item.
TRACE: hid_get_input_report(): retrieving report ID 0x00 (length:
64) from USB device 004/007[0]...
WARNING: hid_get_input_report(): failed to retrieve report from USB
device 004/007[0]:error sending control message: Broken pipe.
hid_get_input_report failed with return code 20
Post by Charles Lepple
Post by Kim Chuan Lim
Please find the codes below..
int const PATH_OUT[2] = {0xffff0001,0x81};
Try changing that to {0xffff0001, 0xffff0000} and see if it works.
Post by Kim Chuan Lim
int i=0;
char packet[64];
packet[0] =0x0;
ret = hid_get_input_report(hid, PATH_OUT, 2, packet, 64);
if (ret != HID_RET_SUCCESS) {
fprintf(stderr, "hid_get_input_report failed with return code
%d\n", ret);
break;
}else{
fprintf(stderr, " data is availabled \n");
}
Post by Kim Chuan Lim
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
[...]
Post by Kim Chuan Lim
TRACE: hid_reset_parser(): resetting the HID parser for USB device
004/006[0]...
TRACE: hid_get_input_report(): looking up report ID...
TRACE: hid_prepare_parse_path(): preparing search path of depth 2
for parse tree of USB device 004/006[0]...
TRACE: hid_prepare_parse_path(): search path prepared for parse tree
of USB device 004/006[0].
NOTICE: hid_find_object(): found requested item.
64) from USB device 004/006[0]...
WARNING: hid_get_input_report(): failed to retrieve report from USB
device 004/006[0]:error sending control message: Broken pipe.
Can you send the code you are using for this portion? The "Broken pipe"
error probably means that the device was not expecting a request for that
many bytes.
Post by Kim Chuan Lim
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
The hid_dump_tree() function does not properly print the trace for a range
of Usage IDs. So your "Usage Path" in libhid would probably look something
like { 0xffff0001, 0xffff0001 } through { 0xffff0001, 0xffff0040 }.
--
Charles Lepple
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
--
Charles Lepple
clepple at ghz.cc
amruth
2008-08-07 15:21:28 UTC
Permalink
Hi
Kim
Try to enable usb debug messages. You should do something like this
echo "1" > /sys/modules/usbcore/paramaters/usbfs_snoop.
You can use dmesg to get the output.
It will show what parmeters are being sent. You should be able to debug easily. Check whether that params ar correct.

Thanks
Amruth p.v
From: Kim Chuan Lim <lim.kim.chuan at gmail.com>
Subject: [libhid-discuss] Opening Microchip Mouse In a Circle Demo in ubuntu
To: libhid-discuss at lists.alioth.debian.org
Date: Thursday, August 7, 2008, 3:37 AM
sorry for cross posting..
Hi ya,
I'm using kubuntu with linux kernel version 2.6.24-19.
I'm not sure what is the correct way of reading and
writing from the
device. The following is some output from test_libhid.c
dev_handle: 0x0804b350
device: 0x08057258
location: 004/006
manufacturer: Microchip Technology Inc.
product: Mouse In a Circle Demo
dump tree....
TRACE: hid_reset_parser(): resetting the HID parser for
USB device
004/006[0]...
TRACE: hid_dump_tree(): iterating the parse tree for USB
device 004/006[0]...
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
path: 0xffff0001.0x00000000; type: 0x90
TRACE: hid_reset_parser(): resetting the HID parser for
USB device
004/006[0]...
TRACE: hid_get_input_report(): looking up report ID...
TRACE: hid_prepare_parse_path(): preparing search path of
depth 2
for parse tree of USB device 004/006[0]...
TRACE: hid_prepare_parse_path(): search path prepared for
parse tree
of USB device 004/006[0].
NOTICE: hid_find_object(): found requested item.
TRACE: hid_get_input_report(): retrieving report ID 0x00
64) from USB device 004/006[0]...
WARNING: hid_get_input_report(): failed to retrieve report
from USB
device 004/006[0]:error sending control message: Broken
pipe.
hid_get_input_report failed with return code 20
Can someone tell me what is the correct information to
retrieve report?
The following is some system information.
dmesg
[102780.879169] usb 4-1: new full speed USB device using
uhci_hcd and address 6
[102780.892127] usb 4-1: configuration #1 chosen from 1
choice
[102780.906887] hiddev96hidraw1: USB HID v1.11 Device
[Microchip
Technology Inc. Mouse In a Circle Demo] on
usb-0000:00:1d.1-1
sudo lsusb -d 04d8:003f -vvv
Bus 004 Device 006: ID 04d8:003f Microchip Technology, Inc.
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x04d8 Microchip Technology, Inc.
idProduct 0x003f
bcdDevice 0.02
iManufacturer 1 Microchip Technology Inc.
iProduct 2 Mouse In a Circle Demo
iSerial 0
bNumConfigurations 1
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 28
Report Descriptor: (length is 28)
Item(Global): Usage Page, data= [ 0xff 0xff ]
65535
(null)
Item(Local ): Usage, data= [ 0x01 ] 1
(null)
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0xff ]
255
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Report Count, data= [ 0x40 ] 64
Item(Main ): Input, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap
Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
(null)
Item(Local ): Usage Maximum, data= [ 0x40 ] 64
(null)
Item(Main ): Output, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap
Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Main ): End Collection, data=none
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
Device Status: 0x0001
Self Powered
Hope you guys can help me.
Regards,
Kim Chuan.
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
amruth
2008-08-19 23:23:19 UTC
Permalink
Hi
I am trying to use libhid for my device. I found out that libhid is not compatible to latest libusb-1.0.
I tried to compile and build using the latest libusb library, but I seeing lot of errors during building.
libs/libhid.so unreferenced find_usb_busses
libs/libhid.so unreferenced usb_strerror
....
Can anybody please let me know about the new libusb used with libhid.
I have also observed some of my applications is broken in 2.6.26 kernel.
I know that until 2.6.25.15 evrything works but broken afterwards.
I get broken pipe error when I tried to get descriptors.
hid_force_open failed
TRACE: hid_prepare_hid_descriptor(): retrieving HID descriptor for USB
device 001/002[0]...
USB error: error sending control message: Broken pipe
I see the same exact thing working in 2.6.25.15.
Can anybody please let me know what has changed in 2.6.26 kernel.

Thanks
Amruth p.v
From: Charles Lepple <clepple at ghz.cc>
Subject: Re: [libhid-discuss] Opening Microchip Mouse In a Circle Demo in ubuntu
To: "Kim Chuan Lim" <lim.kim.chuan at gmail.com>
Cc: "libhid-discuss List" <libhid-discuss at lists.alioth.debian.org>
Date: Thursday, August 7, 2008, 8:19 AM
Post by Kim Chuan Lim
Please find the codes below..
int const PATH_OUT[2] = {0xffff0001,0x81};
Try changing that to {0xffff0001, 0xffff0000} and see if it
works.
Post by Kim Chuan Lim
int i=0;
char packet[64];
packet[0] =0x0;
ret = hid_get_input_report(hid, PATH_OUT, 2,
packet, 64);
Post by Kim Chuan Lim
if (ret != HID_RET_SUCCESS) {
fprintf(stderr, "hid_get_input_report
failed with return code
Post by Kim Chuan Lim
%d\n", ret);
break;
}else{
fprintf(stderr, " data is availabled
\n");
Post by Kim Chuan Lim
}
On Thu, Aug 7, 2008 at 1:22 PM, Charles Lepple
Post by Charles Lepple
Post by Kim Chuan Lim
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
path: 0xffff0001.0x00000000; type: 0x80
[...]
Post by Kim Chuan Lim
TRACE: hid_reset_parser(): resetting the HID
parser for USB device
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
004/006[0]...
TRACE: hid_get_input_report(): looking up
report ID...
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
TRACE: hid_prepare_parse_path(): preparing
search path of depth 2
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
for parse tree of USB device 004/006[0]...
TRACE: hid_prepare_parse_path(): search path
prepared for parse
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
tree
of USB device 004/006[0].
NOTICE: hid_find_object(): found requested
item.
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
TRACE: hid_get_input_report(): retrieving
64) from USB device 004/006[0]...
WARNING: hid_get_input_report(): failed to
retrieve report from USB
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
device 004/006[0]:error sending control
message: Broken pipe.
Post by Kim Chuan Lim
Post by Charles Lepple
Can you send the code you are using for this
portion? The "Broken
Post by Kim Chuan Lim
Post by Charles Lepple
pipe"
error probably means that the device was not
expecting a request
Post by Kim Chuan Lim
Post by Charles Lepple
for that
many bytes.
Post by Kim Chuan Lim
Item(Local ): Usage Minimum, data= [
0x01 ] 1
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
(null)
Item(Local ): Usage Maximum, data= [
0x40 ] 64
Post by Kim Chuan Lim
Post by Charles Lepple
Post by Kim Chuan Lim
(null)
The hid_dump_tree() function does not properly
print the trace for
Post by Kim Chuan Lim
Post by Charles Lepple
a range
of Usage IDs. So your "Usage Path" in
libhid would probably look
Post by Kim Chuan Lim
Post by Charles Lepple
something
like { 0xffff0001, 0xffff0001 } through {
0xffff0001, 0xffff0040 }.
Post by Kim Chuan Lim
Post by Charles Lepple
--
Charles Lepple
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
--
Charles Lepple
clepple at ghz.cc
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
Charles Lepple
2008-08-20 00:08:21 UTC
Permalink
Post by amruth
I am trying to use libhid for my device. I found out that libhid is
not compatible to latest libusb-1.0.
I tried to compile and build using the latest libusb library, but I
seeing lot of errors during building.
libhid is only known to work with libusb-0.1 at this time.
--
Charles Lepple
Peter Stuge
2008-08-28 03:01:13 UTC
Permalink
Post by Charles Lepple
Post by amruth
I am trying to use libhid for my device. I found out that libhid is
not compatible to latest libusb-1.0.
I tried to compile and build using the latest libusb library, but I
seeing lot of errors during building.
libhid is only known to work with libusb-0.1 at this time.
Note that there is libusb-compat-0.1 which you can use for backwards
compatibility with libusb-1.0. It should allow you to build libhid
without problems. If it does not, please send details to the libusb
mailing list.

Thanks!


//Peter

amruth
2008-08-20 00:51:31 UTC
Permalink
Thanks Charles for the info.
Any idea about broken pipe error.
I see hid working perfectly until 2.6.25.15 but broken in 2.6.26
I have also observed some of my applications is broken in 2.6.26 kernel.
I know that until 2.6.25.15 everything works but broken afterwards.
Is this API changed anyway in 2.26.2 or the bytes reading is changed
This call is being done in hid_preparation.c

byte const BUFLEN = 9;
#define USB_TIMEOUT 10000
#define USB_ENDPOINT_IN 0x80

int len = usb_control_msg(hidif->dev_handle,
USB_ENDPOINT_IN+1,
USB_REQ_GET_DESCRIPTOR,
(USB_DT_HID << 8) + 0, hidif->interface,
(char*)buffer, BUFLEN,
USB_TIMEOUT);

I get broken pipe error when I tried to get descriptors.
hid_force_open failed
TRACE: hid_prepare_hid_descriptor(): retrieving HID descriptor for USB
device 001/002[0]...
USB error: error sending control message: Broken pipe
Can anybody please let me know what has changed in 2.6.26 kernel.

Thanks
Amruth p.v
From: Charles Lepple <clepple at ghz.cc>
Subject: Re: [libhid-discuss] libhid broken in 2.6.26 kernel works in 2.6.25.15
To: amruth_pv at yahoo.com
Cc: "libhid-discuss List" <libhid-discuss at lists.alioth.debian.org>
Date: Tuesday, August 19, 2008, 7:08 PM
Post by amruth
I am trying to use libhid for my device. I found out
that libhid is
Post by amruth
not compatible to latest libusb-1.0.
I tried to compile and build using the latest libusb
library, but I
Post by amruth
seeing lot of errors during building.
libhid is only known to work with libusb-0.1 at this time.
--
Charles Lepple
Loading...