mirror of
https://github.com/ndeadly/MissionControl
synced 2024-11-23 04:43:10 +00:00
btdrv-mitm: check controller name against recognised switch controller names before using vid/pid to match controllers
This commit is contained in:
parent
41861b9d29
commit
1348385a98
1 changed files with 2 additions and 9 deletions
|
@ -40,11 +40,8 @@ namespace ams::controller {
|
||||||
|
|
||||||
ControllerType Identify(const BluetoothDevicesSettings *device) {
|
ControllerType Identify(const BluetoothDevicesSettings *device) {
|
||||||
|
|
||||||
for (auto hwId : SwitchController::hardware_ids) {
|
if (IsOfficialSwitchControllerName(device->name))
|
||||||
if ( (device->vid == hwId.vid) && (device->pid == hwId.pid) ) {
|
|
||||||
return ControllerType_Switch;
|
return ControllerType_Switch;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto hwId : WiiController::hardware_ids) {
|
for (auto hwId : WiiController::hardware_ids) {
|
||||||
if ( (device->vid == hwId.vid) && (device->pid == hwId.pid) ) {
|
if ( (device->vid == hwId.vid) && (device->pid == hwId.pid) ) {
|
||||||
|
@ -94,10 +91,6 @@ namespace ams::controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for third party switch controllers or official switch controllers that have been assigned garbage IDs
|
|
||||||
if (IsOfficialSwitchControllerName(device->name))
|
|
||||||
return ControllerType_Switch;
|
|
||||||
|
|
||||||
return ControllerType_Unknown;
|
return ControllerType_Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue