diff --git a/_x_b_o_x_o_n_e_s_b_t_8h_source.html b/_x_b_o_x_o_n_e_s_b_t_8h_source.html
index e09374cd..d5152247 100644
--- a/_x_b_o_x_o_n_e_s_b_t_8h_source.html
+++ b/_x_b_o_x_o_n_e_s_b_t_8h_source.html
@@ -63,22 +63,21 @@ $(function() {
-
Go to the documentation of this file. 18 #ifndef _xboxonesbt_h_ 19 #define _xboxonesbt_h_ 79 virtual void sendOutputReport(uint8_t *data, uint8_t nbytes) {
81 uint8_t buf[nbytes + 2];
86 memcpy(buf + 2, data, nbytes);
89 for (uint8_t i = 0; i <
sizeof(buf); i++) {
90 D_PrintHex<uint8_t > (buf[i], 0x80);
+
Go to the documentation of this file. 18 #ifndef _xboxonesbt_h_ 19 #define _xboxonesbt_h_ 80 uint8_t buf[nbytes + 2];
83 memcpy(buf + 2, data, nbytes);
virtual void ParseBTHIDData(uint8_t len, uint8_t *buf)
+
uint8_t interrupt_scid[2]
+
virtual void sendOutputReport(uint8_t *data, uint8_t nbytes)
virtual void ResetBTHID()
-
-
void Parse(uint8_t len, uint8_t *buf)
XBOXONESBT(BTD *p, bool pair=false)
void(* pFuncOnInit)(void)
-
diff --git a/_x_b_o_x_o_n_e_s_parser_8cpp_source.html b/_x_b_o_x_o_n_e_s_parser_8cpp_source.html
index 3dc2ef51..5de2cd9d 100644
--- a/_x_b_o_x_o_n_e_s_parser_8cpp_source.html
+++ b/_x_b_o_x_o_n_e_s_parser_8cpp_source.html
@@ -63,7 +63,7 @@ $(function() {
XBOXONESParser.cpp
-
Go to the documentation of this file. 80 return xboxButtonState;
97 }
else if (b ==
XBOX) {
98 bool click = xboxbuttonClickState;
99 xboxbuttonClickState = 0;
103 bool click = buttonClickState.
val & mask;
104 buttonClickState.
val &= ~mask;
109 return xboxOneSData.
hatValue[(uint8_t)a] - 32768;
113 if (len > 1 && buf) {
116 for (uint8_t i = 0; i < len; i++) {
117 D_PrintHex<uint8_t > (buf[i], 0x80);
123 memcpy(&xboxOneSData, buf + 1, min((uint8_t)(len - 1),
MFK_CASTUINT8T sizeof(xboxOneSData)));
124 else if (buf[0] == 0x02) {
125 xboxButtonState = buf[1];
126 if(xboxButtonState != xboxOldButtonState) {
127 xboxbuttonClickState = xboxButtonState & ~xboxOldButtonState;
128 xboxOldButtonState = xboxButtonState;
131 }
else if (buf[0] == 0x04)
134 #ifdef DEBUG_USB_HOST 135 Notify(
PSTR(
"\r\nUnknown report id: "), 0x80);
136 D_PrintHex<uint8_t > (buf[0], 0x80);
141 if (xboxOneSData.
btn.
val != oldButtonState.
val) {
142 buttonClickState.
val = xboxOneSData.
btn.
val & ~oldButtonState.
val;
143 oldButtonState.
val = xboxOneSData.
btn.
val;
149 if (checkDpad(
RIGHT))
150 newDpad |= 1 <<
RIGHT;
152 newDpad |= 1 <<
DOWN;
154 newDpad |= 1 <<
LEFT;
155 if (newDpad != oldDpad) {
156 buttonClickState.
dpad = newDpad & ~oldDpad;
162 if(xboxOneSData.
trigger[0] != 0 && triggerOld[0] == 0)
164 triggerOld[0] = xboxOneSData.
trigger[0];
165 if(xboxOneSData.
trigger[1] != 0 && triggerOld[1] == 0)
167 triggerOld[1] = xboxOneSData.
trigger[1];
173 for (i = 0; i <
sizeof(xboxOneSData.
hatValue) /
sizeof(xboxOneSData.
hatValue[0]); i++)
176 oldButtonState.
val = 0;
177 for (i = 0; i <
sizeof(xboxOneSData.
trigger) /
sizeof(xboxOneSData.
trigger[0]); i++)
182 buttonClickState.
dpad = 0;
187 void XBOXONESParser::setRumbleOn(uint8_t leftTrigger, uint8_t rightTrigger, uint8_t leftMotor, uint8_t rightMotor) {
191 buf[1] = leftTrigger;
192 buf[2] = rightTrigger;
198 sendOutputReport(buf,
sizeof(buf));
+
Go to the documentation of this file. 80 return xboxButtonState;
97 }
else if (b ==
XBOX) {
98 bool click = xboxbuttonClickState;
99 xboxbuttonClickState = 0;
103 bool click = buttonClickState.
val & mask;
104 buttonClickState.
val &= ~mask;
109 return xboxOneSData.
hatValue[(uint8_t)a] - 32768;
113 if (len > 1 && buf) {
116 for (uint8_t i = 0; i < len; i++) {
117 D_PrintHex<uint8_t > (buf[i], 0x80);
123 memcpy(&xboxOneSData, buf + 1, min((uint8_t)(len - 1),
MFK_CASTUINT8T sizeof(xboxOneSData)));
124 else if (buf[0] == 0x02) {
125 xboxButtonState = buf[1];
126 if(xboxButtonState != xboxOldButtonState) {
127 xboxbuttonClickState = xboxButtonState & ~xboxOldButtonState;
128 xboxOldButtonState = xboxButtonState;
131 }
else if (buf[0] == 0x04)
134 #ifdef DEBUG_USB_HOST 135 Notify(
PSTR(
"\r\nUnknown report id: "), 0x80);
136 D_PrintHex<uint8_t > (buf[0], 0x80);
141 if (xboxOneSData.
btn.
val != oldButtonState.
val) {
142 buttonClickState.
val = xboxOneSData.
btn.
val & ~oldButtonState.
val;
143 oldButtonState.
val = xboxOneSData.
btn.
val;
149 if (checkDpad(
RIGHT))
150 newDpad |= 1 <<
RIGHT;
152 newDpad |= 1 <<
DOWN;
154 newDpad |= 1 <<
LEFT;
155 if (newDpad != oldDpad) {
156 buttonClickState.
dpad = newDpad & ~oldDpad;
162 if(xboxOneSData.
trigger[0] != 0 && triggerOld[0] == 0)
164 triggerOld[0] = xboxOneSData.
trigger[0];
165 if(xboxOneSData.
trigger[1] != 0 && triggerOld[1] == 0)
167 triggerOld[1] = xboxOneSData.
trigger[1];
173 for (i = 0; i <
sizeof(xboxOneSData.
hatValue) /
sizeof(xboxOneSData.
hatValue[0]); i++)
176 oldButtonState.
val = 0;
177 for (i = 0; i <
sizeof(xboxOneSData.
trigger) /
sizeof(xboxOneSData.
trigger[0]); i++)
182 buttonClickState.
dpad = 0;
203 buf[0] = 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0 ;
204 buf[1] = leftTrigger;
205 buf[2] = rightTrigger;
bool getButtonClick(ButtonEnum b)
@@ -72,13 +72,16 @@ $(function() {
int16_t getAnalogHat(AnalogHatEnum a)
#define pgm_read_byte(addr)
+
virtual void sendOutputReport(uint8_t *data, uint8_t nbytes)=0
+
void setRumbleOn(uint8_t leftTrigger, uint8_t rightTrigger, uint8_t leftMotor, uint8_t rightMotor)
uint16_t getButtonPress(ButtonEnum b)
+
void Parse(uint8_t len, uint8_t *buf)
diff --git a/_x_b_o_x_o_n_e_s_parser_8h_source.html b/_x_b_o_x_o_n_e_s_parser_8h_source.html
index af89b6b8..c1273626 100644
--- a/_x_b_o_x_o_n_e_s_parser_8h_source.html
+++ b/_x_b_o_x_o_n_e_s_parser_8h_source.html
@@ -63,7 +63,7 @@ $(function() {
XBOXONESParser.h
-
Go to the documentation of this file. 18 #ifndef _xboxonesparser_h_ 19 #define _xboxonesparser_h_ 42 } __attribute__((packed));
44 } __attribute__((packed));
51 } __attribute__((packed));
101 void Parse(uint8_t len, uint8_t *buf);
121 uint8_t xboxButtonState, xboxOldButtonState, xboxbuttonClickState;
123 uint16_t triggerOld[2];
+
Go to the documentation of this file. 18 #ifndef _xboxonesparser_h_ 19 #define _xboxonesparser_h_ 42 } __attribute__((packed));
44 } __attribute__((packed));
51 } __attribute__((packed));
93 void setRumbleOn(uint8_t leftTrigger, uint8_t rightTrigger, uint8_t leftMotor, uint8_t rightMotor);
101 void Parse(uint8_t len, uint8_t *buf);
111 virtual void sendOutputReport(uint8_t *data, uint8_t nbytes) = 0;
121 uint8_t xboxButtonState, xboxOldButtonState, xboxbuttonClickState;
123 uint16_t triggerOld[2];
diff --git a/class_x_b_o_x_o_n_e_s_b_t-members.html b/class_x_b_o_x_o_n_e_s_b_t-members.html
index 76dd01ef..82bf70a4 100644
--- a/class_x_b_o_x_o_n_e_s_b_t-members.html
+++ b/class_x_b_o_x_o_n_e_s_b_t-members.html
@@ -97,12 +97,15 @@ $(function() {
ResetBTHID() | XBOXONESBT | inlineprotectedvirtual |
Run() | BTHID | protectedvirtual |
sdp_scid | BTHID | protected |
-
setLeds(struct KBDLEDS data) | BTHID | inline |
-
setLeds(uint8_t data) | BTHID | |
-
setProtocolMode(uint8_t mode) | BTHID | inline |
-
SetReportParser(uint8_t id, HIDReportParser *prs) | BTHID | inline |
-
XBOXONESBT(BTD *p, bool pair=false) | XBOXONESBT | inline |
-
XBOXONESParser() | XBOXONESParser | inline |
+
sendOutputReport(uint8_t *data, uint8_t nbytes) | XBOXONESBT | inlineprotectedvirtual |
+
setLeds(struct KBDLEDS data) | BTHID | inline |
+
setLeds(uint8_t data) | BTHID | |
+
setProtocolMode(uint8_t mode) | BTHID | inline |
+
SetReportParser(uint8_t id, HIDReportParser *prs) | BTHID | inline |
+
setRumbleOff() | XBOXONESParser | |
+
setRumbleOn(uint8_t leftTrigger, uint8_t rightTrigger, uint8_t leftMotor, uint8_t rightMotor) | XBOXONESParser | |
+
XBOXONESBT(BTD *p, bool pair=false) | XBOXONESBT | inline |
+
XBOXONESParser() | XBOXONESParser | inline |
+
+
+
◆ sendOutputReport()
+
+
+
+
+
+
+
+
+ virtual void XBOXONESBT::sendOutputReport |
+ ( |
+ uint8_t * |
+ data, |
+
+
+ |
+ |
+ uint8_t |
+ nbytes |
+
+
+ |
+ ) |
+ | |
+
+
+ |
+
+inlineprotectedvirtual |
+
+
+
+
Send the output to the Xbox One S controller. This is implemented in XBOXONESBT.h.
- Parameters
-
+
+ output | Pointer to data buffer. |
+ nbytes | Bytes to send. |
+
+
+
+
+
Implements XBOXONESParser.
+
+
Definition at line 78 of file XBOXONESBT.h.
+
The documentation for this class was generated from the following file:
+
@@ -84,6 +84,10 @@ Public Member Functions
|
int16_t | getAnalogHat (AnalogHatEnum a) |
|
+
void | setRumbleOff () |
+
|
+
void | setRumbleOn (uint8_t leftTrigger, uint8_t rightTrigger, uint8_t leftMotor, uint8_t rightMotor) |
+
|
|
uint16_t | getButtonPress (ButtonEnum b) |
|
@@ -96,6 +100,8 @@ Protected Member Functions
|
void | Reset () |
|
+
virtual void | sendOutputReport (uint8_t *data, uint8_t nbytes)=0 |
+
|
This class parses all the data sent by the Xbox One S controller
@@ -214,6 +220,77 @@ Protected Member Functions
Definition at line 108 of file XBOXONESParser.cpp.
+
+
+