/* DualSenseWindows API https://github.com/mattdevv/DualSense-Windows Licensed under the MIT License (To be found in repository root directory) */ #pragma once #include #include #include #include namespace DS5W { /// /// Enumerate all ds5 deviced connected to the computer /// /// Pointer to begin of array of DeviceEnumInfo objects / DeviceEnumInfo pointers /// Length of imput array /// pointer to uint witch recives the required total length /// DeviceEnumInfo pointer is the pointer to an array of DeviceEnumInfo objects. false: DeviceEnumInfo pointer is a pointer to DeviceEnumInfo pointers to DeviceEnumInfo objects /// DS5W Return value extern "C" DS5W_API DS5W_ReturnValue enumDevices(void* ptrBuffer, unsigned int inArrLength, unsigned int* requiredLength, bool pointerToArray = true); /// /// Enumerate all ds5 deviced that are not in the list of known devices /// Devices are 'known' if their unique ID is in the array passed to this function /// /// Pointer to begin of array of unused DeviceEnumInfo objects / DeviceEnumInfo pointers /// Length of input array /// pointer to array of known device IDs /// length of knownDeviceIDs array /// pointer to uint witch recives the required total length /// DeviceEnumInfo pointer is the pointer to an array of DeviceEnumInfo objects. false: DeviceEnumInfo pointer is a pointer to DeviceEnumInfo pointers to DeviceEnumInfo objects /// DS5W Return value extern "C" DS5W_API DS5W_ReturnValue enumUnknownDevices(void* ptrBuffer, unsigned int inArrLength, unsigned int* knownDeviceIDs, unsigned int numKnownDevices, unsigned int* requiredLength, bool pointerToArray = true); /// /// Initializes a DeviceContext from its enum infos /// /// Pointer to enum object to create device from /// Pointer to context to create to /// If creation was successfull extern "C" DS5W_API DS5W_ReturnValue initDeviceContext(DS5W::DeviceEnumInfo* ptrEnumInfo, DS5W::DeviceContext* ptrContext); /// /// Stop device functions and free all links in Windows /// This context will not be able to be reconnected /// /// Pointer to context extern "C" DS5W_API void freeDeviceContext(DS5W::DeviceContext* ptrContext); /// /// Stop device functions and disconnect device from windows /// This context is able to be reconnected /// /// Context to shutdown extern "C" DS5W_API void shutdownDevice(DS5W::DeviceContext * ptrContext); /// /// Try to reconnect a disconnected device /// /// Context to reconnect on /// Result extern "C" DS5W_API DS5W_ReturnValue reconnectDevice(DS5W::DeviceContext* ptrContext); /// /// Get device input state /// Blocks thread until state is read or an error occurs /// /// Pointer to context /// Pointer to input state /// Result of call extern "C" DS5W_API DS5W_ReturnValue getDeviceInputState(DS5W::DeviceContext* ptrContext, DS5W::DS5InputState* ptrInputState); /// /// Set the device output state /// Blocks thread until state is read or an error occurs /// /// Pointer to context /// Pointer to output state to be set /// Result of call extern "C" DS5W_API DS5W_ReturnValue setDeviceOutputState(DS5W::DeviceContext* ptrContext, DS5W::DS5OutputState* ptrOutputState); /// /// Starts an overlapped IO call to get device input report /// extern "C" DS5W_API DS5W_ReturnValue startInputRequest(DS5W::DeviceContext* ptrContext); /// /// Waits until overlapped call finishes /// Only call this if startInputRequest() returned DS5W_E_IO_PENDING /// extern "C" DS5W_API DS5W_ReturnValue awaitInputRequest(DS5W::DeviceContext* ptrContext); /// /// Parses and copies the last input report read into an InputState struct /// Intended to be used with startInputRequest() after the request is completed /// extern "C" DS5W_API void getHeldInputState(DS5W::DeviceContext * ptrContext, DS5W::DS5InputState * ptrInputState); }