PXL_RETURN_CODE PxLGetNumberControllers ( CONTROLLER_INFO* pControllerInfo, U32 informationSize, // must be set to sizeof(CONTROLER_INFO) U32* pNumberControllerInfos);
This function can be used to not only determine how many controllers are connected to the host system, but also some information about each of the controllers (similar to PxLGetCameraInfoEx).
pControllerInfo is the pointer to an array of CONTROLLER_INFO structures of the controllers connected to the system. To ignore, set to NULL and the function will return the number of connected controllers (i.e. the required number of array entries for pControllerInfo will be in pNumberControllerInfos).
informationSize is the size of the information, and must be set to sizeof(CONTROLLER_INFO)
pNumberControllerInfos is the pointer to the number of controllers connected (i.e. the number of entries in the array pointed to by pControllerInfo).
Comments, Restrictions and Limitations
Windows only allows one application to have a COM port open at a given time. Consequently, if another application has the COM port of an associated controller open, PxLGetNumberControllers will either contain no information on the controller (if the controller is connected via a serial cable), or indicate that the controller is not currently available, by indicating that it’s serial number id 0, and the TypeMask is NULL (if connected via USB2).
For more information on the Controller Info struct, please see Controller Info.