diff --git a/ControllerUSB/source/Controllers/Dualshock3Controller.cpp b/ControllerUSB/source/Controllers/Dualshock3Controller.cpp index 8422619..84740a5 100644 --- a/ControllerUSB/source/Controllers/Dualshock3Controller.cpp +++ b/ControllerUSB/source/Controllers/Dualshock3Controller.cpp @@ -44,6 +44,12 @@ Result Dualshock3Controller::OpenInterfaces() if (R_FAILED(rc)) return rc; + if (interface->GetDescriptor()->bInterfaceClass != 3) + continue; + + if (interface->GetDescriptor()->bInterfaceProtocol != 0) + continue; + if (interface->GetDescriptor()->bNumEndpoints < 2) continue; diff --git a/SwitchUSB/include/SwitchUSBInterface.h b/SwitchUSB/include/SwitchUSBInterface.h index 7180e44..3305f9e 100644 --- a/SwitchUSB/include/SwitchUSBInterface.h +++ b/SwitchUSB/include/SwitchUSBInterface.h @@ -7,8 +7,8 @@ class SwitchUSBInterface : public IUSBInterface { private: - UsbHsClientIfSession m_session{}; - UsbHsInterface m_interface{}; + UsbHsClientIfSession m_session; + UsbHsInterface m_interface; std::array, 15> m_inEndpoints; std::array, 15> m_outEndpoints; diff --git a/SwitchUSB/source/SwitchUSBInterface.cpp b/SwitchUSB/source/SwitchUSBInterface.cpp index 088c1fa..abf295f 100644 --- a/SwitchUSB/source/SwitchUSBInterface.cpp +++ b/SwitchUSB/source/SwitchUSBInterface.cpp @@ -18,7 +18,7 @@ Result SwitchUSBInterface::Open() UsbHsClientIfSession temp; Result rc = usbHsAcquireUsbIf(&temp, &m_interface); if (R_FAILED(rc)) - return 11037; + return rc; m_session = temp; diff --git a/source/mainLoop.cpp b/source/mainLoop.cpp index e917d69..d724b19 100644 --- a/source/mainLoop.cpp +++ b/source/mainLoop.cpp @@ -253,7 +253,7 @@ Result mainLoop() else { - UsbHsInterface interfaces[8]; + UsbHsInterface interfaces[16]; s32 total_entries; 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)) { WriteToLog("Dualshock 3 event went off"); - UsbHsInterface interfaces[4]; + UsbHsInterface interfaces[8]; s32 total_entries; if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0))) @@ -306,7 +306,7 @@ Result mainLoop() if (R_SUCCEEDED(rc)) { WriteToLog("Dualshock 4 event went off"); - UsbHsInterface interfaces[4]; + UsbHsInterface interfaces[8]; s32 total_entries; if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0)))