src/joystick/hidapi/SDL_hidapi_xboxone.c
changeset 13344 0532eba8e423
parent 13330 c88765bcf1da
child 13348 448528dc13da
equal deleted inserted replaced
13343:bf120d8c7ff7 13344:0532eba8e423
    69  * This packet is required for all Xbox One pads with 2015
    69  * This packet is required for all Xbox One pads with 2015
    70  * or later firmware installed (or present from the factory).
    70  * or later firmware installed (or present from the factory).
    71  */
    71  */
    72 static const Uint8 xboxone_fw2015_init[] = {
    72 static const Uint8 xboxone_fw2015_init[] = {
    73     0x05, 0x20, 0x00, 0x01, 0x00
    73     0x05, 0x20, 0x00, 0x01, 0x00
       
    74 };
       
    75 
       
    76 /*
       
    77  * This packet turns on the LED on some controllers, including PowerA
       
    78  */
       
    79 static const Uint8 xboxone_led_enable[] = {
       
    80     0x0A, 0x20, 0x04, 0x03, 0x00, 0x01, 0x14
    74 };
    81 };
    75 
    82 
    76 /*
    83 /*
    77  * This packet is required for the Titanfall 2 Xbox One pads
    84  * This packet is required for the Titanfall 2 Xbox One pads
    78  * (0x0e6f:0x0165) to finish initialization and for Hori pads
    85  * (0x0e6f:0x0165) to finish initialization and for Hori pads
   143     { 0x045e, 0x0b00, xboxone_elite_init2, sizeof(xboxone_elite_init2) },
   150     { 0x045e, 0x0b00, xboxone_elite_init2, sizeof(xboxone_elite_init2) },
   144     { 0x045e, 0x0b00, xboxone_elite_init3, sizeof(xboxone_elite_init3) },
   151     { 0x045e, 0x0b00, xboxone_elite_init3, sizeof(xboxone_elite_init3) },
   145     { 0x045e, 0x0b00, xboxone_elite_init4, sizeof(xboxone_elite_init4) },
   152     { 0x045e, 0x0b00, xboxone_elite_init4, sizeof(xboxone_elite_init4) },
   146     { 0x045e, 0x0b00, xboxone_elite_init5, sizeof(xboxone_elite_init5) },
   153     { 0x045e, 0x0b00, xboxone_elite_init5, sizeof(xboxone_elite_init5) },
   147     { 0x0000, 0x0000, xboxone_fw2015_init, sizeof(xboxone_fw2015_init) },
   154     { 0x0000, 0x0000, xboxone_fw2015_init, sizeof(xboxone_fw2015_init) },
       
   155     { 0x0000, 0x0000, xboxone_led_enable, sizeof(xboxone_led_enable) },
   148     { 0x0e6f, 0x0000, xboxone_pdp_init1, sizeof(xboxone_pdp_init1) },
   156     { 0x0e6f, 0x0000, xboxone_pdp_init1, sizeof(xboxone_pdp_init1) },
   149     { 0x0e6f, 0x0000, xboxone_pdp_init2, sizeof(xboxone_pdp_init2) },
   157     { 0x0e6f, 0x0000, xboxone_pdp_init2, sizeof(xboxone_pdp_init2) },
   150     { 0x24c6, 0x541a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
   158     { 0x24c6, 0x0000, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
   151     { 0x24c6, 0x542a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
   159     { 0x24c6, 0x0000, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
   152     { 0x24c6, 0x543a, xboxone_rumblebegin_init, sizeof(xboxone_rumblebegin_init) },
       
   153     { 0x24c6, 0x541a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
       
   154     { 0x24c6, 0x542a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
       
   155     { 0x24c6, 0x543a, xboxone_rumbleend_init, sizeof(xboxone_rumbleend_init) },
       
   156 };
   160 };
   157 
   161 
   158 typedef struct {
   162 typedef struct {
   159     Uint16 vendor_id;
   163     Uint16 vendor_id;
   160     Uint16 product_id;
   164     Uint16 product_id;