Skip to content

Commit

Permalink
nsyshid: libusb backend: implement SetReport
Browse files Browse the repository at this point in the history
  • Loading branch information
ssievert42 committed Sep 20, 2023
1 parent ede00ce commit cd5031a
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions src/Cafe/OS/libs/nsyshid/BackendLibusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,20 +723,29 @@ namespace nsyshid::backend::libusb
return false;
}

// ToDo: implement this
#if 0
// not sure if libusb_control_transfer() is the right candidate for this
int ret = libusb_control_transfer(handleLock->getHandle(),
bmRequestType,
bRequest,
wValue,
wIndex,
int ret = 0;
sint32 retryCount = 0;
do
{
ret = libusb_control_transfer(handleLock->GetHandle(),
LIBUSB_RECIPIENT_INTERFACE | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_ENDPOINT_OUT,
LIBUSB_REQUEST_SET_CONFIGURATION,
(LIBUSB_DT_CONFIG << 8) | reportData[0],
0,
reportData,
length,
timeout);
#endif

// pretend that everything is fine
50);
if (ret != 0)
{
retryCount++;
}
}
while (ret != 0 && retryCount < 20);
if (ret != 0)
{
cemuLog_logDebug(LogType::Force, "nsyshid::DeviceLibusb::SetReport(): control transfer failed with error code: {}", ret);
return false;
}
return true;
}

Expand Down

0 comments on commit cd5031a

Please sign in to comment.