Hi everybody!
I'm trying to write an application which communicates with my test HID
device. I'm working with ST72F623 chip from ST. This device uses HID
library and it's based on USB to serial bridge project from ST.
I've written a very simple source code to communicate with it:
int main(void)
{
struct usb_bus *bus;
unsigned char rdstg[45];
int num_read_bytes;
struct usb_device *dev;
usb_dev_handle *udev;
usb_init();
usb_find_busses();
usb_find_devices();
//Search
for (bus = usb_busses; bus; bus = bus->next) {
for (dev = bus->devices; dev; dev = dev->next) {
if((dev->descriptor.idVendor == MY_ID) &&
(dev->descriptor.idProduct == MY_HID_ID)) {
printf("\t\t<<------found here!!\n");
break;
}
}
}
printf("Opening Device\n");
udev = usb_open(dev);
if (udev) {
printf("Open Successful\n");
while(1) {
num_read_bytes = usb_interrupt_read(udev, 0x02, rdstg, 8, 16);
if(num_read_bytes > 0)
printf("Readed Bytes=%d data=%x%x%x%x%x%x%x%x\n",
num_read_bytes, rdstg[0], rdstg[1], rdstg[2], rdstg[3], rdstg[4],
rdstg[5], rdstg[6], rdstg[7]);
sleep(10);
}
printf("closing\n");
usb_close (udev);
}
return 0;
}
Unfortunately this source does not read anything from this endpoint EP2
(0x02)!
num_read_bytes returns less than zero values.
I was also trying usb_bulk_read() with the same parameters but without
any success.
I have also studied manual: “USB HID for Linux USB” but it is incomplete
in "read from hiddev"http://www.frogmouth.net/hid-doco/x190.html. I'm
desperately looking for any help to make this device working with linux.
If anyone could help me in it I'll be very thankful.
Here you have a little info about this device from lsusb -v.
Bus 001 Device 003: ID 0483:0035 SGS Thomson Microelectronics
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 Interface
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0483 SGS Thomson Microelectronics
idProduct 0x0035
bcdDevice 1.16
iManufacturer 3 Test
iProduct 1 USB device
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
Remote Wakeup
MaxPower 20mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Devices
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 33
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 29
cannot get report descriptor
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type none
wMaxPacketSize 8
bInterval 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type none
wMaxPacketSize 8
bInterval 10
Language IDs: (length=4)
0409 English(US)
Best Regards
email: pablozrudnika.wp.pl
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel