Removed Bluetooth connection detection now that we get it from hidapi

main
Sam Lantinga 2023-06-23 15:50:07 -07:00
parent 44bae1e8a9
commit 267fdd7daa
3 changed files with 0 additions and 18 deletions

View File

@ -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",
data[6], data[5], data[4], data[3], data[2], data[1]);
}
device->is_bluetooth = SDL_FALSE;
ctx->enhanced_mode = SDL_TRUE;
} 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;
} 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])) {
(void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
data[6], data[5], data[4], data[3], data[2], data[1]);
device->is_bluetooth = SDL_FALSE;
ctx->enhanced_mode = SDL_TRUE;
} else {
device->is_bluetooth = SDL_TRUE;
/* Read a report to see if we're in enhanced mode */
size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 16);
#ifdef DEBUG_PS4_PROTOCOL
@ -309,12 +304,8 @@ static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device)
}
} else {
/* Third party controllers appear to all be wired */
device->is_bluetooth = SDL_FALSE;
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));
/* 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 */
ctx->vibration_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);

View File

@ -382,15 +382,12 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
#endif
if (size == 64) {
/* Connected over USB */
device->is_bluetooth = SDL_FALSE;
ctx->enhanced_mode = SDL_TRUE;
} else if (size > 0 && data[0] == k_EPS5ReportIdBluetoothEffects) {
/* Connected over Bluetooth, using enhanced reports */
device->is_bluetooth = SDL_TRUE;
ctx->enhanced_mode = SDL_TRUE;
} else {
/* 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
SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, but they did know SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.

View File

@ -117,7 +117,6 @@ typedef struct
SDL_HIDAPI_Device *device;
Uint16 vendor_id;
Uint16 product_id;
SDL_bool bluetooth;
SDL_XboxOneInitState init_state;
Uint64 start_time;
Uint8 sequence;