Andrew Silverman | 25 Mar 04:10 2015
Picon

Trying to repair a program using libhid to configure an Ultimarc Joystick

Hi folks – question from newbie.

 

There is a piece of software that was written several years ago to allow Linux users to configure a USB joystick from Ultimarc.  The company has Windows specific tools but no formal support for Linux.

The tool relies on libhid and the libusb-compat libraries.  A recent firmware change for this joystick seems to have broken the current version of the Linux configuration tool and I am trying to get some help modifying it to work with this latest FW update.

 

The joystick is VID/PID d209:0511.  It exposes three separate endpoints, EP 2 IN (0x82) which is the two-axis joystick, EP 1 IN which allows the joystick to sometimes behave as a mouse, and then there is EP 3 IN (0x83) which is evidently the endpoint that needs to be written to in order to configure the stick.

 

The present version of the application is successful at finding and force_opening the device, but I have a suspicion that it may not be writing to the correct endpoint with this latest firmware release.  The stick manufacturer confirms that they used to use libusb under Windows, but with this latest release they use native Windows functionality to write to the HID device.  They also confirm that EP3 is where the data’s supposed to go.  However, they haven’t been entirely forthcoming with complete documentation of the vendor-specific protocol, but they claim no changes have been made in the actual data that needs to be transmitted to the device.


The existing version of the utility seems to rely on making calls to usb_control_msg() to actually send the data, but the behavior I see now with the latest firmware is that the line I’ve marked below with an arrow always fails with EPIPE, saying that the endpoint is stalled.  (I added some debug prints to my copy of the code to inspect the return values, which the original author was ignoring.)  Unfortunately I’m a little new to USB programming (at least at this level of detail) and am having a little difficulty in translating the calls the original author of the application (now unresponsive) is making into the commands in the USB spec, and therefore, what I would need to change in order to make a hopefully simple change to direct the traffic to endpoint EP 3, (if indeed that is the problem.)

 

I’ve included a snippet of the app below, please let me know if there’s something reasonably obvious I can change to ensure that the data goes to the correct endpoint, or whether there is potentially some other avenue of investigation I should be looking at.  I can always email the entire single source file (it’s not very long) if you need to see more, but I think this is really the relevant piece.  I don’t want to rewrite the whole app, I just want to get it basically functional again.  Thanks for any/all help!

 

