Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-05-2006, 12:04 AM   #1
LQ Newbie
Registered: Jan 2006
Posts: 2

Rep: Reputation: 0
Unhappy why I can only send two bytes data to HID device?

please help me!I am hanging at the HIDIOCSUSAGE stage for severial days! these are my source,please point errs!
struct hiddev_report_info rinfo;

rinfo.report_type = HID_REPORT_TYPE_OUTPUT;
rinfo.report_id = HID_REPORT_ID_FIRST;
ioctl (fd, HIDIOCGREPORTINFO, &rinfo);

uref.report_type = HID_REPORT_TYPE_OUTPUT;
uref.report_id = rinfo.report_id ;
uref.field_index = 0;
uref.usage_index = 0;
ioctl (fd, HIDIOCGUCODE, &uref)

ioctl (fd, HIDIOCGUSAGE, &uref);

for(i=0;i<idatalen;i++) {
uref.report_type = HID_REPORT_TYPE_OUTPUT;
uref.report_id = 0x00;
uref.field_index = 0;
uref.usage_index = i;
uref.value = pucdata;
ioctl(fd, HIDIOCSUSAGE, &uref);


struct hiddev_report_info rinfo;

rinfo.report_type = HID_REPORT_TYPE_OUTPUT;
rinfo.report_id = 0x00;
rinfo.num_fields = 1;
ioctl(fd, HIDIOCSREPORT, &rinfo);
I can send two bytes data to My HID device,but I need to send 8 bytes to it,how should I do?please help me !


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to send datas to HID device?why I can only send two bytes data to HID device? wch_zj Linux - Software 1 01-05-2006 07:14 AM
Sending Data Bytes to a terminal jonty_11 Programming 8 03-28-2005 07:55 PM
Problem with usb hid device on nforce 2 gak330 Linux - Hardware 0 06-06-2004 12:44 AM
HID Device wont work c0rderr0y Linux - Hardware 0 02-29-2004 07:00 PM
"permission denied" when I try to send raw data to the sound device. Travis86 Linux - Hardware 2 10-29-2003 09:08 AM

All times are GMT -5. The time now is 02:48 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration