LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-19-2008, 03:44 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 am 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:25 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
Welcome to LQ!! (I closed your duplicate thread)

I assume you are working in a C environment.

Some of what you posted will not make sense unless the reader knows what header files you are using, and knows what a "hid adapter" is.
 
Old 11-19-2008, 07:48 PM   #3
JerryMega
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
Welcome to LQ!! (I closed your duplicate thread)

I assume you are working in a C environment.

Some of what you posted will not make sense unless the reader knows what header files you are using, and knows what a "hid adapter" is.

Yes, working in a C environment,
HID is a USB Class.
Usually, User does not need to know what it is really(usage/page), and is able to send severals types command.

for example:
GET_DESCRIPTOR,SET_DESCRIPTOR.......
The host attempts to enumerate the device by sending above control transfers command.
BusHound can capture all data stream during session.
 
Old 11-20-2008, 08:24 PM   #4
JerryMega
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by JerryMega View Post
Yes, working in a C environment,
HID is a USB Class.
Usually, User does not need to know what it is really(usage/page), and is able to send severals types command.

for example:
GET_DESCRIPTOR,SET_DESCRIPTOR.......
The host attempts to enumerate the device by sending above control transfers command.
BusHound can capture all data stream during session.
Could anybody help me fix this problem........
 
Old 11-26-2008, 10:15 PM   #5
JerryMega
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by JerryMega View Post
Could anybody help me fix this problem........
.....My friends...
 
  


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 get index string command to HID on linux? JerryMega Linux - Hardware 1 11-19-2008 04:17 AM
creating array in c++ with string index mohtasham1983 Programming 3 03-11-2007 04:01 PM
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 - Software

All times are GMT -5. The time now is 12:21 AM.

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