From 8ae6f8bb1d92db0052e9f81e7d90bc2d42433239 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Mon, 30 Dec 2013 16:05:50 +0100 Subject: [PATCH] Updated comments - especially in BTHID.h --- BTD.h | 2 +- BTHID.h | 25 ++++++++++++++++--------- PS3BT.h | 4 ++-- Wii.h | 6 +++--- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/BTD.h b/BTD.h index e5b06499..bacd38c3 100755 --- a/BTD.h +++ b/BTD.h @@ -286,7 +286,7 @@ public: */ virtual boolean DEVCLASSOK(uint8_t klass) { return (klass == USB_CLASS_WIRELESS_CTRL); - } + }; /** * Used by the USB core to check what this driver support. diff --git a/BTHID.h b/BTHID.h index e8842e6b..90fbf54f 100644 --- a/BTHID.h +++ b/BTHID.h @@ -42,11 +42,11 @@ public: * @param ACLData Incoming acldata. */ virtual void ACLData(uint8_t* ACLData); - /** Used to run part of the state maschine. */ + /** Used to run part of the state machine. */ virtual void Run(); /** Use this to reset the service. */ virtual void Reset(); - /** Used this to disconnect any of the controllers. */ + /** Used this to disconnect the devices. */ virtual void disconnect(); /**@}*/ @@ -60,24 +60,31 @@ public: return true; }; + /** + * Set HID protocol mode. + * @param mode HID protocol to use. Either HID_BOOT_PROTOCOL or HID_RPT_PROTOCOL. + */ void setProtocolMode(uint8_t mode) { protocolMode = mode; }; - /** Used to set the leds on a keyboard */ + /** + * Used to set the leds on a keyboard. + * @param data See KBDLEDS in hidboot.h + */ void setLeds(uint8_t data); /** True if a device is connected */ bool connected; - /** Call this to start the paring sequence with a controller */ + /** Call this to start the paring sequence with a device */ void pair(void) { if(pBtd) pBtd->pairWithHID(); }; /** - * Used to call your own function when the controller is successfully initialized. + * Used to call your own function when the device is successfully initialized. * @param funcOnInit Function to call. */ void attachOnInit(void (*funcOnInit)(void)) { @@ -87,28 +94,28 @@ public: private: BTD *pBtd; // Pointer to BTD instance - HIDReportParser *pRptParser[NUM_PARSERS]; + HIDReportParser *pRptParser[NUM_PARSERS]; // Pointer to HIDReportParsers. /** Set report protocol. */ void setProtocol(); uint8_t protocolMode; /** - * Called when the controller is successfully initialized. + * 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. */ void onInit() { if(pFuncOnInit) pFuncOnInit(); // Call the user function - } + }; void (*pFuncOnInit)(void); // Pointer to function called in onInit() void L2CAP_task(); // L2CAP state machine /* Variables filled from HCI event management */ uint16_t hci_handle; - bool activeConnection; // Used to indicate if it's already has established a connection + bool activeConnection; // Used to indicate if it already has established a connection /* Variables used by high level L2CAP task */ uint8_t l2cap_state; diff --git a/PS3BT.h b/PS3BT.h index ff441a2c..b8725b00 100644 --- a/PS3BT.h +++ b/PS3BT.h @@ -46,7 +46,7 @@ public: * @param ACLData Incoming acldata. */ virtual void ACLData(uint8_t* ACLData); - /** Used to run part of the state maschine. */ + /** Used to run part of the state machine. */ virtual void Run(); /** Use this to reset the service. */ virtual void Reset(); @@ -147,7 +147,7 @@ public: /** Turn all LEDs off. */ void setLedOff() { setLedRaw(0); - } + }; /** * Turn the specific ::LED off. * @param a The ::LED to turn off. diff --git a/Wii.h b/Wii.h index ead789c9..427242bb 100755 --- a/Wii.h +++ b/Wii.h @@ -63,7 +63,7 @@ public: * @param ACLData Incoming acldata. */ virtual void ACLData(uint8_t* ACLData); - /** Used to run part of the state maschine. */ + /** Used to run part of the state machine. */ virtual void Run(); /** Use this to reset the service. */ virtual void Reset(); @@ -90,7 +90,7 @@ public: void pair(void) { if(pBtd) pBtd->pairWithWiimote(); - } + }; /** * Used to read the joystick of the Nunchuck. * @param a Either ::HatX or ::HatY. @@ -152,7 +152,7 @@ public: /** Turn all LEDs off. */ void setLedOff() { setLedRaw(0); - } + }; /** * Turn the specific ::LED off. * @param a The ::LED to turn off.