USB Host Shield 2.0
|
#include <BTHID.h>
Public Member Functions | |
BTHID (BTD *p, bool pair=false, const char *pin="0000") | |
HIDReportParser * | GetReportParser (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) |
![]() | |
BluetoothService (BTD *p) | |
void | attachOnInit (void(*funcOnInit)(void)) |
Public Attributes | |
bool | connected |
Protected Member Functions | |
Overridable functions | |
virtual void | ParseBTHIDData (uint8_t len, uint8_t *buf) |
virtual void | ParseBTHIDControlData (uint8_t len, uint8_t *buf) |
virtual void | OnInitBTHID () |
virtual void | ResetBTHID () |
![]() | |
bool | checkHciHandle (uint8_t *buf, uint16_t handle) |
Protected Attributes | |
uint8_t | control_scid [2] |
uint8_t | interrupt_scid [2] |
uint8_t | l2cap_sdp_state |
uint8_t | sdp_scid [2] |
![]() | |
void(* | pFuncOnInit )(void) |
BTD * | pBtd |
uint16_t | hci_handle |
uint32_t | l2cap_event_flag |
uint8_t | identifier |
BluetoothService implementation | |
void | disconnect () |
void | ACLData (uint8_t *ACLData) |
void | Run () |
void | Reset () |
void | onInit () |
This BluetoothService class implements support for Bluetooth HID devices.
Constructor for the BTHID class.
p | Pointer to the BTD class instance. |
pair | Set 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. |
pin | Write the pin to BTD::btdPin. If argument is omitted, then "0000" will be used. |
|
virtual |
Used this to disconnect the devices.
Implements BluetoothService.
|
inline |
Get HIDReportParser.
id | ID of parser. |
|
inline |
Set HIDReportParser to be used.
id | Id of parser. |
prs | Pointer to HIDReportParser. |
|
inline |
Used to get the millis() of the last Bluetooth DATA input report received on the interrupt channel. This can be used detect if the connection to a Bluetooth device is lost fx if the battery runs out or if it gets out of range.
Used to pass acldata to the services.
ACLData | Incoming acldata. |
Implements BluetoothService.
|
protectedvirtual |
Used to run part of the state machine.
Implements BluetoothService.
|
protectedvirtual |
Use this to reset the service.
Implements BluetoothService.
|
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.
Implements BluetoothService.
Used to parse Bluetooth HID data to any class that inherits this class.
len | The length of the incoming data. |
buf | Pointer to the data buffer. |
Reimplemented in PS4BT, PS5BT, SwitchProBT, and XBOXONESBT.
Called when a device is connected
Reimplemented in PS4BT, PS5BT, SwitchProBT, and XBOXONESBT.
Used to reset any buffers in the class that inherits this
Reimplemented in PS4BT, PS5BT, SwitchProBT, and XBOXONESBT.
|
protected |
|
protected |