mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 17:06:25 +00:00
Removed Bluetooth connection detection now that we get it from hidapi
This commit is contained in:
@@ -275,10 +275,8 @@ static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
(void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
|
(void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
|
||||||
data[6], data[5], data[4], data[3], data[2], data[1]);
|
data[6], data[5], data[4], data[3], data[2], data[1]);
|
||||||
}
|
}
|
||||||
device->is_bluetooth = SDL_FALSE;
|
|
||||||
ctx->enhanced_mode = SDL_TRUE;
|
ctx->enhanced_mode = SDL_TRUE;
|
||||||
} else if (device->vendor_id == USB_VENDOR_SONY && device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
|
} else if (device->vendor_id == USB_VENDOR_SONY && device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
|
||||||
device->is_bluetooth = SDL_FALSE;
|
|
||||||
ctx->enhanced_mode = SDL_TRUE;
|
ctx->enhanced_mode = SDL_TRUE;
|
||||||
|
|
||||||
} else if (device->vendor_id == USB_VENDOR_SONY) {
|
} else if (device->vendor_id == USB_VENDOR_SONY) {
|
||||||
@@ -287,11 +285,8 @@ static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
if (size >= 7 && (data[1] || data[2] || data[3] || data[4] || data[5] || data[6])) {
|
if (size >= 7 && (data[1] || data[2] || data[3] || data[4] || data[5] || data[6])) {
|
||||||
(void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
|
(void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
|
||||||
data[6], data[5], data[4], data[3], data[2], data[1]);
|
data[6], data[5], data[4], data[3], data[2], data[1]);
|
||||||
device->is_bluetooth = SDL_FALSE;
|
|
||||||
ctx->enhanced_mode = SDL_TRUE;
|
ctx->enhanced_mode = SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
device->is_bluetooth = SDL_TRUE;
|
|
||||||
|
|
||||||
/* Read a report to see if we're in enhanced mode */
|
/* Read a report to see if we're in enhanced mode */
|
||||||
size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 16);
|
size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 16);
|
||||||
#ifdef DEBUG_PS4_PROTOCOL
|
#ifdef DEBUG_PS4_PROTOCOL
|
||||||
@@ -309,12 +304,8 @@ static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Third party controllers appear to all be wired */
|
/* Third party controllers appear to all be wired */
|
||||||
device->is_bluetooth = SDL_FALSE;
|
|
||||||
ctx->enhanced_mode = SDL_TRUE;
|
ctx->enhanced_mode = SDL_TRUE;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_PS4
|
|
||||||
SDL_Log("PS4 dongle = %s, bluetooth = %s\n", ctx->is_dongle ? "TRUE" : "FALSE", device->is_bluetooth ? "TRUE" : "FALSE");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data));
|
size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data));
|
||||||
/* Get the device capabilities */
|
/* Get the device capabilities */
|
||||||
@@ -387,11 +378,6 @@ static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
/* The Razer Raiju doesn't respond to the detection protocol, but has a touchpad and vibration */
|
/* The Razer Raiju doesn't respond to the detection protocol, but has a touchpad and vibration */
|
||||||
ctx->vibration_supported = SDL_TRUE;
|
ctx->vibration_supported = SDL_TRUE;
|
||||||
ctx->touchpad_supported = SDL_TRUE;
|
ctx->touchpad_supported = SDL_TRUE;
|
||||||
|
|
||||||
if (device->product_id == USB_PRODUCT_RAZER_TOURNAMENT_EDITION_BLUETOOTH ||
|
|
||||||
device->product_id == USB_PRODUCT_RAZER_ULTIMATE_EDITION_BLUETOOTH) {
|
|
||||||
device->is_bluetooth = SDL_TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported);
|
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported);
|
||||||
|
|
||||||
|
@@ -382,15 +382,12 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
#endif
|
#endif
|
||||||
if (size == 64) {
|
if (size == 64) {
|
||||||
/* Connected over USB */
|
/* Connected over USB */
|
||||||
device->is_bluetooth = SDL_FALSE;
|
|
||||||
ctx->enhanced_mode = SDL_TRUE;
|
ctx->enhanced_mode = SDL_TRUE;
|
||||||
} else if (size > 0 && data[0] == k_EPS5ReportIdBluetoothEffects) {
|
} else if (size > 0 && data[0] == k_EPS5ReportIdBluetoothEffects) {
|
||||||
/* Connected over Bluetooth, using enhanced reports */
|
/* Connected over Bluetooth, using enhanced reports */
|
||||||
device->is_bluetooth = SDL_TRUE;
|
|
||||||
ctx->enhanced_mode = SDL_TRUE;
|
ctx->enhanced_mode = SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
/* Connected over Bluetooth, using simple reports (DirectInput enabled) */
|
/* Connected over Bluetooth, using simple reports (DirectInput enabled) */
|
||||||
device->is_bluetooth = SDL_TRUE;
|
|
||||||
|
|
||||||
/* Games written prior the introduction of PS5 controller support in SDL will not be aware of
|
/* Games written prior the introduction of PS5 controller support in SDL will not be aware of
|
||||||
SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, but they did know SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.
|
SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, but they did know SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.
|
||||||
|
@@ -117,7 +117,6 @@ typedef struct
|
|||||||
SDL_HIDAPI_Device *device;
|
SDL_HIDAPI_Device *device;
|
||||||
Uint16 vendor_id;
|
Uint16 vendor_id;
|
||||||
Uint16 product_id;
|
Uint16 product_id;
|
||||||
SDL_bool bluetooth;
|
|
||||||
SDL_XboxOneInitState init_state;
|
SDL_XboxOneInitState init_state;
|
||||||
Uint64 start_time;
|
Uint64 start_time;
|
||||||
Uint8 sequence;
|
Uint8 sequence;
|
||||||
|
Reference in New Issue
Block a user