@@ -42,11 +42,11 @@ class BTHID : public BluetoothService {
42
42
* @param ACLData Incoming acldata.
43
43
*/
44
44
virtual void ACLData (uint8_t * ACLData);
45
- /* * Used to run part of the state maschine . */
45
+ /* * Used to run part of the state machine . */
46
46
virtual void Run ();
47
47
/* * Use this to reset the service. */
48
48
virtual void Reset ();
49
- /* * Used this to disconnect any of the controllers . */
49
+ /* * Used this to disconnect the devices . */
50
50
virtual void disconnect ();
51
51
52
52
/* *@}*/
@@ -60,24 +60,31 @@ class BTHID : public BluetoothService {
60
60
return true ;
61
61
};
62
62
63
+ /* *
64
+ * Set HID protocol mode.
65
+ * @param mode HID protocol to use. Either HID_BOOT_PROTOCOL or HID_RPT_PROTOCOL.
66
+ */
63
67
void setProtocolMode (uint8_t mode) {
64
68
protocolMode = mode;
65
69
};
66
70
67
- /* * Used to set the leds on a keyboard */
71
+ /* *
72
+ * Used to set the leds on a keyboard.
73
+ * @param data See KBDLEDS in hidboot.h
74
+ */
68
75
void setLeds (uint8_t data);
69
76
70
77
/* * True if a device is connected */
71
78
bool connected;
72
79
73
- /* * Call this to start the paring sequence with a controller */
80
+ /* * Call this to start the paring sequence with a device */
74
81
void pair (void ) {
75
82
if (pBtd)
76
83
pBtd->pairWithHID ();
77
84
};
78
85
79
86
/* *
80
- * Used to call your own function when the controller is successfully initialized.
87
+ * Used to call your own function when the device is successfully initialized.
81
88
* @param funcOnInit Function to call.
82
89
*/
83
90
void attachOnInit (void (*funcOnInit)(void )) {
@@ -87,28 +94,28 @@ class BTHID : public BluetoothService {
87
94
private:
88
95
BTD *pBtd; // Pointer to BTD instance
89
96
90
- HIDReportParser *pRptParser[NUM_PARSERS];
97
+ HIDReportParser *pRptParser[NUM_PARSERS]; // Pointer to HIDReportParsers.
91
98
92
99
/* * Set report protocol. */
93
100
void setProtocol ();
94
101
uint8_t protocolMode;
95
102
96
103
/* *
97
- * Called when the controller is successfully initialized.
104
+ * Called when a device is successfully initialized.
98
105
* Use attachOnInit(void (*funcOnInit)(void)) to call your own function.
99
106
* This is useful for instance if you want to set the LEDs in a specific way.
100
107
*/
101
108
void onInit () {
102
109
if (pFuncOnInit)
103
110
pFuncOnInit (); // Call the user function
104
- }
111
+ };
105
112
void (*pFuncOnInit)(void ); // Pointer to function called in onInit()
106
113
107
114
void L2CAP_task (); // L2CAP state machine
108
115
109
116
/* Variables filled from HCI event management */
110
117
uint16_t hci_handle;
111
- bool activeConnection; // Used to indicate if it's already has established a connection
118
+ bool activeConnection; // Used to indicate if it already has established a connection
112
119
113
120
/* Variables used by high level L2CAP task */
114
121
uint8_t l2cap_state;
0 commit comments