Add timeout to ioctl requests

This commit is contained in:
Phillip Stephens 2016-02-18 06:14:59 -08:00
parent d75a727a5d
commit 53fec8ac43

View File

@ -47,7 +47,7 @@ class HIDDeviceUdev final : public IHIDDevice
{ {
m_usbIntfOutPipe | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, m_usbIntfOutPipe | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
(unsigned)length, (unsigned)length,
0, 30,
(void*)data (void*)data
}; };
int ret = ioctl(m_devFd, USBDEVFS_BULK, &xfer); int ret = ioctl(m_devFd, USBDEVFS_BULK, &xfer);
@ -66,7 +66,7 @@ class HIDDeviceUdev final : public IHIDDevice
{ {
m_usbIntfInPipe | USB_DIR_IN, m_usbIntfInPipe | USB_DIR_IN,
(unsigned)length, (unsigned)length,
0, 30,
data data
}; };
return ioctl(m_devFd, USBDEVFS_BULK, &xfer); return ioctl(m_devFd, USBDEVFS_BULK, &xfer);
@ -204,7 +204,7 @@ class HIDDeviceUdev final : public IHIDDevice
message, message,
0, 0,
(uint16_t)length, (uint16_t)length,
0, 30,
(void*)data (void*)data
}; };
int ret = ioctl(m_devFd, USBDEVFS_CONTROL, &xfer); int ret = ioctl(m_devFd, USBDEVFS_CONTROL, &xfer);