Discussion:
[libhid-discuss] Windows support?
Adrian Parker
2008-03-27 11:33:06 UTC
Permalink
Hello all,

I read in the libhid docs, "aims to support all operating system supported
by libusb: Linux, BSD, OS X, and Windows".

This seems to say that libusb supports Windows. But libusb doesn't seem to
support Windows (http://libusb.sourceforge.net/doc/intro-support.html).

I note that neither libusb or libhid includes the text "windows.h" anywhere
in their sources, so I suspect this is further indication that neither
libhid or libusb supports Windows?
--
Adrian Parker
Simulation Software Developer
DLCSPM 6 Simulation
Building A31, CFB Kingston

Tel: (613) 541-5010 x3020
CSN: 271-3020
Email: parker at lsec.dnd.ca
Xiaofan Chen
2008-03-27 11:57:45 UTC
Permalink
On Thu, Mar 27, 2008 at 7:33 PM, Adrian Parker
Post by Adrian Parker
This seems to say that libusb supports Windows. But libusb doesn't seem to
support Windows (http://libusb.sourceforge.net/doc/intro-support.html).
libusb-win32 is a separate project than libusb.
http://libusb-win32.wiki.sourceforge.net/

Xiaofan
Adrian Parker
2008-03-27 12:01:53 UTC
Permalink
So libhid will work with libusb-win32, just as it would with libusb?

I shall try that today. Thank you.


Adrian



On Thu, Mar 27, 2008 at 7:52 AM, Albert Lee <trisk+alioth at acm.jhu.edu>
There's more than one libusb implementation; libhid also works on
Solaris, which has its own libusb, for example.
Linux, FreeBSD, NetBSD, OpenBSD, Darwin, MacOS X (and Windows through
the libusb-win32 project)."
The only OS specific code that I know of in libhid is the bit that
requests an existing driver to detach, and afaik all implementations use
the same libhid-based code right now which is portable.
-Albert
Post by Adrian Parker
Hello all,
I read in the libhid docs, "aims to support all operating system
supported
Post by Adrian Parker
by libusb: Linux, BSD, OS X, and Windows".
This seems to say that libusb supports Windows. But libusb doesn't seem
to
Post by Adrian Parker
support Windows (http://libusb.sourceforge.net/doc/intro-support.html).
I note that neither libusb or libhid includes the text "windows.h"
anywhere
Post by Adrian Parker
in their sources, so I suspect this is further indication that neither
libhid or libusb supports Windows?
--
Adrian Parker
Simulation Software Developer
DLCSPM 6 Simulation
Building A31, CFB Kingston

Tel: (613) 541-5010 x3020
CSN: 271-3020
Email: parker at lsec.dnd.ca
Xiaofan Chen
2008-03-27 12:06:54 UTC
Permalink
On Thu, Mar 27, 2008 at 8:01 PM, Adrian Parker
Post by Adrian Parker
So libhid will work with libusb-win32, just as it would with libusb?
I shall try that today. Thank you.
Unfortunately not.

Xiaofan
Adrian Parker
2008-03-27 12:11:56 UTC
Permalink
I'm confused. libhid supports Windows, the website says it do so by using
libusb. libusb's site seems to say it doesn't support Windows, but
libusb-win32 does.

And Xiaofan seems seems to say that libhid doesn't work with libusb-win32.

Can someone tell me how I would use libhid under Windows (what does it
depend on that WILL work under windows)?


Adrian
Post by Xiaofan Chen
On Thu, Mar 27, 2008 at 8:01 PM, Adrian Parker
Post by Adrian Parker
So libhid will work with libusb-win32, just as it would with libusb?
I shall try that today. Thank you.
Unfortunately not.
Xiaofan
Xiaofan Chen
2008-03-27 12:25:58 UTC
Permalink
On Thu, Mar 27, 2008 at 8:11 PM, Adrian Parker
Post by Adrian Parker
I'm confused. libhid supports Windows, the website says it do so by using
libusb. libusb's site seems to say it doesn't support Windows, but
libusb-win32 does.
libhid aims to support Windows. "aims to support" is quite a bit different
than "support".
Post by Adrian Parker
And Xiaofan seems seems to say that libhid doesn't work with libusb-win32.
Can someone tell me how I would use libhid under Windows (what does it
depend on that WILL work under windows)?
Hacking and testing. ;-)

The next version of libusb-win32 (under development) *aims to support*
native HID back end. So libhid may benefit from it.

Xiaofan
Xiaofan Chen
2008-03-27 13:12:37 UTC
Permalink
Post by Xiaofan Chen
Post by Adrian Parker
And Xiaofan seems seems to say that libhid doesn't work with libusb-win32.
Can someone tell me how I would use libhid under Windows (what does it
depend on that WILL work under windows)?
Hacking and testing. ;-)
The next version of libusb-win32 (under development) *aims to support*
native HID back end. So libhid may benefit from it.
Wait a moment, I remember someone has ported libhid to Win32
in libusb-win32 mailing list. You may want to contact him (Rob Krakora).
http://permalink.gmane.org/gmane.comp.lib.libusb.devel.windows/1476

Xiaofan
http://mcuee.blogspot.com
Charles Lepple
2008-03-27 15:38:54 UTC
Permalink
Post by Xiaofan Chen
Wait a moment, I remember someone has ported libhid to Win32
in libusb-win32 mailing list. You may want to contact him (Rob Krakora).
http://permalink.gmane.org/gmane.comp.lib.libusb.devel.windows/1476
Please post back to this list with your findings. I don't have a Windows
machine to test with, and nobody has really given me any concrete
suggestions on ways to patch libhid so that it will work with
libusb-win32.
--
Charles Lepple
Xiaofan Chen
2008-03-28 00:03:08 UTC
Permalink
Long post.
Post by Charles Lepple
Post by Xiaofan Chen
Wait a moment, I remember someone has ported libhid to Win32
in libusb-win32 mailing list. You may want to contact him (Rob Krakora).
http://permalink.gmane.org/gmane.comp.lib.libusb.devel.windows/1476
Please post back to this list with your findings. I don't have a Windows
machine to test with, and nobody has really given me any concrete
suggestions on ways to patch libhid so that it will work with
libusb-win32.
Ok, I got the source code and I an build it with the free Visual C++.Net
Express 2005.

I do not have a good HID device to test this port. Anyway, just running
the first example here. It seems to work.

G:\USB\libusb_winusb\libhidwin32\libhid-0.2.16\libhid\Debug>dir libhid.*
08/19/2007 03:36 PM 102,400 libhid.dll
08/19/2007 03:36 PM 403 libhid.dll.embed.manifest
08/19/2007 03:36 PM 468 libhid.dll.embed.manifest.res
08/19/2007 03:36 PM 385 libhid.dll.intermediate.manifest
08/19/2007 03:36 PM 3,613 libhid.exp
08/19/2007 03:36 PM 416,960 libhid.ilk
08/19/2007 03:36 PM 6,632 libhid.lib
08/19/2007 03:36 PM 478,208 libhid.pdb

G:\USB\libusb_winusb\libhidwin32\libhid-0.2.16\libhid\Debug>dir *.exe
08/06/2007 01:51 AM 40,960 test.exe
08/06/2007 01:51 AM 40,960 test2.exe

G:\USB\libusb_winusb\libhidwin32\libhid-0.2.16\libhid\Debug>test2
NOTICE_PRINT: hid_init(): libhid 0.2.16.0.0 is being initialized.
TRACE_PRINT: hid_init(): initialising USB subsystem...
TRACE_PRINT: hid_init(): scanning for USB busses...
TRACE_PRINT: hid_init(): scanning for USB devices...
NOTICE_PRINT: hid_init(): successfully initialised HID library.
TRACE_PRINT: hid_new_HIDInterface(): creating a new HIDInterface instance...
TRACE_PRINT: hid_force_open(): forcefully opening a device interface according
to matching criteria...
TRACE_PRINT: hid_get_usb_handle(): acquiring handle for a USB device...
TRACE_PRINT: hid_find_usb_device(): enumerating USB busses...
TRACE_PRINT: hid_find_usb_device(): enumerating USB devices on bus bus-0...
TRACE_PRINT: hid_find_usb_device(): inspecting USB device bus-0/\\.\libusb0-00
01--0x04d8-0...
TRACE_PRINT: hid_compare_usb_device(): comparing match specifications to USB d
evice...
TRACE_PRINT: hid_compare_usb_device(): inspecting vendor ID...
TRACE_PRINT: hid_compare_usb_device(): no match on vendor ID.
TRACE_PRINT: hid_compare_usb_device(): inspecting product ID...
TRACE_PRINT: hid_compare_usb_device(): no match on product ID.
TRACE_PRINT: hid_compare_usb_device(): no custom matching function supplied.
NOTICE_PRINT: hid_find_usb_device(): vendor 0x04d8 of USB device bus-0/\\.\libu
sb0-0001--0x04d8-0 does not match 0x05ac.
WARNING_PRINT: hid_find_usb_device(): no matching USB device found.
hid_force_open failed with return code 7

G:\USB\libusb_winusb\libhidwin32\libhid-0.2.16\libhid\Debug>test
NOTICE_PRINT: hid_init(): libhid 0.2.16.0.0 is being initialized.
TRACE_PRINT: hid_init(): initialising USB subsystem...
TRACE_PRINT: hid_init(): scanning for USB busses...
TRACE_PRINT: hid_init(): scanning for USB devices...
NOTICE_PRINT: hid_init(): successfully initialised HID library.
TRACE_PRINT: hid_new_HIDInterface(): creating a new HIDInterface instance...
TRACE_PRINT: hid_force_open(): forcefully opening a device interface according
to matching criteria...
TRACE_PRINT: hid_get_usb_handle(): acquiring handle for a USB device...
TRACE_PRINT: hid_find_usb_device(): enumerating USB busses...
TRACE_PRINT: hid_find_usb_device(): enumerating USB devices on bus bus-0...
TRACE_PRINT: hid_find_usb_device(): inspecting USB device bus-0/\\.\libusb0-00
01--0x04d8-0...
TRACE_PRINT: hid_compare_usb_device(): comparing match specifications to USB d
evice...
TRACE_PRINT: hid_compare_usb_device(): inspecting vendor ID...
TRACE_PRINT: hid_compare_usb_device(): match on vendor ID: 0x04d8.
TRACE_PRINT: hid_compare_usb_device(): inspecting product ID...
TRACE_PRINT: hid_compare_usb_device(): match on product ID: 0x0033.
TRACE_PRINT: hid_compare_usb_device(): calling custom matching function...
TRACE_PRINT: hid_compare_usb_device(): match on custom matching function.
NOTICE_PRINT: hid_find_usb_device(): found a matching USB device bus-0/\\.\libu
sb0-0001--0x04d8-0.
TRACE_PRINT: hid_force_open(): claiming USB device bus-0/\\.\libusb0-0001--0x0
4d8-0.
WARNING_PRINT: hid_os_force_claim(): code not tested on the Darwin platform!
TRACE_PRINT: hid_os_force_claim(): claiming USB device bus-0/\\.\libusb0-0001-
-0x04d8-0...
WARNING_PRINT: hid_os_force_claim(): failed to claim USB device bus-0/\\.\libusb
0-0001--0x04d8-0...
NOTICE_PRINT: hid_force_open(): successfully claimed USB device bus-0/\\.\libus
b0-0001--0x04d8-0.
TRACE_PRINT: hid_init_parser(): initialising the HID parser for USB Device bus
-0/\\.\libusb0-0001--0x04d8-0...
TRACE_PRINT: hid_init_parser(): allocating space for HIDData structure...
TRACE_PRINT: hid_init_parser(): successfully allocated memory for HIDData strc
ture.
TRACE_PRINT: hid_init_parser(): allocating space for HIDParser structure...
TRACE_PRINT: hid_init_parser(): successfully allocated memory for HIDParser st
rcture.
NOTICE_PRINT: hid_init_parser(): successfully initialised the HID parser for US
B Device bus-0/\\.\libusb0-0001--0x04d8-0??
TRACE_PRINT: hid_prepare_hid_descriptor(): initialising the HID descriptor for
USB device bus-0/\\.\libusb0-0001--0x04d8-0??..
TRACE_PRINT: hid_prepare_hid_descriptor(): retrieving HID descriptor for USB d
evice bus-0/\\.\libusb0-0001--0x04d8-0??..
NOTICE_PRINT: hid_prepare_hid_descriptor(): successfully initialised HID descri
ptor for USB device bus-0/\\.\libusb0-0001--0x04d8-0??(12928 bytes).
TRACE_PRINT: hid_prepare_report_descriptor(): initialising the report descript
or for USB device bus-0/\\.\libusb0-0001--0x04d8-0??..
ERROR: hid_prepare_report_descriptor(): report descriptor size for USB device
bus-0/\\.\libusb0-0001--0x04d8-0??exceeds maximum size: 12928 > 6144.

TRACE_PRINT: hid_close(): closing USB device bus-0/\\.\libusb0-0001--0x04d8-0?
?..
TRACE_PRINT: hid_close(): releasing USB device bus-0/\\.\libusb0-0001--0x04d8-
0??..
WARNING_PRINT: hid_close(): failed to release USB device bus-0/\\.\libusb0-0001-
-0x04d8-0??
TRACE_PRINT: hid_close(): closing handle of USB device bus-0/\\.\libusb0-0001-
-0x04d8-0??..
NOTICE_PRINT: hid_close(): successfully closed USB device bus-0/\\.\libusb0-000
1--0x04d8-0??
TRACE_PRINT: hid_reset_parser(): resetting the HID parser for USB device bus-0
/\\.\libusb0-0001--0x04d8-0??..
TRACE_PRINT: hid_close(): freeing memory allocated for HID parser...
TRACE_PRINT: hid_close(): resetting HIDInterface...
************************************************************************
ERROR: hid_write_identification(): cannot write identification of unopened HID
interface.
WARNING_PRINT: hid_close(): attempt to close unopened USB device .
TRACE_PRINT: hid_close(): freeing memory allocated for HID parser...
TRACE_PRINT: hid_close(): resetting HIDInterface...
TRACE_PRINT: hid_force_open(): forcefully opening a device interface according
to matching criteria...
TRACE_PRINT: hid_get_usb_handle(): acquiring handle for a USB device...
TRACE_PRINT: hid_find_usb_device(): enumerating USB busses...
TRACE_PRINT: hid_find_usb_device(): enumerating USB devices on bus bus-0...
TRACE_PRINT: hid_find_usb_device(): inspecting USB device bus-0/\\.\libusb0-00
01--0x04d8-0...
TRACE_PRINT: hid_compare_usb_device(): comparing match specifications to USB d
evice...
TRACE_PRINT: hid_compare_usb_device(): inspecting vendor ID...
TRACE_PRINT: hid_compare_usb_device(): match on vendor ID: 0x04d8.
TRACE_PRINT: hid_compare_usb_device(): inspecting product ID...
TRACE_PRINT: hid_compare_usb_device(): match on product ID: 0x0033.
TRACE_PRINT: hid_compare_usb_device(): calling custom matching function...
TRACE_PRINT: hid_compare_usb_device(): no match on custom matching function.
NOTICE_PRINT: hid_find_usb_device(): custom matching function returned false on
bus-0/\\.\libusb0-0001--0x04d8-0.
WARNING_PRINT: hid_find_usb_device(): no matching USB device found.
NOTICE_PRINT: hid_cleanup(): successfully deinitialised HID library.

The HID device is PICkit 2 (http://www.microchip.com/pickit2). I am
using the libusb-win32 device driver.

Xiaofan











Xiaofan
comicinker
2008-09-06 07:53:57 UTC
Permalink
How did you manage to compile libhid?

I'm using Visual Studio 2005. I receive 240 Errors. I included a
config.h from Linux, but that doesn't make sense at all. See the
attached files.

Bests,

C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.h
Type: text/x-csrc
Size: 2774 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20080906/af3c5bac/attachment-0001.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: errors.txt
Type: text/x-vhdl
Size: 79115 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20080906/af3c5bac/attachment-0001.bin
Charles Lepple
2008-09-06 13:54:43 UTC
Permalink
Post by comicinker
How did you manage to compile libhid?
I'm using Visual Studio 2005. I receive 240 Errors. I included a
config.h from Linux, but that doesn't make sense at all. See the
attached files.
I don't have a Windows machine to test this with, but you may get a
little bit more help from others on the list if you temporarily set
the system language to English, then post that build log. Please
compress the log as well (gzip or pkzip).

It looks like the ERROR() definition is conflicting with something in
wingdi.h:

c:\dokumente und einstellungen\simeon\eigene dateien\projects\libhid
\libhid\include\debug.h(21) : warning C4005: 'ERROR': Makro-
Neudefinition
c:\programme\microsoft visual studio 8\vc\platformsdk\include
\wingdi.h(98): Siehe vorherige Definition von 'ERROR'

I'm not sure which would take longer for me, installing Windows then
downloading all of Visual Studio Express and the platform SDK, or
learning enough German to decipher that log file :-)
--
Charles Lepple
Peter Stuge
2008-09-07 01:39:04 UTC
Permalink
Post by Charles Lepple
It looks like the ERROR() definition is conflicting with something
Spot on.
Post by Charles Lepple
c:\dokumente und einstellungen\simeon\eigene dateien\projects\libhid
\libhid\include\debug.h(21) : warning C4005: 'ERROR': Makro-
Neudefinition
Preprocessor macro redefined.

neu == new
Post by Charles Lepple
c:\programme\microsoft visual studio 8\vc\platformsdk\include
\wingdi.h(98): Siehe vorherige Definition von 'ERROR'
This is the previous definition of ERROR.

"See previous definition of 'ERROR'"


//Peter
comicinker
2008-09-07 12:07:33 UTC
Permalink
Peter, thanks for the translations.

Sorry for the German version, I thought with this amount of errors,
there must be a small problem in the very beginning and is easy to
solve.

I attached now the MSVC errors in almost complete English. I also
attached the config.h which I am using now, with some explanations
added.

As I said, I just added some header files to the paths, which I
arbitrarily copied from different systems and programs (see comments in
config.h), however, some need also the libraries for the OS, so it is
basically nonsense what I did. That's why I need some help, as I don't
know how to provide all the needed declarations and definitions.

Thanks in advance,


C
Post by Charles Lepple
Post by comicinker
How did you manage to compile libhid?
I'm using Visual Studio 2005. I receive 240 Errors. I included a
config.h from Linux, but that doesn't make sense at all. See the
attached files.
I don't have a Windows machine to test this with, but you may get a
little bit more help from others on the list if you temporarily set
the system language to English, then post that build log. Please
compress the log as well (gzip or pkzip).
It looks like the ERROR() definition is conflicting with something in
c:\dokumente und einstellungen\simeon\eigene dateien\projects\libhid
\libhid\include\debug.h(21) : warning C4005: 'ERROR': Makro-
Neudefinition
c:\programme\microsoft visual studio 8\vc\platformsdk\include
\wingdi.h(98): Siehe vorherige Definition von 'ERROR'
I'm not sure which would take longer for me, installing Windows then
downloading all of Visual Studio Express and the platform SDK, or
learning enough German to decipher that log file :-)
Charles Lepple
2008-09-07 13:06:44 UTC
Permalink
Post by comicinker
As I said, I just added some header files to the paths, which I
arbitrarily copied from different systems and programs (see
comments in
config.h), however, some need also the libraries for the OS, so it is
basically nonsense what I did. That's why I need some help, as I don't
know how to provide all the needed declarations and definitions.
One other thing that will cause problems down the road is that
"bsd.c", "darwin.c" and "linux.c" all define "hid_os_force_claim()".

