Skip to content

Update IO.h #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 60 additions & 60 deletions VS19_Solution/DualSenseWindows/include/DualSenseWindows/IO.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*
DualSenseWindows API
https://github.com/Ohjurot/DualSense-Windows
DualSenseWindows API
https://github.com/Ohjurot/DualSense-Windows

MIT License
MIT License

Copyright (c) 2020 Ludwig F�chsl
Copyright (c) 2020 Ludwig Füchsl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/
#pragma once
Expand All @@ -32,50 +32,50 @@
#include <DualSenseWindows/DS5State.h>

namespace DS5W {
/// <summary>
/// Enumerate all ds5 deviced connected to the computer
/// </summary>
/// <param name="ptrBuffer">Pointer to begin of array of DeviceEnumInfo objects / DeviceEnumInfo pointers</param>
/// <param name="inArrLength">Length of imput array</param>
/// <param name="pointerToArray">(Optional) true: DeviceEnumInfo pointer is the pointer to an array of DeviceEnumInfo objects. false: DeviceEnumInfo pointer is a pointer to DeviceEnumInfo pointers to DeviceEnumInfo objects</param>
/// <param name="requiredLength">(Optional) pointer to uint witch recives the required total length</param>
/// <returns>DS5W Return value</returns>
DS5W_API DS5W_ReturnValue enumDevices(void* ptrBuffer, unsigned int inArrLength, unsigned int* ptrLength, bool pointerToArray = true);
/// <summary>
/// Enumerate all DS5 devices connected to the computer
/// </summary>
/// <param name="ptrBuffer">Pointer to begin of array of DeviceEnumInfo objects / DeviceEnumInfo pointers</param>
/// <param name="inArrLength">Length of input array</param>
/// <param name="ptrLength">Pointer to uint which receives the required total length</param>
/// <param name="pointerToArray">(Optional) true: DeviceEnumInfo pointer is the pointer to an array of DeviceEnumInfo objects. false: DeviceEnumInfo pointer is a pointer to DeviceEnumInfo pointers to DeviceEnumInfo objects</param>
/// <returns>DS5W Return value</returns>
DS5W_API DS5W_ReturnValue enumDevices(void* ptrBuffer, unsigned int inArrLength, unsigned int* ptrLength, bool pointerToArray = true);

/// <summary>
/// Initializes a DeviceContext from its enum infos
/// </summary>
/// <param name="ptrEnumInfo">Pointer to enum object to create device from</param>
/// <param name="ptrContext">Pointer to context to create to</param>
/// <returns>If creation was successfull</returns>
DS5W_API DS5W_ReturnValue initDeviceContext(DS5W::DeviceEnumInfo* ptrEnumInfo, DS5W::DeviceContext* ptrContext);
/// <summary>
/// Initializes a DeviceContext from its enum infos
/// </summary>
/// <param name="ptrEnumInfo">Pointer to enum object to create device from</param>
/// <param name="ptrContext">Pointer to context to create to</param>
/// <returns>If creation was successful</returns>
DS5W_API DS5W_ReturnValue initDeviceContext(DS5W::DeviceEnumInfo* ptrEnumInfo, DS5W::DeviceContext* ptrContext);

/// <summary>
/// Free the device conntext
/// </summary>
/// <param name="ptrContext">Pointer to context</param>
DS5W_API void freeDeviceContext(DS5W::DeviceContext* ptrContext);
/// <summary>
/// Free the device context
/// </summary>
/// <param name="ptrContext">Pointer to context</param>
DS5W_API void freeDeviceContext(DS5W::DeviceContext* ptrContext);

/// <summary>
/// Try to reconnect a removed device
/// </summary>
/// <param name="ptrContext">Context to reconnect on</param>
/// <returns>Result</returns>
DS5W_API DS5W_ReturnValue reconnectDevice(DS5W::DeviceContext* ptrContext);
/// <summary>
/// Try to reconnect a removed device
/// </summary>
/// <param name="ptrContext">Context to reconnect on</param>
/// <returns>Result</returns>
DS5W_API DS5W_ReturnValue reconnectDevice(DS5W::DeviceContext* ptrContext);

/// <summary>
/// Get device input state
/// </summary>
/// <param name="ptrContext">Pointer to context</param>
/// <param name="ptrInputState">Pointer to input state</param>
/// <returns>Result of call</returns>
DS5W_API DS5W_ReturnValue getDeviceInputState(DS5W::DeviceContext* ptrContext, DS5W::DS5InputState* ptrInputState);
/// <summary>
/// Get device input state
/// </summary>
/// <param name="ptrContext">Pointer to context</param>
/// <param name="ptrInputState">Pointer to input state</param>
/// <returns>Result of call</returns>
DS5W_API DS5W_ReturnValue getDeviceInputState(DS5W::DeviceContext* ptrContext, DS5W::DS5InputState* ptrInputState);

/// <summary>
/// Set the device output state
/// </summary>
/// <param name="ptrContext">Pointer to context</param>
/// <param name="ptrOutputState">Pointer to output state to be set</param>
/// <returns>Result of call</returns>
DS5W_API DS5W_ReturnValue setDeviceOutputState(DS5W::DeviceContext* ptrContext, DS5W::DS5OutputState* ptrOutputState);
/// <summary>
/// Set the device output state
/// </summary>
/// <param name="ptrContext">Pointer to context</param>
/// <param name="ptrOutputState">Pointer to output state to be set</param>
/// <returns>Result of call</returns>
DS5W_API DS5W_ReturnValue setDeviceOutputState(DS5W::DeviceContext* ptrContext, DS5W::DS5OutputState* ptrOutputState);
}