Skip to content

Update Device.h #38

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
134 changes: 67 additions & 67 deletions VS19_Solution/DualSenseWindows/include/DualSenseWindows/Device.h
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
/*
Device.h is part of DualSenseWindows
https://github.com/Ohjurot/DualSense-Windows
Device.h is part of DualSenseWindows
https://github.com/Ohjurot/DualSense-Windows

Contributors of this file:
11.2020 Ludwig F�chsl
Contributors of this file:
11.2020 Ludwig Füchsl

Licensed under the MIT License (To be found in repository root directory)
Licensed under the MIT License (To be found in repository root directory)
*/
#pragma once

namespace DS5W {
/// <summary>
/// Enum for device connection type
/// </summary>
typedef enum class _DeviceConnection : unsigned char {
/// <summary>
/// Controler is connected via USB
/// </summary>
USB = 0,
/// <summary>
/// Enum for device connection type
/// </summary>
enum class DeviceConnection : unsigned char {
/// <summary>
/// Controller is connected via USB
/// </summary>
USB = 0,

/// <summary>
/// Controler is connected via bluetooth
/// </summary>
BT = 1,
} DeviceConnection;
/// <summary>
/// Controller is connected via Bluetooth
/// </summary>
BT = 1,
};

/// <summary>
/// Struckt for storing device enum info while device discovery
/// </summary>
typedef struct _DeviceEnumInfo {
/// <summary>
/// Encapsulate data in struct to (at least try) prevent user from modifing the context
/// </summary>
struct {
/// <summary>
/// Path to the discovered device
/// </summary>
wchar_t path[260];
/// <summary>
/// Struct for storing device enum info during device discovery
/// </summary>
struct DeviceEnumInfo {
/// <summary>
/// Encapsulate data in struct to (at least try to) prevent user from modifying the context
/// </summary>
struct {
/// <summary>
/// Path to the discovered device
/// </summary>
wchar_t path[260];

/// <summary>
/// Connection type of the discoverd device
/// </summary>
DeviceConnection connection;
} _internal;
} DeviceEnumInfo;
/// <summary>
/// Connection type of the discovered device
/// </summary>
DeviceConnection connection;
} _internal;
};

/// <summary>
/// Device context
/// </summary>
typedef struct _DeviceContext {
/// <summary>
/// Encapsulate data in struct to (at least try) prevent user from modifing the context
/// </summary>
struct {
/// <summary>
/// Path to the device
/// </summary>
wchar_t devicePath[260];
/// <summary>
/// Device context
/// </summary>
struct DeviceContext {
/// <summary>
/// Encapsulate data in struct to (at least try to) prevent user from modifying the context
/// </summary>
struct {
/// <summary>
/// Path to the device
/// </summary>
wchar_t devicePath[260];

/// <summary>
/// Handle to the open device
/// </summary>
void* deviceHandle;
/// <summary>
/// Handle to the open device
/// </summary>
void* deviceHandle;

/// <summary>
/// Connection of the device
/// </summary>
DeviceConnection connection;
/// <summary>
/// Connection of the device
/// </summary>
DeviceConnection connection;

/// <summary>
/// Current state of connection
/// </summary>
bool connected;
/// <summary>
/// Current state of connection
/// </summary>
bool connected;

/// <summary>
/// HID Input buffer (will be allocated by the context init function)
/// </summary>
unsigned char hidBuffer[547];
}_internal;
} DeviceContext;
}
/// <summary>
/// HID Input buffer (will be allocated by the context init function)
/// </summary>
unsigned char hidBuffer[547];
} _internal;
};
}