1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-12-25 00:13:52 +00:00

Fixed 1st gen Xbox One controller not connecting

This commit is contained in:
cathery 2019-11-06 02:47:42 +03:00
parent a4ab68c40a
commit c89ff56482

View File

@ -46,7 +46,9 @@ Status XboxOneController::OpenInterfaces()
//TODO: check for numEndpoints before trying to open them!
if (interface->GetDescriptor()->bNumEndpoints >= 2)
{
IUSBEndpoint *inEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_IN, 1);
for (uint8_t i = 0; i != 15; ++i)
{
IUSBEndpoint *inEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_IN, i);
if (inEndpoint)
{
rc = inEndpoint->Open();
@ -54,9 +56,12 @@ Status XboxOneController::OpenInterfaces()
return 5555;
m_inPipe = inEndpoint;
break;
}
IUSBEndpoint *outEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_OUT, 1);
}
for (uint8_t i = 0; i != 15; ++i)
{
IUSBEndpoint *outEndpoint = interface->GetEndpoint(IUSBEndpoint::USB_ENDPOINT_OUT, i);
if (outEndpoint)
{
rc = outEndpoint->Open();
@ -64,6 +69,8 @@ Status XboxOneController::OpenInterfaces()
return 6666;
m_outPipe = outEndpoint;
break;
}
}
}
}