USB Host Shield 2.0
Public Member Functions | List of all members
XBOXONESBT Class Reference

#include <XBOXONESBT.h>

Inheritance diagram for XBOXONESBT:
Inheritance graph
[legend]
Collaboration diagram for XBOXONESBT:
Collaboration graph
[legend]

Public Member Functions

 XBOXONESBT (BTD *p, bool pair=false)
 
bool connected ()
 
- Public Member Functions inherited from BTHID
 BTHID (BTD *p, bool pair=false, const char *pin="0000")
 
HIDReportParserGetReportParser (uint8_t id)
 
bool SetReportParser (uint8_t id, HIDReportParser *prs)
 
void setProtocolMode (uint8_t mode)
 
void pair (void)
 
uint32_t getLastMessageTime ()
 
void setLeds (struct KBDLEDS data)
 
void setLeds (uint8_t data)
 
void disconnect ()
 
- Public Member Functions inherited from BluetoothService
 BluetoothService (BTD *p)
 
void attachOnInit (void(*funcOnInit)(void))
 
- Public Member Functions inherited from XBOXONESParser
 XBOXONESParser ()
 
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)
 
bool getButtonClick (ButtonEnum b)
 

Protected Member Functions

BTHID implementation
virtual void ParseBTHIDData (uint8_t len, uint8_t *buf)
 
virtual void OnInitBTHID ()
 
virtual void ResetBTHID ()
 
XBOXONESParser implementation
virtual void sendOutputReport (uint8_t *data, uint8_t nbytes)
 
- Protected Member Functions inherited from BTHID
virtual void ParseBTHIDControlData (uint8_t len, uint8_t *buf)
 
void ACLData (uint8_t *ACLData)
 
void Run ()
 
void Reset ()
 
void onInit ()
 
- Protected Member Functions inherited from BluetoothService
bool checkHciHandle (uint8_t *buf, uint16_t handle)
 
- Protected Member Functions inherited from XBOXONESParser
void Parse (uint8_t len, uint8_t *buf)
 
void Reset ()
 

Additional Inherited Members

- Public Attributes inherited from BTHID
bool connected
 
- Protected Attributes inherited from BTHID
uint8_t control_scid [2]
 
uint8_t interrupt_scid [2]
 
uint8_t l2cap_sdp_state
 
uint8_t sdp_scid [2]
 
- Protected Attributes inherited from BluetoothService
void(* pFuncOnInit )(void)
 
BTDpBtd
 
uint16_t hci_handle
 
uint32_t l2cap_event_flag
 
uint8_t identifier
 

Detailed Description

This class implements support for the Xbox One S controller via Bluetooth. It uses the BTHID class for all the Bluetooth communication.

Definition at line 28 of file XBOXONESBT.h.

Constructor & Destructor Documentation

◆ XBOXONESBT()

XBOXONESBT::XBOXONESBT ( BTD p,
bool  pair = false 
)
inline

Constructor for the XBOXONESBT class.

Parameters
pPointer to the BTD class instance.
pairSet this to true in order to pair with the device. If the argument is omitted then it will not pair with it. One can use PAIR to set it to true.

Definition at line 35 of file XBOXONESBT.h.

Member Function Documentation

◆ connected()

bool XBOXONESBT::connected ( )
inline

Used to check if a Xbox One S controller is connected.

Returns
Returns true if it is connected.

Definition at line 45 of file XBOXONESBT.h.

◆ ParseBTHIDData()

virtual void XBOXONESBT::ParseBTHIDData ( uint8_t  len,
uint8_t *  buf 
)
inlineprotectedvirtual

Used to parse Bluetooth HID data.

Parameters
lenThe length of the incoming data.
bufPointer to the data buffer.

Reimplemented from BTHID.

Definition at line 56 of file XBOXONESBT.h.

◆ OnInitBTHID()

virtual void XBOXONESBT::OnInitBTHID ( )
inlineprotectedvirtual

Called when a device is successfully initialized. Use attachOnInit(void (*funcOnInit)(void)) to call your own function. This is useful for instance if you want to set the LEDs in a specific way.

Reimplemented from BTHID.

Definition at line 65 of file XBOXONESBT.h.

◆ ResetBTHID()

virtual void XBOXONESBT::ResetBTHID ( )
inlineprotectedvirtual

Used to reset the different buffers to there default values

Reimplemented from BTHID.

Definition at line 70 of file XBOXONESBT.h.

◆ 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
outputPointer to data buffer.
nbytesBytes to send.

Implements XBOXONESParser.

Definition at line 76 of file XBOXONESBT.h.


The documentation for this class was generated from the following file: