[libhid-discuss] moving from hiddev/ioctl to libhid

shiva vadla shiva473 at gmail.com
Tue Dec 21 15:40:31 UTC 2010


Hey Andreas,
Did you try using the path {0xffa00001,0xffa00002,0xffa10006}?
Thanks!

On Tue, Dec 21, 2010 at 7:30 AM, Andreas Holzhammer - GMX <
andreas.holzhammer at gmx.de> wrote:

> Hi,
>
> I'm trying to adapt a USB LCD driver (graphlcd, dm140gink) from using
> direct ioctls to a libhid based solution.
>
> Unfortunately I can't get the dm140gink to accept the data I send. The
> original driver can be found at
> http://developer.berlios.de/patch/download.php?id=2627.
>
> I've modified test_libhid.c to access my LCD display, and get the following
> paths:
>
> device identification of HIDInterface 002/004[0]:
>  dev_handle:    0x09a50580
>  device:        0x09a4b178
>  location:      002/004
>  manufacturer:  DM-140GINK Demo
>  product:       DM-140GINK Demo
>  TRACE: hid_reset_parser(): resetting the HID parser for USB device
> 002/004[0]...
>  TRACE: hid_dump_tree(): iterating the parse tree for USB device
> 002/004[0]...
> parse tree of HIDInterface 002/004[0]:
>  path: 0xffa00001.0xffa00002.0xffa10003; type: 0x80
>  path: 0xffa00001.0xffa00002.0xffa10004; type: 0x80
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x80
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x80
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x80
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x80
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x80
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x80
>  path: 0xffa00001.0xffa00002.0xffa10005; type: 0x90
>  path: 0xffa00001.0xffa00002.0xffa10006; type: 0x90
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x90
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x90
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x90
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x90
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x90
>  path: 0xffa00001.0xffa00002.0x00000000; type: 0x90
>  TRACE: hid_reset_parser(): resetting the HID parser for USB device
> 002/004[0]...
>
> Then I added a first output command to test_libhid.c to send the the first
> initialisation command (taken from the above source, "panelCmd") to the
> device:
>
>   unsigned char const PATHLEN = 3;
>   int const PATH_IN[] = { 0xffa00001, 0xffa00002, 0xffa10003 };
>   int const PATH_OUT[] = { 0xffa00001, 0xffa00002, 0xffa10005 };
>   unsigned char const SEND_PACKET_LEN = 8;
>   char const PACKET[]  = {0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00};
>   ret = hid_set_output_report(hid, PATH_OUT, PATHLEN, PACKET,
> SEND_PACKET_LEN);
>   if (ret != HID_RET_SUCCESS) {
>     fprintf(stderr, "hid_set_output_report failed with return code %d\n",
> ret);
>   }
>
> But this command times out:
>
>  TRACE: hid_set_output_report(): looking up report ID...
>  TRACE: hid_prepare_parse_path(): preparing search path of depth 3 for
> parse tree of USB device 002/004[0]...
>  TRACE: hid_prepare_parse_path(): search path prepared for parse tree of
> USB device 002/004[0].
>  NOTICE: hid_find_object(): found requested item.
>  TRACE: hid_set_output_report(): sending report ID 0x00 (length: 8) to USB
> device 002/004[0]...
> WARNING: hid_set_output_report(): failed to send report to USB device
> 002/004[0]:error sending control message: Connection timed out.
> hid_set_output_report failed with return code 19
>  TRACE: hid_close(): closing USB device 002/004[0]...
>
> I've also tried to only pass 0xffa10005 as PATH, as suggested in the
> original code (in the SendReport function).
>
> Not sure, but this might be related to the original drivers initialisation
> code, which I have no idea how to implement in libhid:
>    //******************************************************
>    // Initialize the internal report structures
>    //******************************************************
>    if(ioctl(fd, HIDIOCINITREPORT,0)<0)
>
> Unfortunaltey I don't have any documentation on the DM140gink device, so I
> have to rely on the existing graphlcd source code (which doesn't provide
> access to some of the features of the LCD).
>
> Any help greatly appreciated.
>
> Thanks,
>
> Andreas
>
> _______________________________________________
> libhid-discuss mailing list
> libhid-discuss at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
> http://libhid.alioth.debian.org/
>



-- 
Shiva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20101221/895ce8ab/attachment.htm>


More information about the libhid-discuss mailing list