2004-01-04 05:23:25

by Alexander Holler

[permalink] [raw]
Subject: [Bluez-devel] Switching the Logitech-Hub

Hi,

I've now find a way to use hiddev for sending a report to the hub.

Using the patch from

http://sourceforge.net/mailarchive/forum.php?thread_id=3581364&forum_id=5398

the following works for sending reports:

----------------
int main(void)
{
char switch_sequence[] = {
0xff, 0x81, 0x80, 0x00, 0x00, 0x00
};
struct hiddev_report_info rinfo;
struct hiddev_usage_ref uref;
struct hiddev_field_info finfo;
int fd;
if ((fd = open("/dev/usb/hid/hiddev0", O_RDONLY)) <= 0) { // I have only
one hiddev
printf("error opening device\n");
return 1;
}
int rc=ioctl(fd, HIDIOCINITREPORT,0);
printf("rc: %d\n", rc);
if(rc)
perror(NULL);
int i;
for(i=0; i< 6; ++i ) {
memset( &uref, 0, sizeof(uref) );
uref.report_type = HID_REPORT_TYPE_OUTPUT;
uref.report_id = 0x10;
uref.field_index = 0;
uref.usage_index = i ;
uref.usage_code=0xff000001; // not used, just as beautifier
uref.value = switch_sequence[i];
rc=ioctl(fd, HIDIOCSUSAGE, &uref);
printf("rc: %d\n", rc);
if(rc)
perror(NULL);
}
memset( &rinfo, 0, sizeof(rinfo) );
rinfo.report_type = HID_REPORT_TYPE_OUTPUT;
rinfo.report_id = 0x10;
rinfo.num_fields = 1;
rc=ioctl(fd, HIDIOCSREPORT, &rinfo);
printf("rc: %d\n", rc);
if(rc)
perror(NULL);
close(fd);
return 0;
}
----------------

But the hub doesn't switch.

Using some debug-statements in hid-core.c, I see the following:

hid_submit_report
hid_submit_ctrl: 04 00 00 00 00 00 00
hid_submit_report
hid_submit_ctrl: 10 ffff ff81 ff80 00 00 00

This sequence will get send everytime I send one report using the above
program. The first ctrl comes from HIDIOCINITREPORT. I don't now if calling
the init is need, but I assume it doesn't break things.

Because the hub doesn't switch, it seems the report used (10 ff 81 80 00 00
00) is wrong.

I will test some other reports (or sequences of them), I could find in my
windows-log.

Regards,

Alexander



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2004-01-05 01:49:59

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] Switching the Logitech-Hub

Hi Alexander,

> I've got no comments, it's not surprising, it's just 8 hours on this list.
> But I also have looked through the sources and up to now, I don't see, why
> this should break other devices. And it seems there are some more people
> with the same problem. e.g.
> http://sourceforge.net/mailarchive/forum.php?thread_id=3345181&forum_id=5398
>
> I assume there are also some more who are wondering why sending reports
> using hiddev doesn't work. But not everyone will find the reason. Without
> your help, I wouldn't have find it too.
>
> As the author from the patch writes, it doesn't seem to interrest anyone
> from the usb-devels.

it is a good idea to repost a clean patch for 2.4 and 2.6 to the Linux
USB developer mailing list. Turn the attention to the problem.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2004-01-04 12:45:40

by Alexander Holler

[permalink] [raw]
Subject: Re: [Bluez-devel] Switching the Logitech-Hub

Hi Marcel,

--On Sonntag, Januar 04, 2004 11:40:48 +0100 Marcel Holtmann
<[email protected]> wrote:

> do he got any comments about his patch? Do this patch break any other
> USB HID devices?

I've got no comments, it's not surprising, it's just 8 hours on this list.
But I also have looked through the sources and up to now, I don't see, why
this should break other devices. And it seems there are some more people
with the same problem. e.g.
http://sourceforge.net/mailarchive/forum.php?thread_id=3345181&forum_id=5398

I assume there are also some more who are wondering why sending reports
using hiddev doesn't work. But not everyone will find the reason. Without
your help, I wouldn't have find it too.

As the author from the patch writes, it doesn't seem to interrest anyone
from the usb-devels.

Regards,

Alexander



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2004-01-04 10:40:48

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] Switching the Logitech-Hub

Hi Alexander,

> I've now find a way to use hiddev for sending a report to the hub.
>
> Using the patch from
>
> http://sourceforge.net/mailarchive/forum.php?thread_id=3581364&forum_id=5398

do he got any comments about his patch? Do this patch break any other
USB HID devices?

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel