Commit da50f1bd3eb65adcc1fc673346d0c9b74f055543

Sam Lantinga 2022-08-09T14:05:43

Bluetooth devices can recover from over a second of dropped reports

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index 0779e9b..373d20e 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -2057,7 +2057,7 @@ HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
             WriteProprietary(ctx, k_eSwitchProprietaryCommandIDs_ForceUSB, NULL, 0, SDL_FALSE);
         }
     } else if (ctx->m_bUsingBluetooth) {
-        const Uint32 INPUT_WAIT_TIMEOUT_MS = 1000;
+        const Uint32 INPUT_WAIT_TIMEOUT_MS = 3000;
         if (SDL_TICKS_PASSED(now, ctx->m_unLastInput + INPUT_WAIT_TIMEOUT_MS)) {
             /* Bluetooth may have disconnected, try reopening the controller */
             size = -1;