// *********************Send Map Transfer*******************************

                                // This is only for Map Size = 9

                                //

                                // 3 "Data Write" Transfers of 32 Bytes

                                // -First Transfer-

                                // Byte[0] = 0x50 (Header)

                                // Byte[1] = 0x09 (Map Size?)

                                // Byte[2] = Restrictor (RestrictorOn = 0x09, RestrictorOff = 0x10)

                                // Byte[3]-Byte[10] = Map Border Location

                                // Byte[11]-Byte[31] = Mapping of Block Location. starting from topleft and read left to right.

                                //

                                // -Second Transfer-

                                // 32 Bytes - Continue Mapping of Block Location

                                //

                                // -Third Transfer-

                                // Byte[0]-Byte[27] - Continue Mapping of Block Location

                                // Byte[28]-Byte[30] - 0x00

                                // Byte[31] - (Write to Flash 0x00) (Write to RAM 0xFF, supported in Firmware 2.2)

                                //

                                //

                                // ****************************************************

                                // USB      Mapping

                                // 0x00 =   Analog (-)

                                // 0x01 =   Center (C)

                                // 0x02 =   Up (N)

                                // 0x03 =   UPRight (NE)

                                // 0x04 =   Right (E)

                                // 0x05 =   DownRight (SE)

                                // 0x06 =   Down (S)

                                // 0x07 =   DownLeft (SW)

                                // 0x08 =   Left (W)

                                // 0x09 =   UPLeft (NW)

                                // 0x0A =   Sticky (*)

                               

                                // MapFileFormatVersion=1.0

 

                                // MapSize=9

                                // MapBorderLocations=30,58,86,114,142,170,198,226

                                // MapRow1=W,W,W,C,C,C,E,E,E

                                // MapRow2=W,W,W,C,C,C,E,E,E

                                // MapRow3=W,W,W,C,C,C,E,E,E

                                // MapRow4=W,W,W,C,C,C,E,E,E

                                // MapRow5=W,W,W,C,C,C,E,E,E

                                // MapRow6=W,W,W,C,C,C,E,E,E

                                // MapRow7=W,W,W,C,C,C,E,E,E

                                // MapRow8=W,W,W,C,C,C,E,E,E

                                // MapRow9=W,W,W,C,C,C,E,E,E

 

                                if(arguments.rowcount == 9){

                               

                                                int usbret = usb_control_msg(hid->dev_handle,0x43,0xE9,0x0001, 0 , NULL, 0,1000);

                                                char data[32*3]; // 9*9 + 3 + 8 + 1 round up to nearest 32 block.

                                                memset(data,0,sizeof(data));

                                               

                                                data[0]  = 0x50; // Byte[0] = 0x50 (Header)

                                                data[1]  = 0x09; // Byte[1] = 0x09 (Map Size?)

                                                data[2] = ( arguments.restrictor ? 0x09 : 0x10 ); // Byte[2] = Restrictor (RestrictorOn = 0x09, RestrictorOff = 0x10)

                                                data[95] = ( arguments.flash ? 0x00 : 0xFF ); // Byte[31] - (Write to Flash 0x00) (Write to RAM 0xFF, supported in Firmware 2.2)

 

                                                if(arguments.border_set){

                                                                // Byte[3]-Byte[10] = Map Border Location

                                                                memcpy(&data[3],arguments.border,sizeof(arguments.border));

                                                }

                               

                                                memcpy(&data[11],arguments.matrix,9*9);

                                               

                                                for(int i=0;i<3;i++){

                                                                usbret = usb_control_msg(hid->dev_handle,0x43,0xEB,0x0000, 0 , data+(32*i), sizeof(data)/3,1000);

                                                               

This fails---------------->                  usbret = usb_control_msg(hid->dev_handle,0xC3,0xEA,0x0000, 0 , NULL, 0 ,1000);

                                                               

                                                }

                                               

                                                usbret = usb_control_msg(hid->dev_handle,0x43,0xE9,0x0000, 0 , NULL, 0,1000);

                                }

                }

_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Edgar Fuß | 13 Jan 19:11 2015
Picon

OS X build

src/Makefile uses -lIOKit, which doesn’t work on recent versions of OS X. It should be using -framework
IOKit instead.
On a related note, I don’t understand why it quotes CoreFoundation (on the same line).
_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Shen Chuan | 20 Aug 17:07 2014

Question about hid_force_open failed

Hello, 

Just installed libhid in the opensuse platform and running a c program to communicate with the card reader

i | libhidapi-devel   | Development libraries and header files for hidapi                   | package
i | libhidapi-hidraw0 | Simple library for communicating with USB and Bluetooth HID devices | package
i | libhidapi-libusb0 | Simple library for communicating with USB and Bluetooth HID devices | package

But when I run it, it always give me 13 error code. Not sure what it means, is there somewhere I can debug it?

hid_force_open failed with return code 13

Thank you for your help

Regards

Shen
Attachment (magtek.c): text/x-csrc, 9 KiB
_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Makoto Fujiwara | 10 Oct 02:37 2013
Picon

On DragonFlyBSD

Hi, I'm just subscribed to this list, thank you.

I'm packaging libhid on pkgsrc, Mainly-for-NetBSD-application-packing.
Pkgsrc also supports several operating systems, such that DragonFly BSD 
etc.

At packaging for DragonFly, I needed attached patch for libhid-0.2.16.

