Skip to content

Commit 8ae6f8b

Browse files
committed
Updated comments - especially in BTHID.h
1 parent 14fda13 commit 8ae6f8b

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

BTD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class BTD : public USBDeviceConfig, public UsbConfigXtracter {
286286
*/
287287
virtual boolean DEVCLASSOK(uint8_t klass) {
288288
return (klass == USB_CLASS_WIRELESS_CTRL);
289-
}
289+
};
290290

291291
/**
292292
* Used by the USB core to check what this driver support.

BTHID.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ class BTHID : public BluetoothService {
4242
* @param ACLData Incoming acldata.
4343
*/
4444
virtual void ACLData(uint8_t* ACLData);
45-
/** Used to run part of the state maschine. */
45+
/** Used to run part of the state machine. */
4646
virtual void Run();
4747
/** Use this to reset the service. */
4848
virtual void Reset();
49-
/** Used this to disconnect any of the controllers. */
49+
/** Used this to disconnect the devices. */
5050
virtual void disconnect();
5151

5252
/**@}*/
@@ -60,24 +60,31 @@ class BTHID : public BluetoothService {
6060
return true;
6161
};
6262

63+
/**
64+
* Set HID protocol mode.
65+
* @param mode HID protocol to use. Either HID_BOOT_PROTOCOL or HID_RPT_PROTOCOL.
66+
*/
6367
void setProtocolMode(uint8_t mode) {
6468
protocolMode = mode;
6569
};
6670

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+
*/
6875
void setLeds(uint8_t data);
6976

7077
/** True if a device is connected */
7178
bool connected;
7279

73-
/** Call this to start the paring sequence with a controller */
80+
/** Call this to start the paring sequence with a device */
7481
void pair(void) {
7582
if(pBtd)
7683
pBtd->pairWithHID();
7784
};
7885

7986
/**
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.
8188
* @param funcOnInit Function to call.
8289
*/
8390
void attachOnInit(void (*funcOnInit)(void)) {
@@ -87,28 +94,28 @@ class BTHID : public BluetoothService {
8794
private:
8895
BTD *pBtd; // Pointer to BTD instance
8996

90-
HIDReportParser *pRptParser[NUM_PARSERS];
97+
HIDReportParser *pRptParser[NUM_PARSERS]; // Pointer to HIDReportParsers.
9198

9299
/** Set report protocol. */
93100
void setProtocol();
94101
uint8_t protocolMode;
95102

96103
/**
97-
* Called when the controller is successfully initialized.
104+
* Called when a device is successfully initialized.
98105
* Use attachOnInit(void (*funcOnInit)(void)) to call your own function.
99106
* This is useful for instance if you want to set the LEDs in a specific way.
100107
*/
101108
void onInit() {
102109
if(pFuncOnInit)
103110
pFuncOnInit(); // Call the user function
104-
}
111+
};
105112
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
106113

107114
void L2CAP_task(); // L2CAP state machine
108115

109116
/* Variables filled from HCI event management */
110117
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
112119

113120
/* Variables used by high level L2CAP task */
114121
uint8_t l2cap_state;

PS3BT.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PS3BT : public BluetoothService {
4646
* @param ACLData Incoming acldata.
4747
*/
4848
virtual void ACLData(uint8_t* ACLData);
49-
/** Used to run part of the state maschine. */
49+
/** Used to run part of the state machine. */
5050
virtual void Run();
5151
/** Use this to reset the service. */
5252
virtual void Reset();
@@ -147,7 +147,7 @@ class PS3BT : public BluetoothService {
147147
/** Turn all LEDs off. */
148148
void setLedOff() {
149149
setLedRaw(0);
150-
}
150+
};
151151
/**
152152
* Turn the specific ::LED off.
153153
* @param a The ::LED to turn off.

Wii.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class WII : public BluetoothService {
6363
* @param ACLData Incoming acldata.
6464
*/
6565
virtual void ACLData(uint8_t* ACLData);
66-
/** Used to run part of the state maschine. */
66+
/** Used to run part of the state machine. */
6767
virtual void Run();
6868
/** Use this to reset the service. */
6969
virtual void Reset();
@@ -90,7 +90,7 @@ class WII : public BluetoothService {
9090
void pair(void) {
9191
if(pBtd)
9292
pBtd->pairWithWiimote();
93-
}
93+
};
9494
/**
9595
* Used to read the joystick of the Nunchuck.
9696
* @param a Either ::HatX or ::HatY.
@@ -152,7 +152,7 @@ class WII : public BluetoothService {
152152
/** Turn all LEDs off. */
153153
void setLedOff() {
154154
setLedRaw(0);
155-
}
155+
};
156156
/**
157157
* Turn the specific ::LED off.
158158
* @param a The ::LED to turn off.

0 commit comments

Comments
 (0)