From ced062988bf0df175e54b77b658132685100b350 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 13 Oct 2015 15:13:31 +0200 Subject: [USB] use plugged modules name to create iSerial field --- libraries/HID/HID.cpp | 10 ++++++++++ libraries/HID/HID.h | 1 + 2 files changed, 11 insertions(+) (limited to 'libraries') diff --git a/libraries/HID/HID.cpp b/libraries/HID/HID.cpp index 411529e..1a432ff 100644 --- a/libraries/HID/HID.cpp +++ b/libraries/HID/HID.cpp @@ -57,6 +57,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]; -- cgit v1.2.3-18-g5258