Just for your information, 
(Please ignore '== -> =' fix in file configure)

Thanks again,
---
Makoto Fujiwara, 
Chiba, Japan, Narita Airport and Disneyland prefecture.
----
$NetBSD$

(1)
ERROR: [check-portability.awk] => Found test ... == ...:
ERROR: [check-portability.awk] configure:               if test "$py_version" == "None"; then
(2)
Add DragonflyBSD

--- configure.orig	2007-04-26 09:25:25.000000000 +0900
+++ configure	2013-10-10 07:33:08.485190000 +0900
 <at>  <at>  -2757,7 +2757,7  <at>  <at>  _ACEOF
         { echo "$as_me:$LINENO: result: Linux" >&5
 echo "${ECHO_T}Linux" >&6; }
         ;;
-      *-freebsd*|*-openbsd*|*-netbsd*|*-k*bsd*-gnu)
+      *-freebsd*|*-openbsd*|*-netbsd*|*-k*bsd*-gnu|*-dragonfly*)

 cat >>confdefs.h <<\_ACEOF
 #define OS_BSD
 <at>  <at>  -22774,7 +22774,7  <at>  <at>  echo $ECHO_N "checking for Python librar
 		py_version=`$PYTHON -c "from distutils.sysconfig import *; \
 			from string import join; \
 			print join(get_config_vars('VERSION'))"`
-		if test "$py_version" == "None"; then
+		if test "$py_version" = "None"; then
 			if test -n "$PYTHON_VERSION"; then
 				py_version=$PYTHON_VERSION
 			else

$NetBSD$

lshid.c:32:87: error: parameter 'len' set but not used [-Werror=unused-but-set-parameter]

--- test/lshid.c.orig	2007-03-31 23:27:51.000000000 +0900
+++ test/lshid.c	2013-10-10 07:40:18.961805000 +0900
 <at>  <at>  -29,7 +29,7  <at>  <at>  char *hid_id[32]; /* FIXME: 32 devices M

 struct usb_dev_handle;

-bool device_iterator (struct usb_dev_handle const* usbdev, void* custom, unsigned int len)
+bool device_iterator (struct usb_dev_handle const* usbdev, void* custom __attribute((unused)),
unsigned int len __attribute((unused)))
 {
   bool ret = false;
   int i;
 <at>  <at>  -37,8 +37,10  <at>  <at>  bool device_iterator (struct usb_dev_han
   const struct usb_device *device = usb_device((struct usb_dev_handle *)usbdev);

   /* only here to prevent the unused warning */
+#if 0
   /* TODO remove */
   len = *((unsigned long*)custom);
+#endif

   /* Obtain the device's full path */
   //sprintf(current_dev_path, "%s/%s", usbdev->bus->dirname, usbdev->device->filename);

_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/

Vlatko Kosturjak | 26 Aug 11:00 2012
Picon

libhid gcc Werror patch

Hello,


This is patch for libhid so gcc doesn't stop on error if Werror is used: 

Problem:
======
gcc -DHAVE_CONFIG_H -I. -I..   -DNDEBUG -I../include -I../hidparser -O2 -Wall -W -Werror -MT lshid.o -MD -MP -MF .deps/lshid.Tpo -c -o lshid.o lshid.c
lshid.c: In function <E2><80><98>device_iterator<E2><80><99>:
lshid.c:32:87: error: parameter <E2><80><98>len<E2><80><99> set but not used [-Werror=unused-but-set-parameter]
cc1: all warnings being treated as errors

Patch:
=====
--- lshid.c 2012-08-26 10:54:29.671277650 +0200
+++ lshid.c.mod 2012-08-26 10:54:18.007988938 +0200
<at> <at> -29,6 +29,9 <at> <at>
 
 struct usb_dev_handle;
 
