mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-13 23:26:16 +00:00
Merge branch 'master' of https://github.com/RetroView/libBoo
This commit is contained in:
@@ -45,7 +45,7 @@ class HIDDeviceUdev final : public IHIDDevice
|
||||
{
|
||||
usbdevfs_bulktransfer xfer =
|
||||
{
|
||||
m_usbIntfOutPipe | USB_DIR_OUT,
|
||||
m_usbIntfOutPipe | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
|
||||
(unsigned)length,
|
||||
0,
|
||||
(void*)data
|
||||
@@ -57,7 +57,7 @@ class HIDDeviceUdev final : public IHIDDevice
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
size_t _receiveUSBInterruptTransfer(uint8_t* data, size_t length)
|
||||
{
|
||||
if (m_devFd)
|
||||
@@ -193,12 +193,46 @@ class HIDDeviceUdev final : public IHIDDevice
|
||||
m_runningTransferLoop = false;
|
||||
}
|
||||
|
||||
bool _sendHIDReport(const uint8_t* data, size_t length)
|
||||
bool _sendHIDReport(const uint8_t* data, size_t length, uint16_t message)
|
||||
{
|
||||
(void)data;
|
||||
(void)length;
|
||||
if (m_devFd)
|
||||
{
|
||||
usbdevfs_ctrltransfer xfer =
|
||||
{
|
||||
USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
|
||||
0x09, // HID_SET_REPORT
|
||||
message,
|
||||
0,
|
||||
(uint16_t)length,
|
||||
0,
|
||||
(void*)data
|
||||
};
|
||||
int ret = ioctl(m_devFd, USBDEVFS_CONTROL, &xfer);
|
||||
if (ret != (int)length)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t _recieveReport(const uint8_t *data, size_t length, uint16_t message)
|
||||
{
|
||||
if (m_devFd)
|
||||
{
|
||||
usbdevfs_ctrltransfer xfer =
|
||||
{
|
||||
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
|
||||
0x01, // HID_GET_REPORT
|
||||
message,
|
||||
0,
|
||||
(uint16_t)length,
|
||||
0,
|
||||
(void*)data
|
||||
};
|
||||
return ioctl(m_devFd, USBDEVFS_CONTROL, &xfer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user