aboutsummaryrefslogtreecommitdiff
path: root/libraries/HID/HID.h
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@arduino.cc>2015-09-30 16:35:43 +0200
committerCristian Maglie <c.maglie@arduino.cc>2015-10-02 11:59:23 +0200
commit90652295956b6f4bcccb740aeb4f7c546327e499 (patch)
treed46ac6c9029afcebce9ced39a5ab7963b62dde13 /libraries/HID/HID.h
parentab19daef2878e6fdbbe29f69dd0006bdb2508cc3 (diff)
[PUSB] callbacks are now pure virtual methods
This change allows the compiler to handle callbacks resolution. Callbacks now must be implemented on the class that extends PUSBListNode and this is forced by compiler by means of pure virtual methods. Also the calls to HID.interface() and HID.endpoint() can now be simplified to interface() and endpoint() respectively since the methods are no more static.
Diffstat (limited to 'libraries/HID/HID.h')
-rw-r--r--libraries/HID/HID.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libraries/HID/HID.h b/libraries/HID/HID.h
index cb1125e..1c8e2fc 100644
--- a/libraries/HID/HID.h
+++ b/libraries/HID/HID.h
@@ -80,11 +80,13 @@ public:
void SendReport(uint8_t id, const void* data, int len);
void AppendDescriptor(HIDDescriptorListNode* node);
-private:
- static int GetInterface(uint8_t* interfaceNum);
- static int GetDescriptor(int8_t t);
- static bool Setup(USBSetup& setup, uint8_t i);
+protected:
+ // Implementation of the PUSBListNode
+ int getInterface(uint8_t* interfaceNum);
+ int getDescriptor(int8_t t);
+ bool setup(USBSetup& setup, uint8_t i);
+private:
static HIDDescriptor hidInterface;
static HIDDescriptorListNode* rootNode;