LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 01-05-2006, 01:04 AM   #1
wch_zj
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);

}

usleep(50000);
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 !
 
  


Reply


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 08:14 AM
Sending Data Bytes to a terminal jonty_11 Programming 8 03-28-2005 08:55 PM
Problem with usb hid device on nforce 2 gak330 Linux - Hardware 0 06-06-2004 01:44 AM
HID Device wont work c0rderr0y Linux - Hardware 0 02-29-2004 08:00 PM
"permission denied" when I try to send raw data to the sound device. Travis86 Linux - Hardware 2 10-29-2003 10:08 AM


All times are GMT -5. The time now is 11:41 PM.

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