Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable descriptor check for BT passthrough in some cases #4385

Merged
merged 1 commit into from Nov 4, 2016

Conversation

@leoetlino
Copy link
Member

@leoetlino leoetlino commented Oct 25, 2016

Some adapters don't have the correct interface class, so they are not recognised as Bluetooth adapters. It seems that apart from hardcoding VIDs/PIDs (which is how it's done in the Linux kernel, and which I'm not very fond of), there is no other way to detect if a device is a Bluetooth adapter or not.

So I think adding an option to disable the descriptor check is the only sane way to allow such adapters to be used.

While this solution seems best for maintainability, it's not terribly user friendly. Does someone have any better idea?


This change is Reviewable

@@ -45,6 +45,19 @@ static bool IsWantedDevice(libusb_device_descriptor& descriptor)
return descriptor.idVendor == vid && descriptor.idProduct == pid;
}

constexpr u8 SUBCLASS = 0x01;
constexpr u8 PROTOCOL_BLUETOOTH = 0x01;

This comment has been minimized.

@lioncash

lioncash Oct 25, 2016
Member

These constants can go inside IsBluetoothDevice.

@leoetlino leoetlino force-pushed the leoetlino:disable-bt-check branch from c372899 to fd6b2c9 Oct 25, 2016
@slaren
Copy link

@slaren slaren commented Oct 25, 2016

With this change I was able to use an Asus BT-400 (VID_0B05&PID_17CB&REV_0112) successfully with a 3rd party WiiMote. Previously it would refuse to use the adapter.

@leoetlino leoetlino changed the title Add option to disable descriptor check for BT passthrough [RFC] Add option to disable descriptor check for BT passthrough Oct 27, 2016
Some adapters don't have the correct interface class, so they are not
recognised as Bluetooth adapters. It seems that apart from hardcoding
VIDs/PIDs (which is how it's done in the Linux kernel, and which I'm
not very fond of), there is no other way to detect if a device is a
Bluetooth adapter or not.

This change makes Dolphin skip the descriptor check when trying to find
a usable adapter for Bluetooth Passthrough if the use of a specific
adapter was forced; it is assumed that the user knows what they are
doing if they hand-edited their config file.

This allows such adapters to be used.
@leoetlino leoetlino force-pushed the leoetlino:disable-bt-check branch from fd6b2c9 to e89ca79 Oct 28, 2016
@leoetlino leoetlino changed the title [RFC] Add option to disable descriptor check for BT passthrough Disable descriptor check for BT passthrough in some cases Oct 28, 2016
@degasus
Copy link
Member

@degasus degasus commented Nov 4, 2016

This sounds fine. Valid the type on auto detection, but accept every manually configured device.

@degasus degasus merged commit 234691a into dolphin-emu:master Nov 4, 2016
10 of 11 checks passed
10 of 11 checks passed
code-review/reviewable 2 files left
Details
default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd Build succeeded on builder pr-freebsd
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details
@leoetlino leoetlino deleted the leoetlino:disable-bt-check branch Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants