mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 13:48:56 +00:00
BT passthrough uses selected device rather than first alphabetical compatible device
This commit is contained in:
parent
fa9f71e482
commit
71fa08813a
2 changed files with 13 additions and 0 deletions
|
@ -73,6 +73,13 @@ BluetoothRealDevice::~BluetoothRealDevice()
|
||||||
SaveLinkKeys();
|
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)
|
bool BluetoothRealDevice::IsConfiguredBluetoothDevice(u16 vid, u16 pid)
|
||||||
{
|
{
|
||||||
const int configured_vid = Config::Get(Config::MAIN_BLUETOOTH_PASSTHROUGH_VID);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HasConfiguredBluetoothDevice() &&
|
||||||
|
!IsConfiguredBluetoothDevice(device_descriptor.idVendor, device_descriptor.idProduct))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (IsBluetoothDevice(device_descriptor) && OpenDevice(device_descriptor, device))
|
if (IsBluetoothDevice(device_descriptor) && OpenDevice(device_descriptor, device))
|
||||||
{
|
{
|
||||||
unsigned char manufacturer[50] = {}, product[50] = {}, serial_number[50] = {};
|
unsigned char manufacturer[50] = {}, product[50] = {}, serial_number[50] = {};
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
void HandleBulkOrIntrTransfer(libusb_transfer* finished_transfer);
|
void HandleBulkOrIntrTransfer(libusb_transfer* finished_transfer);
|
||||||
|
|
||||||
static bool IsConfiguredBluetoothDevice(u16 vid, u16 pid);
|
static bool IsConfiguredBluetoothDevice(u16 vid, u16 pid);
|
||||||
|
static bool HasConfiguredBluetoothDevice();
|
||||||
|
|
||||||
struct BluetoothDeviceInfo
|
struct BluetoothDeviceInfo
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue