aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'libraries')
-rw-r--r--libraries/HID/HID.cpp10
-rw-r--r--libraries/HID/HID.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/libraries/HID/HID.cpp b/libraries/HID/HID.cpp
index be95ec2..ce9a6a0 100644
--- a/libraries/HID/HID.cpp
+++ b/libraries/HID/HID.cpp
@@ -62,6 +62,16 @@ int HID_::getDescriptor(USBSetup& setup)
return total;
}
+uint8_t HID_::getShortName(char *name)
+{
+ name[0] = 'H';
+ name[1] = 'I';
+ name[2] = 'D';
+ name[3] = 'A' + (descriptorSize & 0x0F);
+ name[4] = 'A' + ((descriptorSize >> 4) & 0x0F);
+ return 5;
+}
+
void HID_::AppendDescriptor(HIDSubDescriptor *node)
{
if (!rootNode) {
diff --git a/libraries/HID/HID.h b/libraries/HID/HID.h
index ba08da7..b6638c8 100644
--- a/libraries/HID/HID.h
+++ b/libraries/HID/HID.h
@@ -96,6 +96,7 @@ protected:
int getInterface(uint8_t* interfaceCount);
int getDescriptor(USBSetup& setup);
bool setup(USBSetup& setup);
+ uint8_t getShortName(char* name);
private:
uint8_t epType[1];