Linux bluetooth development
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Switching the Logitech-Hub
Date: Sun, 04 Jan 2004 06:23:25 +0100	[thread overview]
Message-ID: <10480000.1073193805@[192.168.207.2]> (raw)

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
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

             reply	other threads:[~2004-01-04  5:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-04  5:23 Alexander Holler [this message]
2004-01-04 10:40 ` [Bluez-devel] Switching the Logitech-Hub Marcel Holtmann
2004-01-04 12:45   ` Alexander Holler
2004-01-05  1:49     ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='10480000.1073193805@[192.168.207.2]' \
    --to=holler@ahsoftware.de \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox