| 46 | s32 QueryVendorProduct(uint16_t vendor_id, uint16_t product_id); |
| 47 | |
| 48 | void UsbEventThreadFunc(void* arg) |
| 49 | { |
| 50 | do |
| 51 | { |
| 52 | if (R_SUCCEEDED(eventWait(&g_usbCatchAllEvent, UINT64_MAX))) |
| 53 | { |
| 54 | WriteToLog("Catch-all event went off"); |
| 55 | |
| 56 | SwitchUtils::ScopedLock usbLock(usbMutex); |
| 57 | if (!controllers::IsAtControllerLimit()) |
| 58 | { |
| 59 | s32 total_entries; |
| 60 | if ((total_entries = QueryInterfaces(USB_CLASS_VENDOR_SPEC, 93, 1)) != 0) |
| 61 | WriteToLog("Initializing Xbox 360 controller: 0x%x", controllers::Insert(std::make_unique<Xbox360Controller>(std::make_unique<SwitchUSBDevice>(interfaces, total_entries)))); |
| 62 | |
| 63 | if ((total_entries = QueryInterfaces(USB_CLASS_VENDOR_SPEC, 93, 129)) != 0) |
| 64 | for (int i = 0; i != total_entries; ++i) |
| 65 | WriteToLog("Initializing Xbox 360 wireless controller: 0x%x", controllers::Insert(std::make_unique<Xbox360WirelessController>(std::make_unique<SwitchUSBDevice>(interfaces + i, 1)))); |
| 66 | |
| 67 | if ((total_entries = QueryInterfaces(0x58, 0x42, 0x00)) != 0) |
| 68 | WriteToLog("Initializing Xbox Original controller: 0x%x", controllers::Insert(std::make_unique<XboxController>(std::make_unique<SwitchUSBDevice>(interfaces, total_entries)))); |
| 69 | |
| 70 | if ((total_entries = QueryInterfaces(USB_CLASS_VENDOR_SPEC, 71, 208)) != 0) |
| 71 | WriteToLog("Initializing Xbox One controller: 0x%x", controllers::Insert(std::make_unique<XboxOneController>(std::make_unique<SwitchUSBDevice>(interfaces, total_entries)))); |
| 72 | } |
| 73 | } |
| 74 | } while (is_usb_event_thread_running); |
| 75 | } |
| 76 | |
| 77 | void UsbSonyEventThreadFunc(void* arg) |
| 78 | { |
nothing calls this directly
no test coverage detected