LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Closed Thread
  Search this Thread
Old 11-19-2008, 03:40 AM   #1
JerryMega
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Rep: Reputation: 0
How to send get index string command to HID on linux?


I go here first time today.
wish guys to give help to me.
Now, I is able to send get index string to hid on windows.
Use HidD_GetIndexedString function on windows.

for example:
I have to send bytes arrays to hid adapter.
use HidD_GetIndexedString to do this.
Index value is 0x99 (3rd byte), index length is 0x15(7rd byte)
SO.bytes array as below:
CTL 80 06 99 03 09 04 17 00 GET_DESCRIPTOR.
On windows , the Codes work well.

But , i need to port this function to linux.

Now coding like this:
if(open("/dev/hiddev0", O_RDWR|O_NDELAY) != -1)
{
string_descriptor.index = 0x99;
ioctl(handle, HIDIOCGSTRING, &string_descriptor);
}
In fact, On linux
The Bytes array is:
CTL 80 06 99 03 09 04 66 00
This means that I can not to change index string length,
The fixed length is 0x64.
How to change index string length to 0x15 on linux.
What function is used????
Thank a lot......
 
Old 11-19-2008, 04:17 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread



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
creating array in c++ with string index mohtasham1983 Programming 3 03-11-2007 04:01 PM
How to initialize index with string in shell programming jayakumar Programming 3 12-08-2006 01:09 AM
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
why I can only send two bytes data to HID device? wch_zj Programming 0 01-05-2006 12:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:40 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
Open Source Consulting | Domain Registration