NDEVR
API Documentation
DS5State.h
1#pragma once
2
3#define DS5W_ISTATE_BTX_SQUARE 0x10
4#define DS5W_ISTATE_BTX_CROSS 0x20
5#define DS5W_ISTATE_BTX_CIRCLE 0x40
6#define DS5W_ISTATE_BTX_TRIANGLE 0x80
7#define DS5W_ISTATE_DPAD_LEFT 0x01
8#define DS5W_ISTATE_DPAD_DOWN 0x02
9#define DS5W_ISTATE_DPAD_RIGHT 0x04
10#define DS5W_ISTATE_DPAD_UP 0x08
11
12#define DS5W_ISTATE_BTN_A_LEFT_BUMPER 0x01
13#define DS5W_ISTATE_BTN_A_RIGHT_BUMPER 0x02
14#define DS5W_ISTATE_BTN_A_LEFT_TRIGGER 0x04
15#define DS5W_ISTATE_BTN_A_RIGHT_TRIGGER 0x08
16#define DS5W_ISTATE_BTN_A_SELECT 0x10
17#define DS5W_ISTATE_BTN_A_MENU 0x20
18#define DS5W_ISTATE_BTN_A_LEFT_STICK 0x40
19#define DS5W_ISTATE_BTN_A_RIGHT_STICK 0x80
20
21#define DS5W_ISTATE_BTN_B_PLAYSTATION_LOGO 0x01
22#define DS5W_ISTATE_BTN_B_PAD_BUTTON 0x02
23#define DS5W_ISTATE_BTN_B_MIC_BUTTON 0x04
24#define DS5W_ISTATE_BTN_B_LEFT_EDGE_BUTTON 16
25#define DS5W_ISTATE_BTN_B_RIGHT_EDGE_BUTTON 32
26#define DS5W_ISTATE_BTN_B_LEFT_EDGE_TRIGGER 64
27#define DS5W_ISTATE_BTN_B_RIGHT_EDGE_TRIGGER 128
28
29#define DS5W_OSTATE_PLAYER_LED_LEFT 0x01
30#define DS5W_OSTATE_PLAYER_LED_MIDDLE_LEFT 0x02
31#define DS5W_OSTATE_PLAYER_LED_MIDDLE 0x04
32#define DS5W_OSTATE_PLAYER_LED_MIDDLE_RIGHT 0x08
33#define DS5W_OSTATE_PLAYER_LED_RIGHT 0x10
34namespace NDEVR
35{
36 namespace DS5W {
37
41 typedef struct _AnalogStick {
45 char x;
46
50 char y;
51 } AnalogStick;
52
56 typedef struct _Vec3 {
57 short x;
58 short y;
59 short z;
60 } Vector3, Vec3;
61
65 typedef struct _Color {
66 unsigned char r;
67 unsigned char g;
68 unsigned char b;
69 } Color;
70
74 typedef struct _Touch {
78 unsigned int x;
79
83 unsigned int y;
84
88 bool down;
89
93 unsigned char id;
94 } Touch;
95
96 typedef struct _Battery {
100 bool chargin;
101
105 bool fullyCharged;
106
110 unsigned char level;
111 }Battery;
112
116 typedef enum class _MicLed : unsigned char {
120 OFF = 0x00,
121
125 ON = 0x01,
126
130 PULSE = 0x02,
131 } MicLed;
132
136 typedef enum class _TriggerEffectType : unsigned char {
140 NoResitance = 0x00,
141
145 ContinuousResitance = 0x01,
146
150 SectionResitance = 0x02,
151
155 EffectEx = 0x26,
156
160 Calibrate = 0xFC,
161 } TriggerEffectType;
162
166 typedef struct _TriggerEffect {
170 TriggerEffectType effectType;
171
175 union {
179 unsigned char _u1_raw[6];
180
184 struct {
188 unsigned char startPosition;
189
193 unsigned char force;
194
198 unsigned char _pad[4];
200
204 struct {
208 unsigned char startPosition;
209
213 unsigned char endPosition;
214
218 unsigned char _pad[4];
220
224 struct {
228 unsigned char startPosition;
229
234
238 unsigned char beginForce;
239
243 unsigned char middleForce;
244
248 unsigned char endForce;
249
253 unsigned char frequency;
255 };
256 } TriggerEffect;
257
261 typedef enum _LedBrightness : unsigned char {
265 LOW = 0x02,
266
270 MEDIUM = 0x01,
271
275 HIGH = 0x00,
276 } LedBrightness;
277
281 typedef struct _PlayerLeds {
285 unsigned char bitmask;
286
291
295 LedBrightness brightness;
296 } PlayerLeds;
297
301 typedef struct _DS5InputState {
305 AnalogStick leftStick;
306
310 AnalogStick rightStick;
311
315 unsigned char leftTrigger;
316
320 unsigned char rightTrigger;
321
325 unsigned char buttonsAndDpad;
326
330 unsigned char buttonsA;
331
335 unsigned char buttonsB;
336 unsigned char buttonsC;
337
342
346 Vector3 gyroscope;
347
352
357
361 Battery battery;
362
367
371 unsigned char leftTriggerFeedback;
372
376 unsigned char rightTriggerFeedback;
377 } DS5InputState;
378
379 typedef struct _DS5OutputState {
383 unsigned char leftRumble;
384
388 unsigned char rightRumble;
389
393 MicLed microphoneLed;
394
398 bool disableLeds;
399
403 PlayerLeds playerLeds;
404
408 Color lightbar;
409
413 TriggerEffect leftTriggerEffect;
414
418 TriggerEffect rightTriggerEffect;
419
420 } DS5OutputState;
421 }
422}
A device which has an associated voltage or percent that changes.
Definition Battery.h:106
The primary namespace for the NDEVR SDK.
Analog stick.
Definition DS5State.h:41
char x
X Position of stick (0 = Center).
Definition DS5State.h:45
char y
Y Posistion of stick (0 = Center).
Definition DS5State.h:50
RGB Color.
Definition DS5State.h:65
Input state of the controler.
Definition DS5State.h:301
Touch touchPoint2
Second touch point.
Definition DS5State.h:356
Vector3 accelerometer
Accelerometer.
Definition DS5State.h:341
unsigned char buttonsB
Button bitmask B (DS5W_ISTATE_BTN_B_?
Definition DS5State.h:335
Touch touchPoint1
First touch point.
Definition DS5State.h:351
Battery battery
Battery information.
Definition DS5State.h:361
bool headPhoneConnected
Indicates the connection of headphone.
Definition DS5State.h:366
unsigned char leftTriggerFeedback
EXPERIMAENTAL: Feedback of the left adaptive trigger (only when trigger effect is active).
Definition DS5State.h:371
unsigned char rightTrigger
Right trigger position.
Definition DS5State.h:320
unsigned char buttonsAndDpad
Buttons and dpad bitmask DS5W_ISTATE_BTX_?
Definition DS5State.h:325
AnalogStick leftStick
Position of left stick.
Definition DS5State.h:305
unsigned char leftTrigger
Left trigger position.
Definition DS5State.h:315
Vector3 gyroscope
Gyroscope (Currently only raw values will be dispayed!
Definition DS5State.h:346
unsigned char buttonsA
Button bitmask A (DS5W_ISTATE_BTN_A_?
Definition DS5State.h:330
unsigned char rightTriggerFeedback
EXPERIMAENTAL: Feedback of the right adaptive trigger (only when trigger effect is active).
Definition DS5State.h:376
AnalogStick rightStick
Posisiton of right stick.
Definition DS5State.h:310
Player leds values.
Definition DS5State.h:281
unsigned char bitmask
Player indication leds bitflag (You may used them for other features) DS5W_OSTATE_PLAYER_LED_?
Definition DS5State.h:285
bool playerLedFade
Indicates weather the player leds should fade in.
Definition DS5State.h:290
LedBrightness brightness
Brightness of the player leds.
Definition DS5State.h:295
Touchpad state.
Definition DS5State.h:74
unsigned char id
7-bit ID for touch
Definition DS5State.h:93
unsigned int x
X positon of finger (~ 0 - 2000).
Definition DS5State.h:78
unsigned int y
Y position of finger (~ 0 - 2048).
Definition DS5State.h:83
bool down
Touch is down.
Definition DS5State.h:88
Trigger effect.
Definition DS5State.h:166
unsigned char _u1_raw[6]
Union one raw data.
Definition DS5State.h:179
unsigned char beginForce
Force applied when trigger >= (255 / 2).
Definition DS5State.h:238
TriggerEffectType effectType
Trigger effect type.
Definition DS5State.h:170
unsigned char middleForce
Force applied when trigger <= (255 / 2).
Definition DS5State.h:243
unsigned char _pad[4]
PAD / UNUSED.
Definition DS5State.h:198
unsigned char startPosition
Start position of resistance.
Definition DS5State.h:188
unsigned char endForce
Force applied when trigger is beyond 255.
Definition DS5State.h:248
struct DS5W::_TriggerEffect::@162233150075310236160064123377010261171115306337::@234377302004106317335176241164105046206217215002 Section
For type == SectionResitance.
unsigned char force
Force of resistance.
Definition DS5State.h:193
struct DS5W::_TriggerEffect::@162233150075310236160064123377010261171115306337::@342015003134135267304116130355217326074135011330 Continuous
For type == ContinuousResitance.
unsigned char endPosition
End position of resistance (>= start).
Definition DS5State.h:213
bool keepEffect
Wher the effect should keep playing when trigger goes beyond 255.
Definition DS5State.h:233
unsigned char frequency
Vibration frequency of the trigger.
Definition DS5State.h:253
struct DS5W::_TriggerEffect::@162233150075310236160064123377010261171115306337::@356105035322016271067102240223045153206330223333 EffectEx
For type == EffectEx.
3 Component vector
Definition DS5State.h:56