Fixed trying to use the HIDAPI driver for the original Xbox One S Bluetooth controller
authorSam Lantinga <slouken@libsdl.org>
Thu, 28 Nov 2019 11:44:17 -0800
changeset 13303d157196c9c35
parent 13302 e66b77697cd4
child 13304 b393fb36e61a
Fixed trying to use the HIDAPI driver for the original Xbox One S Bluetooth controller
src/joystick/hidapi/SDL_hidapi_xboxone.c
     1.1 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c	Thu Nov 28 11:44:15 2019 -0800
     1.2 +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c	Thu Nov 28 11:44:17 2019 -0800
     1.3 @@ -171,11 +171,16 @@
     1.4  {
     1.5      /* Check to see if it's the Xbox One S or Xbox One Elite Series 2 in Bluetooth mode */
     1.6      const Uint16 USB_VENDOR_MICROSOFT = 0x045e;
     1.7 -    const Uint16 USB_PRODUCT_XBOX_ONE_S = 0x02fd;
     1.8 +    const Uint16 USB_PRODUCT_XBOX_ONE_S_REV1 = 0x02e0;
     1.9 +    const Uint16 USB_PRODUCT_XBOX_ONE_S_REV2 = 0x02fd;
    1.10      const Uint16 USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2 = 0x0b05;
    1.11  
    1.12 -    if (vendor_id == USB_VENDOR_MICROSOFT && (product_id == USB_PRODUCT_XBOX_ONE_S || product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2)) {
    1.13 -        return SDL_TRUE;
    1.14 +    if (vendor_id == USB_VENDOR_MICROSOFT) {
    1.15 +        if (product_id == USB_PRODUCT_XBOX_ONE_S_REV1 ||
    1.16 +            product_id == USB_PRODUCT_XBOX_ONE_S_REV2 ||
    1.17 +            product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2) {
    1.18 +            return SDL_TRUE;
    1.19 +        }
    1.20      }
    1.21      return SDL_FALSE;
    1.22  }