Added USB VID/PID information to the SDL test programs
authorSam Lantinga <slouken@libsdl.org>
Thu, 10 Nov 2016 18:53:50 -0800
changeset 105977b2a0f5a4380
parent 10596 0a9eba05187e
child 10598 85f444d7a73d
Added USB VID/PID information to the SDL test programs
test/controllermap.c
test/testgamecontroller.c
test/testjoystick.c
     1.1 --- a/test/controllermap.c	Thu Nov 10 18:53:29 2016 -0800
     1.2 +++ b/test/controllermap.c	Thu Nov 10 18:53:50 2016 -0800
     1.3 @@ -368,6 +368,7 @@
     1.4              SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
     1.5              SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
     1.6              SDL_Log("       guid: %s\n", guid);
     1.7 +            SDL_Log("    VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
     1.8              SDL_JoystickClose(joystick);
     1.9          }
    1.10      }
    1.11 @@ -435,3 +436,5 @@
    1.12  }
    1.13  
    1.14  #endif
    1.15 +
    1.16 +/* vi: set ts=4 sw=4 expandtab: */
     2.1 --- a/test/testgamecontroller.c	Thu Nov 10 18:53:29 2016 -0800
     2.2 +++ b/test/testgamecontroller.c	Thu Nov 10 18:53:50 2016 -0800
     2.3 @@ -276,7 +276,9 @@
     2.4              name = SDL_JoystickNameForIndex(i);
     2.5              description = "Joystick";
     2.6          }
     2.7 -        SDL_Log("%s %d: %s (guid %s)\n", description, i, name ? name : "Unknown", guid);
     2.8 +        SDL_Log("%s %d: %s (guid %s, VID 0x%.4x, PID 0x%.4x)\n",
     2.9 +            description, i, name ? name : "Unknown", guid,
    2.10 +            SDL_JoystickGetDeviceVendor(i), SDL_JoystickGetDeviceProduct(i));
    2.11      }
    2.12      SDL_Log("There are %d game controller(s) attached (%d joystick(s))\n", nController, SDL_NumJoysticks());
    2.13  
    2.14 @@ -348,3 +350,5 @@
    2.15  }
    2.16  
    2.17  #endif
    2.18 +
    2.19 +/* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/test/testjoystick.c	Thu Nov 10 18:53:29 2016 -0800
     3.2 +++ b/test/testjoystick.c	Thu Nov 10 18:53:50 2016 -0800
     3.3 @@ -274,6 +274,7 @@
     3.4              SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
     3.5              SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
     3.6              SDL_Log("       guid: %s\n", guid);
     3.7 +            SDL_Log("    VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
     3.8              SDL_JoystickClose(joystick);
     3.9          }
    3.10      }
    3.11 @@ -344,3 +345,5 @@
    3.12  }
    3.13  
    3.14  #endif
    3.15 +
    3.16 +/* vi: set ts=4 sw=4 expandtab: */