+/* unused parameter - don't give error on that warning */
+#pragma GCC diagnostic push 
+#pragma GCC diagnostic ignored "-Wunused-parameter"
 bool device_iterator (struct usb_dev_handle const* usbdev, void* custom, unsigned int len)
 {
   bool ret = false;
<at> <at> -36,10 +39,6 <at> <at>
   char current_dev_path[10];
   const struct usb_device *device = usb_device((struct usb_dev_handle *)usbdev);
   
-  /* only here to prevent the unused warning */
-  /* TODO remove */
-  len = *((unsigned long*)custom);
   /* Obtain the device's full path */
   //sprintf(current_dev_path, "%s/%s", usbdev->bus->dirname, usbdev->device->filename);
   sprintf(current_dev_path, "%s/%s", device->bus->dirname, device->filename);
<at> <at> -72,6 +71,7 <at> <at>
   
   return ret;
 }
+#pragma GCC diagnostic pop
 
 int main(void)
 {

Hope it helps,
--
Vlatko Kosturjak, Kost               
_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Florian Rittmeier | 25 Aug 12:27 2012
Picon

Compiling on Raspbian / Debian Wheezy

Hello,

I just wanted to share, that I had troubles compiling libhid 0.2.16 from 
the tarball on a RaspberryPi running Raspbian (Debian Wheezy).

The trouble was caused by a warning issued from compiling test/lshid.c 
during "make". The warning, which was treated as error, was caused by 
the parameter len which was detected as not beeing used. This seems to 
be known as there is some workaround in the device_iterator function in 
test/lshid.c which tries pretend that len is used.

I don`t know why this is a problem now and was not before. Perhaps the 
gcc is getting wiser. ;-) As a solution I added to following line right 
below the existing workaround:
if(len){}

The compiler accepted this, the warning does not get issued anymore and 
libhid was successfully build.

Regards,
Florian

Attachment (smime.p7s): application/pkcs7-signature, 6789 bytes
_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Andy Gair | 6 Aug 20:51 2012

libhid examples

I am looking for some examples on how to use “libhid” on windows 7 64bit. I have the source compiled and running, looking for examples on how to read/write a usb device, for testing I am trying to read my joystick.

 

Thanks

 

 

 

Andy Gair

Engineering Development Leader

2448 Destiny Way

Odessa

Florida 33556 USA

(727) 375-2520 x 105

 

_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Michael Sandford | 18 Jul 21:14 2012

Need help installing on Debian 6 (Squeeze)

Hi Folks,

I am trying to install libhid on debian 6 and running into some problems.

1.  Dependency on swig and libhid-dev not well outlined, but solved.
2.  Installs to /usr/local/lib/python2.6/site-packages which isn't on 
pythonpath, but also solved.
3.  When trying to use library, get one of two errors:

sandford <at> debian-test:~/item_entry/src$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import hid
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named hid
 >>>

So then I do this:
sandford <at> debian-test:~/item_entry/src$ export 
PYTHONPATH="$PYTHONPATH:/usr/local/lib/python2.6/site-packages/"
sandford <at> debian-test:~/item_entry/src$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import hid
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named hid
 >>> import libhid
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.6/site-packages/libhid/__init__.py", 
line 29, in <module>
     _hid = swig_import_helper()
   File "/usr/local/lib/python2.6/site-packages/libhid/__init__.py", 
line 25, in swig_import_helper
     _mod = imp.load_module('_hid', fp, pathname, description)
ImportError: libhid.so.0: cannot open shared object file: No such file 
or directory
 >>>

So then I do this:
sandford <at> debian-test:~/item_entry/src$ ls 
/usr/local/lib/python2.6/dist-packages/libhid/
_hid.a   hid.pyc  _hid.so.0      hidwrap.pyc  __init__.pyc
_hid.la  hid.pyo  _hid.so.0.0.0  hidwrap.pyo  __init__.pyo
hid.py   _hid.so  hidwrap.py     __init__.py
sandford <at> debian-test:~/item_entry/src$

Funnily enough, libhid.so.0 is not in that directory.  I am not really 
sure what is going wrong here but I could really use some help to get it 
installed at working.

Thanks,
Mike

_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/

Robert Warner | 9 May 23:39 2012
Picon

Configuration issue on SuSE 11.3

Hi,

How do I solve this issue?

Thanks in advance

checking for Python library path... /usr/lib64/python2.7/config/libpython2.7.so
checking for Python site-packages path... /usr/lib/python2.7/site-packages
checking python extra libraries...  -lpthread -ldl  -lutil
checking python extra linking flags... -Xlinker -export-dynamic
checking consistency of all components of python development environment... no
configure: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================
          
linux-q5yw:/usr/src/libhid-0.2.16/libhid-svn #
_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
Nelson Lombado | 23 Apr 07:31 2012
Picon

New library for LUA: lualibhid

Hi,
I'm Nelson from Argentina. In these days I'm working around a library 
for access to libhid in native way from LUA (script language). In this 
moment I can write the lshid example in a LUA script. This library is 
part of a bigger proyect that is developing. I want to thank for share 
your work.
Best regards.
-
Nelson

_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/

Daniel Yount | 14 Nov 11:46 2011
Picon

USB libhid is writing to PIC but errors out reading from it.

Using Linux 3.x kernel and debian 6.0 stable distro.

USB flash program 1.3
http://code.google.com/p/mphidflash/

libhid 0.2.16

I have installed a Generic HID bootloader  and a basic p18F2455 circuit setup for reading and writing USB data.
20mhz crystal no LEDs one jumper for bootloader mode and a switch for reset., nothing special. 

When I plug it in and use the "dmesg" commandline program I get.

[19195.480407] usb 1-1.2: reset full speed USB device number 6 using ehci_hcd
[19238.616399] usb 1-1.4: new full speed USB device number 50 using ehci_hcd
[19238.711891] usb 1-1.4: New USB device found, idVendor=2233, idProduct=7001
[19238.711900] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[19238.711907] usb 1-1.4: Product: Generic HID
[19238.711912] usb 1-1.4: Manufacturer: Test
[19238.714576] generic-usb 0003:2233:7001.000F: hiddev0,hidraw3: USB HID v1.11 Device [Test Generic HID] on usb-0000:00:13.5-1.4/input0

I type "lsusb -v" and get.

Bus 001 Device 050: ID 2233:7001 RadioShack Corporation
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x2233 RadioShack Corporation
  idProduct          0x7001
  bcdDevice            0.01
  iManufacturer           1 Test
  iProduct                2 Generic HID
  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      47
          Report Descriptor: (length is 47)
            Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440
                            (null)
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x03 ] 3
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x02 ] 2
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x04 ] 4
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x02 ] 2
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x05 ] 5
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x02 ] 2
            Item(Main  ): Feature, 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               1
      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               1
Device Status:     0x0000
  (Bus Powered)



Now this I had hacked around on mphidflsh to see if I could track it down.
./mphidflash -v 2233 -p 7001 -e

Turned on debugging and added some extra check points and I added data into the default buffer and added a second buffer to make sure it read it to a clean buffer. As you see the only data that is read back is one byte into the second buffer.Writing of the initial buffer gave no errors.

USB HID device found
Sending:
31 32 33 34 35 36 37 38 : 39 30 61 62 63 64 65 66 67 68 69 6a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

About To Write

Done Write

About to read into empty buffer
Done reading
Received:
31 59 00 00 00 00 00 00 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

./mphidflash Error: USB read error


Tracked the error down to this function in mphidflash. usb-linux.c

    if(HID_RET_SUCCESS != hid_interrupt_read(hid,0x81,usbBuf2,64,0))

What would cause libhid to return error on reading while writing is fine?


Daniel Yount












_______________________________________________
libhid-discuss mailing list
libhid-discuss <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/

Gmane