btdrv-mitm: detect official joycons correctly when they have random hardware ids due to pairing via rails

This commit is contained in:
ndeadly 2020-07-12 15:08:49 +02:00
parent 435ad27951
commit fe49813bee

View file

@ -124,6 +124,13 @@ namespace ams::controller {
BTDRV_LOG_FMT("[+] Xbox one controller connected");
break;
default:
// Handle the case where joycons have been assigned random hardware ids when paired via rails
if (IsJoyCon(device.name)) {
g_controllers.push_back(std::make_unique<JoyconController>(address));
BTDRV_LOG_FMT("[+] Joycon controller connected");
break;
}
BTDRV_LOG_FMT("[?] Unknown controller [%04x:%04x | %s]", device.vid, device.pid, device.name);
// Disconnect unknown controller
//btdrvCloseHidConnection(address);