LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to send datas to HID device?why I can only send two bytes data to HID device? (http://www.linuxquestions.org/questions/linux-software-2/how-to-send-datas-to-hid-device-why-i-can-only-send-two-bytes-data-to-hid-device-399687/)

wch_zj 01-05-2006 12:00 AM

how to send datas to HID device?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 !

jtshaw 01-05-2006 07:14 AM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

Continue here.


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