For now, I would suggest copying "bsd.c" or "darwin.c" to "win32.c",
assuming that libusb-win32 does not provide
"usb_detach_kernel_driver_np()". Then, include "win32.c" in the
project, and make sure that the other OS-specific files ("bsd.c",
"darwin.c" and "linux.c") are excluded.
--
Charles Lepple
comicinker
2008-09-07 15:09:02 UTC
Permalink
Forgotten zip file. Sorry for traffic...
Charles Lepple
2008-09-07 19:49:17 UTC
Permalink
Post by comicinker
Forgotten zip file. Sorry for traffic...
Looks like something on Alioth, actually. If the gzipped attachment
doesn't make it through, then I am stumped. (The config.h is small
enough to send as-is.)
--
Charles Lepple
Charles Lepple
2008-09-07 20:35:15 UTC
Permalink
Let's try this again.

comicinker, looks like the config.h that you sent is really an
unchanged copy of include/hid.h
From: Charles Lepple <clepple at ghz.cc>
Date: September 7, 2008 3:49:17 PM EDT
To: comicinker <comicinker at gmx.de>
Cc: libhid-discuss at lists.alioth.debian.org
Subject: Re: [libhid-discuss] Windows support?
Post by comicinker
Forgotten zip file. Sorry for traffic...
Looks like something on Alioth, actually. If the gzipped attachment
doesn't make it through, then I am stumped. (The config.h is small
enough to send as-is.)
--
Charles Lepple
-------------- next part --------------
--
Charles Lepple
clepple at ghz.cc
Albert Lee
2008-03-27 11:52:48 UTC
Permalink
There's more than one libusb implementation; libhid also works on
Solaris, which has its own libusb, for example.

