Need Linux USB/HID interface libraries and the examples in C/C++ or PHP

I have a device(FINCH robot) the shows up as a

/dev/usb/hiddev0

on ubuntu linux. The device seems work correctly using Java software provided by the device vendor, without any modifition on the Linux/JDK or whatever.

I need to write my own code to drive the device, with either PHP or C/C++.
I had assumed it was simply a USB/Serial device and trying to implement the commands listed at this site:

http://www.finchrobot.com/usb-protocol

, apparently with no success, until someone from the vendor told me it is an HID device, not a serial. Their Java code works on top of a C++ HID library, as I was told.

Now I need two things: 1) a quick education on Linux/USB/HID, to the level just being able to understand how to send these simple serial-like commands and received responses (reports in HID).

 2) C/C++ interface libraries on Linux (uBuntu) for HID devices. With sample codes that include  "/dev/usb/hiddev0"  file desciptor, would be most appreciated. In fact I would rather write PHP code; if someone has a Linux/PHP/ HID code, that will be amazing.

Thanks in advance

ZZ
LVL 1
zzhang2006ProfessorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NoiSCommented:
These are the steps that I recommend. I'm not a specialist but I've already done some similar thing.

First, PHP cannot talk with anyone hardware device directly. You need some extension usually build in C/C++ or a client, like Database does.

Second, to talk with your device, you need to know about the API of your device, like printers do.

Maybe, The easiest way to send a command to a device attached a USB port on Linux box is using your mapped dev

To know about your devices run these commands

lsusb
modprobe usbserial
modprobe hid

Open in new window


After you certified that your device is listed  you can test some things on it.

If you can do commands through command line, you can do it with PHP too.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nociSoftware EngineerCommented:
libusb could very well be your friend.

http://libusb.org/
0
zzhang2006ProfessorAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.