mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-12 14:54:35 +02:00
Correctly support OG Steam Controller when connected via USB on Android (#15561)
(cherry picked from commit e4a327709d)
This commit is contained in:
committed by
Sam Lantinga
parent
7e101bdce9
commit
717bb2dcef
@@ -132,8 +132,10 @@ class HIDDeviceUSB implements HIDDevice {
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the required endpoints were present
|
||||
if (mInputEndpoint == null || mOutputEndpoint == null) {
|
||||
// Make sure the required endpoints were present. The original Steam Controller and the wireless dongle for it do NOT
|
||||
// actually have -- or require -- output endpoints, so we need to accept only an input one for them or else we'll fall
|
||||
// back to the Android system gamepad functionality (and lose our paddles et al).
|
||||
if (mInputEndpoint == null) {
|
||||
Log.w(TAG, "Missing required endpoint on USB device " + getDeviceName());
|
||||
close();
|
||||
return false;
|
||||
@@ -185,6 +187,11 @@ class HIDDeviceUSB implements HIDDevice {
|
||||
}
|
||||
return length;
|
||||
} else {
|
||||
if (mOutputEndpoint == null)
|
||||
{
|
||||
Log.e(TAG, "Tried to write an output report to an interface with no output endpoint!");
|
||||
return -1;
|
||||
}
|
||||
int res = mConnection.bulkTransfer(mOutputEndpoint, report, report.length, 1000);
|
||||
if (res != report.length) {
|
||||
Log.w(TAG, "writeOutputReport() returned " + res + " on device " + getDeviceName());
|
||||
|
||||
Reference in New Issue
Block a user