If you see the libusb home page, it says "Supported operating systems:
Linux, FreeBSD, NetBSD, OpenBSD, Darwin, MacOS X (and Windows through
the libusb-win32 project)."


The only OS specific code that I know of in libhid is the bit that
requests an existing driver to detach, and afaik all implementations use
the same libhid-based code right now which is portable.

-Albert
Post by Adrian Parker
Hello all,
I read in the libhid docs, "aims to support all operating system supported
by libusb: Linux, BSD, OS X, and Windows".
This seems to say that libusb supports Windows. But libusb doesn't seem to
support Windows (http://libusb.sourceforge.net/doc/intro-support.html).
I note that neither libusb or libhid includes the text "windows.h" anywhere
in their sources, so I suspect this is further indication that neither
libhid or libusb supports Windows?
alfredo alvarez
2008-03-28 02:13:30 UTC
Permalink
So i'm again getting the broken pipe message this time is actually the device for my project. I managed to read the data from a normal logitech mouse. My device also works like a mouse. Thanks for the earlier help if we manage to make the entire project work ill toss a link to our wiki so you can see.

lsusb Output:

Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x04d8 Microchip Technology, Inc.
idProduct 0x000f
bcdDevice 0.01
iManufacturer 1 Microchip Technology Inc.
iProduct 2 Mouse To a Circle Demo
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.01
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 50
Report Descriptor: (length is 50)
Item(Global): Usage Page, data= [ 0x01 ] 1
Generic Desktop Controls
Item(Local ): Usage, data= [ 0x02 ] 2
Mouse
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Local ): Usage, data= [ 0x01 ] 1
Pointer
Item(Main ): Collection, data= [ 0x00 ] 0
Physical
Item(Global): Usage Page, data= [ 0x09 ] 9
Buttons
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
Button 1 (Primary)
Item(Local ): Usage Maximum, data= [ 0x03 ] 3
Button 3 (Tertiary)
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0x01 ] 1
Item(Global): Report Count, data= [ 0x03 ] 3
Item(Global): Report Size, data= [ 0x01 ] 1
Item(Main ): Input, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Global): Report Count, data= [ 0x01 ] 1
Item(Global): Report Size, data= [ 0x05 ] 5
Item(Main ): Input, data= [ 0x01 ] 1
Constant Array Absolute No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Global): Usage Page, data= [ 0x01 ] 1
Generic Desktop Controls
Item(Local ): Usage, data= [ 0x30 ] 48
Direction-X
Item(Local ): Usage, data= [ 0x31 ] 49
Direction-Y
Item(Global): Logical Minimum, data= [ 0x81 ] 129
Item(Global): Logical Maximum, data= [ 0x7f ] 127
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Report Count, data= [ 0x02 ] 2
Item(Main ): Input, data= [ 0x06 ] 6
Data Variable Relative No_Wrap Linear
Preferred_State No_Null_Position Non_Volatile Bitfield
Item(Main ): End Collection, data=none
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 0x0003 1x 3 bytes
bInterval 10
Device Status: 0x0001
Self Powered

Code:
unsigned char packet[RECV_PACKET_LEN];
int pathlen = 3;
/*! \brief this is the number of bytes in the report */
int RECV_PACKET_LEN = 3;
/*! \brief this is the actual path */
int PATH_OUT[PATHLEN] = { 0x00010002, 0x00010001, 0x00010031 };
int i = 0;
for(i = 0; i <1; i++)
{
getPackets(packet);
/**This line is for debugging purposes value 1 is for movement in x and 2 for movement in Y*/
printf("Movement in x: %d Movement in y: %d " , packet[1] , packet[2]);
printf("\n");
sleep(1);
}
void getPackets(char* const packet)
{
ret = hid_get_input_report(hid, PATH_OUT, pathlen, packet, RECV_PACKET_LEN);
if (ret != HID_RET_SUCCESS) {
fprintf(stderr, "hid_get_input_report failed with return code %d\n", ret);
}
}




---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
Charles Lepple
2008-03-29 01:07:36 UTC
Permalink
Post by alfredo alvarez
So i'm again getting the broken pipe message this time is actually
the device for my project.
Can you send the exact error message?

Note that depending on what error code you are seeing, it may be a
problem with the firmware (e.g. it does not support the transfer in
hid_get_input_report().)
--
Charles Lepple
alfredo alvarez
2008-03-31 15:57:12 UTC
Permalink
Here is the output from a run of my program it includes the error i also wanted to mention that the program ( firmaware) actually gets detected by my machine and runs with the normal windows driver fine. but when i try to use it to get a report i can't. If it is the firmware anywhere i can get a working example or someone i can talk to ?

NOTICE: hid_init(): libhid 0.2.15+20060325.0.0 is being initialized.
NOTICE: hid_init(): successfully initialised HID library.
NOTICE: hid_find_usb_device(): vendor 0x0000 of USB device 004/001[0] does not match 0x04d8.
NOTICE: hid_find_usb_device(): vendor 0x0000 of USB device 003/001[0] does not match 0x04d8.
NOTICE: hid_find_usb_device(): vendor 0x0000 of USB device 001/001[0] does not match 0x04d8.
NOTICE: hid_find_usb_device(): found a matching USB device 002/002[0].
NOTICE: hid_force_open(): successfully claimed USB device 002/002[0].
NOTICE: hid_init_parser(): successfully initialised the HID parser for USB Device 002/002[0].
NOTICE: hid_prepare_hid_descriptor(): successfully initialised HID descriptor for USB device 002/002[0] (50 bytes).
NOTICE: hid_prepare_report_descriptor(): successfully initialised report descriptor for USB device 002/002[0].
NOTICE: hid_prepare_parser(): successfully set up the HID parser for USB device 002/002[0].
NOTICE: hid_force_open(): successfully opened USB device 002/002[0].
device identification of HIDInterface 002/002[0]:
dev_handle: 0x0804b188
device: 0x080541f8
location: 002/002
manufacturer: Microchip Technology Inc.
product: Mouse To a Circle Demo
parse tree of HIDInterface 002/002[0]:
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00010030; type: 0x80
path: 0x00010002.0x00010001.0x00010031; type: 0x80
NOTICE: hid_find_object(): found requested item.
WARNING: hid_get_input_report(): failed to retrieve report from USB device 002/002[0]:error sending control message: Broken pipe.
hid_get_input_report failed with return code 20
Movement in x: 0 Movement in y: 0
NOTICE: hid_close(): successfully closed USB device 002/002[0].
NOTICE: hid_cleanup(): successfully deinitialised HID library.
Post by alfredo alvarez
So i'm again getting the broken pipe message this time is actually
the device for my project.
Can you send the exact error message?

Note that depending on what error code you are seeing, it may be a
problem with the firmware (e.g. it does not support the transfer in
hid_get_input_report().)
--
Charles Lepple






---------------------------------
Special deal for Yahoo! users & friends - No Cost. Get a month of Blockbuster Total Access now
alfredo alvarez
2008-03-31 15:57:12 UTC
Permalink
Here is the output from a run of my program it includes the error i also wanted to mention that the program ( firmaware) actually gets detected by my machine and runs with the normal windows driver fine. but when i try to use it to get a report i can't. If it is the firmware anywhere i can get a working example or someone i can talk to ?

NOTICE: hid_init(): libhid 0.2.15+20060325.0.0 is being initialized.
NOTICE: hid_init(): successfully initialised HID library.
NOTICE: hid_find_usb_device(): vendor 0x0000 of USB device 004/001[0] does not match 0x04d8.
NOTICE: hid_find_usb_device(): vendor 0x0000 of USB device 003/001[0] does not match 0x04d8.
NOTICE: hid_find_usb_device(): vendor 0x0000 of USB device 001/001[0] does not match 0x04d8.
NOTICE: hid_find_usb_device(): found a matching USB device 002/002[0].
NOTICE: hid_force_open(): successfully claimed USB device 002/002[0].
NOTICE: hid_init_parser(): successfully initialised the HID parser for USB Device 002/002[0].
NOTICE: hid_prepare_hid_descriptor(): successfully initialised HID descriptor for USB device 002/002[0] (50 bytes).
NOTICE: hid_prepare_report_descriptor(): successfully initialised report descriptor for USB device 002/002[0].
NOTICE: hid_prepare_parser(): successfully set up the HID parser for USB device 002/002[0].
NOTICE: hid_force_open(): successfully opened USB device 002/002[0].
device identification of HIDInterface 002/002[0]:
dev_handle: 0x0804b188
device: 0x080541f8
location: 002/002
manufacturer: Microchip Technology Inc.
product: Mouse To a Circle Demo
parse tree of HIDInterface 002/002[0]:
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00000000; type: 0x80
path: 0x00010002.0x00010001.0x00010030; type: 0x80
path: 0x00010002.0x00010001.0x00010031; type: 0x80
NOTICE: hid_find_object(): found requested item.
WARNING: hid_get_input_report(): failed to retrieve report from USB device 002/002[0]:error sending control message: Broken pipe.
hid_get_input_report failed with return code 20
Movement in x: 0 Movement in y: 0
NOTICE: hid_close(): successfully closed USB device 002/002[0].
NOTICE: hid_cleanup(): successfully deinitialised HID library.
Post by alfredo alvarez
So i'm again getting the broken pipe message this time is actually
the device for my project.
Can you send the exact error message?

Note that depending on what error code you are seeing, it may be a
problem with the firmware (e.g. it does not support the transfer in
hid_get_input_report().)
--
Charles Lepple






---------------------------------
Special deal for Yahoo! users & friends - No Cost. Get a month of Blockbuster Total Access now
alfredo alvarez
2008-04-09 17:30:33 UTC
Permalink
So basically i kept looking into this and found that this threat has the same problem
http://ailab.ch/pipermail/libhid-discuss/2006-May/000927.html i was wondering if you guys had found a resolution for it and not posted the answer thank you.
Alfredo Alvarez
Post by alfredo alvarez
So i'm again getting the broken pipe message this time is actually
the device for my project.
Can you send the exact error message?

Note that depending on what error code you are seeing, it may be a
problem with the firmware (e.g. it does not support the transfer in
hid_get_input_report().)
--
Charles Lepple





__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Loading...