[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
get usb device descriptor through ioctl?
I don't know if I'm on the right ML, if not please tell me.
My problem: I'm on the NetBSD-daily of 2 feb (I upgrade every month)
and I'm trying to make a fork of dfu-util because this application
can't find dfu device on -current (and maybe on earlier version) but I
have a little problem:
I try to get the device descriptor wih ioctl just like in the man
ugen(4) but I only get an "Invalid Argument" error. the only think
which work is the USB_DEVICEINFO from man usb(4) but I don't know how
to get device descriptor from it (trying to open udi_devnames lead
to another error: "File not found") and doing an sh MAKEDEV with the
value of udi_devnames throw the error "unknow device"
So this is my question: how to access udi_devnames with open() to
get the file descriptor to give to ioctl?
this is the faulty code:
devicefd = open(file.c_str(), O_RDWR);
if (devicefd != -1)
Â device_info.udi_addr = 2;
Â if (ioctl(devicefd, USB_DEVICEINFO, &device_info) != -1)
Â if (ioctl(devicefd, USB_GET_DEVICE_DESC, &device_desc) != -1)
Main Index |
Thread Index |