diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2025-06-28 18:45:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-28 18:45:05 -0500 |
| commit | b3e349b4df59b6dda9bbbb457d9366c0104c5731 (patch) | |
| tree | d084f9667f350f8be1c9c3c9835b49923dea4589 /Source/Core | |
| parent | 8d7bb0a44af8d1cbd61586e4dfeae8e4b2415856 (diff) | |
| parent | 71fa08813a25d152ffe7bfe0e82b3330dad3a23f (diff) | |
Merge pull request #13772 from rastshawn/use-btdevice-selection
BTReal: bugfix - BT passthrough uses selected device rather than first compatible device in list
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp | 12 | ||||
| -rw-r--r-- | Source/Core/Core/IOS/USB/Bluetooth/BTReal.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp index fae0c6e662..7940c37fc0 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp @@ -73,6 +73,13 @@ BluetoothRealDevice::~BluetoothRealDevice() SaveLinkKeys(); } +bool BluetoothRealDevice::HasConfiguredBluetoothDevice() +{ + const int configured_vid = Config::Get(Config::MAIN_BLUETOOTH_PASSTHROUGH_VID); + const int configured_pid = Config::Get(Config::MAIN_BLUETOOTH_PASSTHROUGH_PID); + return configured_vid != -1 && configured_pid != -1; +} + bool BluetoothRealDevice::IsConfiguredBluetoothDevice(u16 vid, u16 pid) { const int configured_vid = Config::Get(Config::MAIN_BLUETOOTH_PASSTHROUGH_VID); @@ -99,6 +106,11 @@ std::optional<IPCReply> BluetoothRealDevice::Open(const OpenRequest& request) return true; } + if (HasConfiguredBluetoothDevice() && + !IsConfiguredBluetoothDevice(device_descriptor.idVendor, device_descriptor.idProduct)) + { + return true; + } if (IsBluetoothDevice(device_descriptor) && OpenDevice(device_descriptor, device)) { unsigned char manufacturer[50] = {}, product[50] = {}, serial_number[50] = {}; diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.h b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.h index 96a18c0617..b40ace416e 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.h +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.h @@ -59,6 +59,7 @@ public: void HandleBulkOrIntrTransfer(libusb_transfer* finished_transfer); static bool IsConfiguredBluetoothDevice(u16 vid, u16 pid); + static bool HasConfiguredBluetoothDevice(); struct BluetoothDeviceInfo { |
