1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-07-08 11:58:44 +00:00

Minor changes

This commit is contained in:
cathery 2019-11-25 15:58:23 +03:00
parent 7356a742c9
commit 3ff573456f
4 changed files with 12 additions and 6 deletions

View File

@ -44,6 +44,12 @@ Result Dualshock3Controller::OpenInterfaces()
if (R_FAILED(rc)) if (R_FAILED(rc))
return rc; return rc;
if (interface->GetDescriptor()->bInterfaceClass != 3)
continue;
if (interface->GetDescriptor()->bInterfaceProtocol != 0)
continue;
if (interface->GetDescriptor()->bNumEndpoints < 2) if (interface->GetDescriptor()->bNumEndpoints < 2)
continue; continue;

View File

@ -7,8 +7,8 @@
class SwitchUSBInterface : public IUSBInterface class SwitchUSBInterface : public IUSBInterface
{ {
private: private:
UsbHsClientIfSession m_session{}; UsbHsClientIfSession m_session;
UsbHsInterface m_interface{}; UsbHsInterface m_interface;
std::array<std::unique_ptr<IUSBEndpoint>, 15> m_inEndpoints; std::array<std::unique_ptr<IUSBEndpoint>, 15> m_inEndpoints;
std::array<std::unique_ptr<IUSBEndpoint>, 15> m_outEndpoints; std::array<std::unique_ptr<IUSBEndpoint>, 15> m_outEndpoints;

View File

@ -18,7 +18,7 @@ Result SwitchUSBInterface::Open()
UsbHsClientIfSession temp; UsbHsClientIfSession temp;
Result rc = usbHsAcquireUsbIf(&temp, &m_interface); Result rc = usbHsAcquireUsbIf(&temp, &m_interface);
if (R_FAILED(rc)) if (R_FAILED(rc))
return 11037; return rc;
m_session = temp; m_session = temp;

View File

@ -253,7 +253,7 @@ Result mainLoop()
else else
{ {
UsbHsInterface interfaces[8]; UsbHsInterface interfaces[16];
s32 total_entries; s32 total_entries;
if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_VENDOR_SPEC, 93, 1))) if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_VENDOR_SPEC, 93, 1)))
@ -293,7 +293,7 @@ Result mainLoop()
if (R_SUCCEEDED(rc)) if (R_SUCCEEDED(rc))
{ {
WriteToLog("Dualshock 3 event went off"); WriteToLog("Dualshock 3 event went off");
UsbHsInterface interfaces[4]; UsbHsInterface interfaces[8];
s32 total_entries; s32 total_entries;
if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0))) if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0)))
@ -306,7 +306,7 @@ Result mainLoop()
if (R_SUCCEEDED(rc)) if (R_SUCCEEDED(rc))
{ {
WriteToLog("Dualshock 4 event went off"); WriteToLog("Dualshock 4 event went off");
UsbHsInterface interfaces[4]; UsbHsInterface interfaces[8];
s32 total_entries; s32 total_entries;
if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0))) if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0)))