#include <BTHID.h>
This BluetoothService class implements support for Bluetooth HID devices.
Definition at line 29 of file BTHID.h.
BTHID::BTHID |
( |
BTD * |
p, |
|
|
bool |
pair = false , |
|
|
const char * |
pin = "0000" |
|
) |
| |
Constructor for the BTHID class.
- Parameters
-
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. |
Definition at line 23 of file BTHID.cpp.
void BTHID::disconnect |
( |
| ) |
|
|
virtual |
void BTHID::setProtocolMode |
( |
uint8_t |
mode | ) |
|
|
inline |
Set HID protocol mode.
- Parameters
-
mode | HID protocol to use. Either HID_BOOT_PROTOCOL or HID_RPT_PROTOCOL. |
Definition at line 72 of file BTHID.h.
void BTHID::setLeds |
( |
uint8_t |
data | ) |
|
Used to set the leds on a keyboard.
- Parameters
-
Definition at line 393 of file BTHID.cpp.
void BTHID::pair |
( |
void |
| ) |
|
|
inline |
Call this to start the paring sequence with a device
Definition at line 86 of file BTHID.h.
void BTHID::ACLData |
( |
uint8_t * |
ACLData | ) |
|
|
protectedvirtual |
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.
Definition at line 107 of file BTHID.h.
virtual void BTHID::ParseBTHIDData |
( |
uint8_t |
len, |
|
|
uint8_t * |
buf |
|
) |
| |
|
inlineprotectedvirtual |
Used to parse Bluetooth HID data to any class that inherits this class.
- Parameters
-
len | The length of the incoming data. |
buf | Pointer to the data buffer. |
Reimplemented in PS4BT.
Definition at line 120 of file BTHID.h.
virtual void BTHID::OnInitBTHID |
( |
| ) |
|
|
inlineprotectedvirtual |
Called when a device is connected
Reimplemented in PS4BT.
Definition at line 124 of file BTHID.h.
virtual void BTHID::ResetBTHID |
( |
| ) |
|
|
inlineprotectedvirtual |
Used to reset any buffers in the class that inherits this
Reimplemented in PS4BT.
Definition at line 128 of file BTHID.h.
True if a device is connected
Definition at line 83 of file BTHID.h.
uint8_t BTHID::control_scid[2] |
|
protected |
L2CAP source CID for HID_Control
Definition at line 134 of file BTHID.h.
uint8_t BTHID::interrupt_scid[2] |
|
protected |
L2CAP source CID for HID_Interrupt
Definition at line 137 of file BTHID.h.
The documentation for this class was generated from the following files: