mirror of https://github.com/encounter/SDL.git
Skip PS4/PS5 probe message if we already know it's a supported controller
This commit is contained in:
parent
fa2063fb44
commit
899a1e7cba
|
@ -181,13 +181,18 @@ HIDAPI_DriverPS4_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name,
|
||||||
Uint8 data[USB_PACKET_LENGTH];
|
Uint8 data[USB_PACKET_LENGTH];
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
|
if (type == SDL_CONTROLLER_TYPE_PS4) {
|
||||||
|
return SDL_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (device && SONY_THIRDPARTY_VENDOR(device->vendor_id) &&
|
if (device && SONY_THIRDPARTY_VENDOR(device->vendor_id) &&
|
||||||
(size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
(size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
||||||
data[2] == 0x27) {
|
data[2] == 0x27) {
|
||||||
/* Supported third party controller */
|
/* Supported third party controller */
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
return (type == SDL_CONTROLLER_TYPE_PS4) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -263,13 +263,18 @@ HIDAPI_DriverPS5_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name,
|
||||||
Uint8 data[USB_PACKET_LENGTH];
|
Uint8 data[USB_PACKET_LENGTH];
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
|
if (type == SDL_CONTROLLER_TYPE_PS5) {
|
||||||
|
return SDL_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (device && SONY_THIRDPARTY_VENDOR(device->vendor_id) &&
|
if (device && SONY_THIRDPARTY_VENDOR(device->vendor_id) &&
|
||||||
(size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
(size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data))) == 48 &&
|
||||||
data[2] == 0x28) {
|
data[2] == 0x28) {
|
||||||
/* Supported third party controller */
|
/* Supported third party controller */
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
return (type == SDL_CONTROLLER_TYPE_PS5) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue