mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-24 01:25:04 +00:00
Implemented SDL_GameControllerGetFirmwareVersion() for HIDAPI PS5 controllers
This commit is contained in:
parent
e5a3acd6bd
commit
9202df0472
|
@ -59,6 +59,7 @@ typedef enum
|
||||||
{
|
{
|
||||||
k_EPS5FeatureReportIdCalibration = 0x05,
|
k_EPS5FeatureReportIdCalibration = 0x05,
|
||||||
k_EPS5FeatureReportIdSerialNumber = 0x09,
|
k_EPS5FeatureReportIdSerialNumber = 0x09,
|
||||||
|
k_EPS5FeatureReportIdFirmwareInfo = 0x20,
|
||||||
} EPS5FeatureReportId;
|
} EPS5FeatureReportId;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -601,6 +602,13 @@ HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
|
||||||
data[6], data[5], data[4], data[3], data[2], data[1]);
|
data[6], data[5], data[4], data[3], data[2], data[1]);
|
||||||
joystick->serial = SDL_strdup(serial);
|
joystick->serial = SDL_strdup(serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Read the firmware version
|
||||||
|
This will also enable enhanced reports over Bluetooth
|
||||||
|
*/
|
||||||
|
if (ReadFeatureReport(device->dev, k_EPS5FeatureReportIdFirmwareInfo, data, USB_PACKET_LENGTH) >= 46) {
|
||||||
|
joystick->firmware_version = (Uint16)data[44] | ((Uint16)data[45] << 8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!joystick->serial && device->serial && SDL_strlen(device->serial) == 12) {
|
if (!joystick->serial && device->serial && SDL_strlen(device->serial) == 12) {
|
||||||
|
|
Loading…
Reference in a new issue