WiimoteReal: Add function to test specifically for a wii remote name.

This commit is contained in:
Jordan Woyak 2025-09-27 01:46:07 -05:00
parent 8323c21e40
commit 94ecf4df39
2 changed files with 13 additions and 6 deletions

View File

@ -965,13 +965,17 @@ void Refresh()
s_wiimote_scanner.SetScanMode(WiimoteScanMode::SCAN_ONCE);
}
bool IsValidDeviceName(const std::string& name)
bool IsValidDeviceName(std::string_view name)
{
return "Nintendo RVL-CNT-01" == name || "Nintendo RVL-CNT-01-TR" == name ||
IsBalanceBoardName(name);
return IsWiimoteName(name) || IsBalanceBoardName(name);
}
bool IsBalanceBoardName(const std::string& name)
bool IsWiimoteName(std::string_view name)
{
return name == "Nintendo RVL-CNT-01" || name == "Nintendo RVL-CNT-01-TR";
}
bool IsBalanceBoardName(std::string_view name)
{
return "Nintendo RVL-WBC-01" == name;
}

View File

@ -7,6 +7,7 @@
#include <memory>
#include <mutex>
#include <string>
#include <string_view>
#include <thread>
#include <vector>
@ -225,8 +226,10 @@ extern std::unique_ptr<Wiimote> g_wiimotes[MAX_BBMOTES];
void AddWiimoteToPool(std::unique_ptr<Wiimote>);
bool IsValidDeviceName(const std::string& name);
bool IsBalanceBoardName(const std::string& name);
bool IsValidDeviceName(std::string_view name);
bool IsWiimoteName(std::string_view name);
bool IsBalanceBoardName(std::string_view name);
bool IsNewWiimote(const std::string& identifier);
bool IsKnownDeviceId(const USBUtils::DeviceInfo&);