From 5d8b0df56e5c363c89f857154936879bbc39d664 Mon Sep 17 00:00:00 2001 From: Oleg Mazurov Date: Wed, 6 Jul 2011 20:33:52 -0600 Subject: [PATCH] cleanup --- adk.cpp | 17 + adk.h | 17 + hid.cpp | 1974 ------------------------------------------------ hid.h | 1195 ----------------------------- masstorage.cpp | 328 -------- masstorage.h | 119 --- 6 files changed, 34 insertions(+), 3616 deletions(-) delete mode 100644 hid.cpp delete mode 100644 hid.h delete mode 100644 masstorage.cpp delete mode 100644 masstorage.h diff --git a/adk.cpp b/adk.cpp index ce49e350..346668d4 100644 --- a/adk.cpp +++ b/adk.cpp @@ -1,3 +1,20 @@ +/* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +This software may be distributed and modified under the terms of the GNU +General Public License version 2 (GPL2) as published by the Free Software +Foundation and appearing in the file GPL2.TXT included in the packaging of +this file. Please note that GPL2 Section 2[b] requires that all works based +on this software must also be made publicly available under the terms of +the GPL2 ("Copyleft"). + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com +*/ + /* Google ADK interface */ #include "adk.h" diff --git a/adk.h b/adk.h index 2d41f9da..f14c82d5 100644 --- a/adk.h +++ b/adk.h @@ -1,3 +1,20 @@ +/* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. + +This software may be distributed and modified under the terms of the GNU +General Public License version 2 (GPL2) as published by the Free Software +Foundation and appearing in the file GPL2.TXT included in the packaging of +this file. Please note that GPL2 Section 2[b] requires that all works based +on this software must also be made publicly available under the terms of +the GPL2 ("Copyleft"). + +Contact information +------------------- + +Circuits At Home, LTD +Web : http://www.circuitsathome.com +e-mail : support@circuitsathome.com +*/ + /* Google ADK interface support header */ #if !defined(_ADK_H_) diff --git a/hid.cpp b/hid.cpp deleted file mode 100644 index 225ac7d3..00000000 --- a/hid.cpp +++ /dev/null @@ -1,1974 +0,0 @@ -#include "hid.h" - -//const uint16_t HID::maxHidInterfaces = 3; -//const uint16_t HID::maxEpPerInterface = 2; -const uint8_t HID::epInterruptInIndex = 1; -const uint8_t HID::epInterruptOutIndex = 2; - -HID::HID(USB *p) : - pUsb(p), - bAddress(0), - qNextPollTime(0), - bPollEnable(false) -{ - Initialize(); - - if (pUsb) - pUsb->RegisterDeviceClass(this); -} - -uint16_t HID::GetHidClassDescrLen(uint8_t type, uint8_t num) -{ - for (uint8_t i=0, n=0; iGetAddressPool(); - - USBTRACE("HID Init\r\n"); - - if (bAddress) - return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE; - - // Get pointer to pseudo device with address 0 assigned - p = addrPool.GetUsbDevicePtr(0); - - if (!p) - return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - if (!p->epinfo) - { - USBTRACE("epinfo\r\n"); - return USB_ERROR_EPINFO_IS_NULL; - } - - // Save old pointer to EP_RECORD of address 0 - oldep_ptr = p->epinfo; - - // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence - p->epinfo = epInfo; - - p->lowspeed = lowspeed; - - // Get device descriptor - rcode = pUsb->getDevDescr( 0, 0, 8, (uint8_t*)buf ); - - if (!rcode) - len = (buf[0] > constBufSize) ? constBufSize : buf[0]; - - if( rcode ) - { - // Restore p->epinfo - p->epinfo = oldep_ptr; - - goto FailGetDevDescr; - } - - // Restore p->epinfo - p->epinfo = oldep_ptr; - - // Allocate new address according to device class - bAddress = addrPool.AllocAddress(parent, false, port); - - if (!bAddress) - return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL; - - // Extract Max Packet Size from the device descriptor - epInfo[0].maxPktSize = (uint8_t)((USB_DEVICE_DESCRIPTOR*)buf)->bMaxPacketSize0; - - // Assign new address to the device - rcode = pUsb->setAddr( 0, 0, bAddress ); - - if (rcode) - { - p->lowspeed = false; - addrPool.FreeAddress(bAddress); - bAddress = 0; - USBTRACE2("setAddr:",rcode); - return rcode; - } - - USBTRACE2("Addr:", bAddress); - - p->lowspeed = false; - - p = addrPool.GetUsbDevicePtr(bAddress); - - if (!p) - return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - p->lowspeed = lowspeed; - - if (len) - rcode = pUsb->getDevDescr( bAddress, 0, len, (uint8_t*)buf ); - - if(rcode) - goto FailGetDevDescr; - - num_of_conf = ((USB_DEVICE_DESCRIPTOR*)buf)->bNumConfigurations; - - // Assign epInfo to epinfo pointer - rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo); - - if (rcode) - goto FailSetDevTblEntry; - - USBTRACE2("NC:", num_of_conf); - - for (uint8_t i=0; i HexDump; - ConfigDescParser confDescrParser(this); - - rcode = pUsb->getConfDescr(bAddress, 0, i, &HexDump); - rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser); - - if (bNumEP > 1) - break; - } // for - - if (bNumEP < 2) - return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED; - - // Assign epInfo to epinfo pointer - rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo); - - USBTRACE2("\r\nCnf:", bConfNum); - - // Set Configuration Value - rcode = pUsb->setConf(bAddress, 0, bConfNum); - - if (rcode) - goto FailSetConfDescr; - - USBTRACE("HID configured\r\n"); - - bPollEnable = true; - return 0; - -FailGetDevDescr: - USBTRACE("getDevDescr:"); - goto Fail; - -FailSetDevTblEntry: - USBTRACE("setDevTblEn:"); - goto Fail; - -FailGetConfDescr: - USBTRACE("getConf:"); - goto Fail; - -FailSetConfDescr: - USBTRACE("setConf:"); - goto Fail; - -Fail: - Serial.println(rcode, HEX); - Release(); - return rcode; -} - -HID::HIDInterface* HID::FindInterface(uint8_t iface, uint8_t alt, uint8_t proto) -{ - for (uint8_t i=0; i 1 && conf != bConfNum) - return; - - ErrorMessage(PSTR("\r\nConf.Val"), conf); - ErrorMessage(PSTR("Iface Num"), iface); - ErrorMessage(PSTR("Alt.Set"), alt); - - bConfNum = conf; - - HIDInterface *piface = FindInterface(iface, alt, proto); - - // Fill in interface structure in case of new interface - if (!piface) - { - piface = hidInterfaces + bNumIface; - piface->bmInterface = iface; - piface->bmAltSet = alt; - piface->bmProtocol = proto; - bNumIface ++; - } - - uint8_t index; - - if ((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80) - { - USBTRACE("I8\r\n"); - index = epInterruptInIndex; - } - else - { - USBTRACE("I0\r\n"); - index = epInterruptOutIndex; - } - - // Fill in the endpoint info structure - epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F); - epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize; - epInfo[index].epAttribs = 0; - - // Fill in the endpoint index list - piface->epIndex[index] = (pep->bEndpointAddress & 0x0F); - - bNumEP ++; - - PrintEndpointDescriptor(pep); -} - - -uint8_t HID::Release() -{ - pUsb->GetAddressPool().FreeAddress(bAddress); - - bNumEP = 1; - bAddress = 0; - qNextPollTime = 0; - bPollEnable = false; - return 0; -} - -uint8_t HID::Poll() -{ - uint8_t rcode = 0; - - if (!bPollEnable) - return 0; - - if (qNextPollTime <= millis()) - { - qNextPollTime = millis() + 500; - - const uint8_t const_buff_len = 16; - uint8_t buf[const_buff_len]; - - HexDumper Hex; - uint16_t read = (uint16_t)epInfo[epInterruptInIndex].maxPktSize; - - uint8_t rcode = pUsb->inTransfer(bAddress, epInfo[epInterruptInIndex].epAddr, &read, buf); - - if (rcode && rcode != hrNAK) - { - USBTRACE2("Poll:", rcode); - return rcode; - } - for (uint8_t i=0; i(buf[i]); - } - return rcode; -} - -//get HID report descriptor -uint8_t HID::getReportDescr( uint8_t ep, USBReadParser *parser ) -{ - const uint8_t constBufLen = 64; - uint8_t buf[constBufLen]; - - //HexDumper HexDump; - - //return( pUsb->ctrlReq( bAddress, ep, /*bmREQ_HIDREPORT*/0x81, USB_REQUEST_GET_DESCRIPTOR, 0x00, - // HID_DESCRIPTOR_REPORT, 0x0000, constBufLen, constBufLen, buf, NULL )); - - uint8_t rcode = pUsb->ctrlReq( bAddress, ep, /*bmREQ_HIDREPORT*/0x81, USB_REQUEST_GET_DESCRIPTOR, 0x00, - HID_DESCRIPTOR_REPORT, 0x0000, 0x142, constBufLen, buf, (USBReadParser*)parser ); - - //return ((rcode != hrSTALL) ? rcode : 0); - return rcode; -} -//uint8_t HID::getHidDescr( uint8_t ep, uint16_t nbytes, uint8_t* dataptr ) -//{ -// return( pUsb->ctrlReq( bAddress, ep, bmREQ_GET_DESCR, USB_REQUEST_GET_DESCRIPTOR, 0x00, HID_DESCRIPTOR_HID, 0x0000, nbytes, dataptr )); -//} -uint8_t HID::setReport( uint8_t ep, uint16_t nbytes, uint8_t iface, uint8_t report_type, uint8_t report_id, uint8_t* dataptr ) -{ - return( pUsb->ctrlReq( bAddress, ep, bmREQ_HIDOUT, HID_REQUEST_SET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL )); -} -uint8_t HID::getReport( uint8_t ep, uint16_t nbytes, uint8_t iface, uint8_t report_type, uint8_t report_id, uint8_t* dataptr ) -{ - return( pUsb->ctrlReq( bAddress, ep, bmREQ_HIDIN, HID_REQUEST_GET_REPORT, report_id, report_type, iface, nbytes, nbytes, dataptr, NULL )); -} -uint8_t HID::getIdle( uint8_t ep, uint8_t iface, uint8_t reportID, uint8_t* dataptr ) -{ - return( pUsb->ctrlReq( bAddress, ep, bmREQ_HIDIN, HID_REQUEST_GET_IDLE, reportID, 0, iface, 0x0001, 0x0001, dataptr, NULL )); -} -uint8_t HID::setIdle( uint8_t ep, uint8_t iface, uint8_t reportID, uint8_t duration ) -{ - return( pUsb->ctrlReq( bAddress, ep, bmREQ_HIDOUT, HID_REQUEST_SET_IDLE, reportID, duration, iface, 0x0000, 0x0000, NULL, NULL )); -} -uint8_t HID::setProto( uint8_t ep, uint8_t iface, uint8_t protocol ) -{ - return( pUsb->ctrlReq( bAddress, ep, bmREQ_HIDOUT, HID_REQUEST_SET_PROTOCOL, protocol, 0x00, iface, 0x0000, 0x0000, NULL, NULL )); -} -uint8_t HID::getProto( uint8_t ep, uint8_t iface, uint8_t* dataptr ) -{ - return( pUsb->ctrlReq( bAddress, ep, bmREQ_HIDIN, HID_REQUEST_GET_PROTOCOL, 0x00, 0x00, iface, 0x0001, 0x0001, dataptr, NULL )); -} - -void ReportDescParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) -{ - uint16_t cntdn = (uint16_t)len; - uint8_t *p = (uint8_t*)pbuf; - - while(cntdn) - { - ParseItem(&p, &cntdn); - - //if (ParseItem(&p, &cntdn)) - // return; - } - USBTRACE2("Total:", totalSize); -} - -void ReportDescParser::PrintValue(uint8_t *p, uint8_t len) -{ - Notify(PSTR("(")); - for (; len; p++, len--) - PrintHex(*p); - Notify(PSTR(")")); -} - -void ReportDescParser::PrintByteValue(uint8_t data) -{ - Notify(PSTR("(")); - PrintHex(data); - Notify(PSTR(")")); -} - -uint8_t ReportDescParser::ParseItem(uint8_t **pp, uint16_t *pcntdn) -{ - uint8_t ret = enErrorSuccess; - - switch (itemParseState) - { - case 0: - if (**pp == HID_LONG_ITEM_PREFIX) - USBTRACE("\r\nLONG\r\n"); - //totalSize = 0; - //rptSize = 0; - //rptCount = 0; - //if (**pp == HID_LONG_ITEM_PREFIX) - //{ - // *pp ++; - // pcntdn --; - - // if (!(*pcntdn)) - // return enErrorIncomplete; - - // itemSize = **pp + 3; // bDataSize + sizeof(bLongItemTag) + sizeof(bDataSize) + 1 - //} - //else - { - uint8_t size = ((**pp) & DATA_SIZE_MASK); - - USBTRACE2("\r\nSZ:", size); - - itemPrefix = (**pp); - itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size); - - Serial.print("\r\nSz:"); - Serial.println(itemSize,DEC); - - PrintHex(*pcntdn); - Serial.print(":"); - PrintHex((itemPrefix & (TYPE_MASK | TAG_MASK))); - Serial.println(""); - - switch (itemPrefix & (TYPE_MASK | TAG_MASK)) - { - case (TYPE_GLOBAL | TAG_GLOBAL_PUSH): - Notify(PSTR("\r\nPush")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_POP): - Notify(PSTR("\r\nPop")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE): - Notify(PSTR("\r\nUsage Page")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN): - Notify(PSTR("\r\nLogical Min")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX): - Notify(PSTR("\r\nLogical Max")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN): - Notify(PSTR("\r\nPhysical Min")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX): - Notify(PSTR("\r\nPhysical Max")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP): - Notify(PSTR("\r\nUnit Exp")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_UNIT): - Notify(PSTR("\r\nUnit")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE): - Notify(PSTR("\r\nReport Size")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT): - Notify(PSTR("\r\nReport Count")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID): - Notify(PSTR("\r\nReport Id")); - break; - case (TYPE_LOCAL | TAG_LOCAL_USAGE): - Notify(PSTR("\r\nUsage")); - break; - case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN): - Notify(PSTR("\r\nUsage Min")); - break; - case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX): - Notify(PSTR("\r\nUsage Max")); - break; - case (TYPE_MAIN | TAG_MAIN_COLLECTION): - Notify(PSTR("\r\nCollection")); - break; - case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION): - Notify(PSTR("\r\nEnd Collection")); - break; - case (TYPE_MAIN | TAG_MAIN_INPUT): - Notify(PSTR("\r\nInput")); - break; - case (TYPE_MAIN | TAG_MAIN_OUTPUT): - Notify(PSTR("\r\nOutput")); - break; - case (TYPE_MAIN | TAG_MAIN_FEATURE): - Notify(PSTR("\r\nFeature")); - break; - } // switch (**pp & (TYPE_MASK | TAG_MASK)) - } - (*pp) ++; - (*pcntdn) --; - itemSize --; - itemParseState = 1; - - if (!itemSize) - break; - - if (!pcntdn) - return enErrorIncomplete; - case 1: - theBuffer.valueSize = itemSize; - valParser.Initialize(&theBuffer); - itemParseState = 2; - case 2: - if (!valParser.Parse(pp, pcntdn)) - return enErrorIncomplete; - itemParseState = 3; - case 3: - { - uint8_t data = *((uint8_t*)varBuffer); - - switch (itemPrefix & (TYPE_MASK | TAG_MASK)) - { - case (TYPE_LOCAL | TAG_LOCAL_USAGE): - if (pfUsage) - if (theBuffer.valueSize > 1) - pfUsage(*((uint16_t*)varBuffer)); - else - pfUsage(data); - case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE): - rptSize = data; - PrintByteValue(data); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT): - rptCount = data; - PrintByteValue(data); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN): - case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX): - case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN): - case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX): - case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID): - case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN): - case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX): - case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP): - case (TYPE_GLOBAL | TAG_GLOBAL_UNIT): - PrintValue(varBuffer, theBuffer.valueSize); - //Notify(PSTR("(")); - //for (uint8_t i=0; i(varBuffer[i]); - // //PrintHex(data); - //Notify(PSTR(")")); - break; - case (TYPE_GLOBAL | TAG_GLOBAL_PUSH): - case (TYPE_GLOBAL | TAG_GLOBAL_POP): - break; - case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE): - SetUsagePage(data); - PrintUsagePage(data); - PrintByteValue(data); - break; - case (TYPE_MAIN | TAG_MAIN_COLLECTION): - case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION): - switch (data) - { - case 0x00: - Notify(PSTR(" Physical")); - break; - case 0x01: - Notify(PSTR(" Application")); - break; - case 0x02: - Notify(PSTR(" Logical")); - break; - case 0x03: - Notify(PSTR(" Report")); - break; - case 0x04: - Notify(PSTR(" Named Array")); - break; - case 0x05: - Notify(PSTR(" Usage Switch")); - break; - case 0x06: - Notify(PSTR(" Usage Modifier")); - break; - default: - Notify(PSTR(" Vendor Defined(")); - PrintHex(data); - Notify(PSTR(")")); - } - break; - case (TYPE_MAIN | TAG_MAIN_INPUT): - case (TYPE_MAIN | TAG_MAIN_OUTPUT): - case (TYPE_MAIN | TAG_MAIN_FEATURE): - totalSize += (uint16_t)rptSize * (uint16_t)rptCount; - rptSize = 0; - rptCount = 0; - Notify(PSTR("(")); - PrintBin(data); - Notify(PSTR(")")); - break; - } // switch (**pp & (TYPE_MASK | TAG_MASK)) - } - itemParseState = 4; - case 4: - USBTRACE2("iSz:", itemSize); - - PrintHex(*pcntdn); - Serial.print(":"); - PrintHex((itemPrefix & (TYPE_MASK | TAG_MASK))); - Serial.println(""); - - if (itemSize > 1 && !theSkipper.Skip(pp, pcntdn, itemSize)) - return enErrorIncomplete; - } // switch (itemParseState) - itemParseState = 0; - return enErrorSuccess; -} - -const char *usagePageTitles0[] PROGMEM = -{ - pstrUsagePageGenericDesktopControls , - pstrUsagePageSimulationControls , - pstrUsagePageVRControls , - pstrUsagePageSportControls , - pstrUsagePageGameControls , - pstrUsagePageGenericDeviceControls , - pstrUsagePageKeyboardKeypad , - pstrUsagePageLEDs , - pstrUsagePageButton , - pstrUsagePageOrdinal , - pstrUsagePageTelephone , - pstrUsagePageConsumer , - pstrUsagePageDigitizer , - pstrUsagePagePID , - pstrUsagePageUnicode -}; -const char *usagePageTitles1[] PROGMEM = -{ - pstrUsagePageBarCodeScanner , - pstrUsagePageScale , - pstrUsagePageMSRDevices , - pstrUsagePagePointOfSale , - pstrUsagePageCameraControl , - pstrUsagePageArcade -}; - -ReportDescParser::UsagePageFunc ReportDescParser::usagePageFunctions[] /*PROGMEM*/ = -{ - &ReportDescParser::PrintGenericDesktopPageUsage, - &ReportDescParser::PrintSimulationControlsPageUsage, - &ReportDescParser::PrintVRControlsPageUsage, - &ReportDescParser::PrintSportsControlsPageUsage, - &ReportDescParser::PrintGameControlsPageUsage, - &ReportDescParser::PrintGenericDeviceControlsPageUsage, - NULL, // Keyboard/Keypad - &ReportDescParser::PrintLEDPageUsage, - NULL, // Button - NULL, // Ordinal - &ReportDescParser::PrintTelephonyPageUsage, - &ReportDescParser::PrintConsumerPageUsage, - &ReportDescParser::PrintDigitizerPageUsage, - NULL, // Reserved - NULL, // PID - NULL // Unicode -}; - -void ReportDescParser::SetUsagePage(uint16_t page) -{ - pfUsage = NULL; - - if (page > 0x00 && page < 0x11) - pfUsage = /*(UsagePageFunc)pgm_read_word*/(usagePageFunctions[page - 1]); - //else if (page > 0x7f && page < 0x84) - // Notify(pstrUsagePageMonitor); - //else if (page > 0x83 && page < 0x8c) - // Notify(pstrUsagePagePower); - //else if (page > 0x8b && page < 0x92) - // Notify((char*)pgm_read_word(&usagePageTitles1[page - 0x8c])); - //else if (page > 0xfeff && page <= 0xffff) - // Notify(pstrUsagePageVendorDefined); - else - switch (page) - { - case 0x14: - pfUsage = &ReportDescParser::PrintAlphanumDisplayPageUsage; - break; - case 0x40: - pfUsage = &ReportDescParser::PrintMedicalInstrumentPageUsage; - break; - } -} - -void ReportDescParser::PrintUsagePage(uint16_t page) -{ - Notify(pstrSpace); - - if (page > 0x00 && page < 0x11) - Notify((char*)pgm_read_word(&usagePageTitles0[page - 1])); - else if (page > 0x7f && page < 0x84) - Notify(pstrUsagePageMonitor); - else if (page > 0x83 && page < 0x8c) - Notify(pstrUsagePagePower); - else if (page > 0x8b && page < 0x92) - Notify((char*)pgm_read_word(&usagePageTitles1[page - 0x8c])); - else if (page > 0xfeff && page <= 0xffff) - Notify(pstrUsagePageVendorDefined); - else - switch (page) - { - case 0x14: - Notify(pstrUsagePageAlphaNumericDisplay); - break; - case 0x40: - Notify(pstrUsagePageMedicalInstruments); - break; - default: - Notify(pstrUsagePageUndefined); - } -} - -const char *genDesktopTitles0[] PROGMEM = -{ - pstrUsagePointer , - pstrUsageMouse , - pstrUsageJoystick , - pstrUsageGamePad , - pstrUsageKeyboard , - pstrUsageKeypad , - pstrUsageMultiAxisController , - pstrUsageTabletPCSystemControls - -}; -const char *genDesktopTitles1[] PROGMEM = -{ - pstrUsageX , - pstrUsageY , - pstrUsageZ , - pstrUsageRx , - pstrUsageRy , - pstrUsageRz , - pstrUsageSlider , - pstrUsageDial , - pstrUsageWheel , - pstrUsageHatSwitch , - pstrUsageCountedBuffer , - pstrUsageByteCount , - pstrUsageMotionWakeup , - pstrUsageStart , - pstrUsageSelect , - pstrUsagePageReserved , - pstrUsageVx , - pstrUsageVy , - pstrUsageVz , - pstrUsageVbrx , - pstrUsageVbry , - pstrUsageVbrz , - pstrUsageVno , - pstrUsageFeatureNotification , - pstrUsageResolutionMultiplier -}; -const char *genDesktopTitles2[] PROGMEM = -{ - pstrUsageSystemControl , - pstrUsageSystemPowerDown , - pstrUsageSystemSleep , - pstrUsageSystemWakeup , - pstrUsageSystemContextMenu , - pstrUsageSystemMainMenu , - pstrUsageSystemAppMenu , - pstrUsageSystemMenuHelp , - pstrUsageSystemMenuExit , - pstrUsageSystemMenuSelect , - pstrUsageSystemMenuRight , - pstrUsageSystemMenuLeft , - pstrUsageSystemMenuUp , - pstrUsageSystemMenuDown , - pstrUsageSystemColdRestart , - pstrUsageSystemWarmRestart , - pstrUsageDPadUp , - pstrUsageDPadDown , - pstrUsageDPadRight , - pstrUsageDPadLeft -}; -const char *genDesktopTitles3[] PROGMEM = -{ - pstrUsageSystemDock , - pstrUsageSystemUndock , - pstrUsageSystemSetup , - pstrUsageSystemBreak , - pstrUsageSystemDebuggerBreak , - pstrUsageApplicationBreak , - pstrUsageApplicationDebuggerBreak, - pstrUsageSystemSpeakerMute , - pstrUsageSystemHibernate -}; -const char *genDesktopTitles4[] PROGMEM = -{ - pstrUsageSystemDisplayInvert , - pstrUsageSystemDisplayInternal , - pstrUsageSystemDisplayExternal , - pstrUsageSystemDisplayBoth , - pstrUsageSystemDisplayDual , - pstrUsageSystemDisplayToggleIntExt , - pstrUsageSystemDisplaySwapPriSec , - pstrUsageSystemDisplayLCDAutoscale -}; - -void ReportDescParser::PrintGenericDesktopPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x0a) - Notify((char*)pgm_read_word(&genDesktopTitles0[usage - 1])); - else if (usage > 0x2f && usage < 0x49) - Notify((char*)pgm_read_word(&genDesktopTitles1[usage - 0x30])); - else if (usage > 0x7f && usage < 0x94) - Notify((char*)pgm_read_word(&genDesktopTitles2[usage - 0x80])); - else if (usage > 0x9f && usage < 0xa9) - Notify((char*)pgm_read_word(&genDesktopTitles3[usage - 0xa0])); - else if (usage > 0xaf && usage < 0xb8) - Notify((char*)pgm_read_word(&genDesktopTitles4[usage - 0xb0])); - else - Notify(pstrUsagePageUndefined); -} - -const char *simuTitles0[] PROGMEM = -{ - pstrUsageFlightSimulationDevice , - pstrUsageAutomobileSimulationDevice , - pstrUsageTankSimulationDevice , - pstrUsageSpaceshipSimulationDevice , - pstrUsageSubmarineSimulationDevice , - pstrUsageSailingSimulationDevice , - pstrUsageMotocicleSimulationDevice , - pstrUsageSportsSimulationDevice , - pstrUsageAirplaneSimulationDevice , - pstrUsageHelicopterSimulationDevice , - pstrUsageMagicCarpetSimulationDevice, - pstrUsageBicycleSimulationDevice -}; -const char *simuTitles1[] PROGMEM = -{ - pstrUsageFlightControlStick , - pstrUsageFlightStick , - pstrUsageCyclicControl , - pstrUsageCyclicTrim , - pstrUsageFlightYoke , - pstrUsageTrackControl -}; -const char *simuTitles2[] PROGMEM = -{ - pstrUsageAileron , - pstrUsageAileronTrim , - pstrUsageAntiTorqueControl , - pstrUsageAutopilotEnable , - pstrUsageChaffRelease , - pstrUsageCollectiveControl , - pstrUsageDiveBrake , - pstrUsageElectronicCountermeasures , - pstrUsageElevator , - pstrUsageElevatorTrim , - pstrUsageRudder , - pstrUsageThrottle , - pstrUsageFlightCommunications , - pstrUsageFlareRelease , - pstrUsageLandingGear , - pstrUsageToeBrake , - pstrUsageTrigger , - pstrUsageWeaponsArm , - pstrUsageWeaponsSelect , - pstrUsageWingFlaps , - pstrUsageAccelerator , - pstrUsageBrake , - pstrUsageClutch , - pstrUsageShifter , - pstrUsageSteering , - pstrUsageTurretDirection , - pstrUsageBarrelElevation , - pstrUsageDivePlane , - pstrUsageBallast , - pstrUsageBicycleCrank , - pstrUsageHandleBars , - pstrUsageFrontBrake , - pstrUsageRearBrake -}; - -void ReportDescParser::PrintSimulationControlsPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x0d) - Notify((char*)pgm_read_word(&simuTitles0[usage - 1])); - else if (usage > 0x1f && usage < 0x26) - Notify((char*)pgm_read_word(&simuTitles1[usage - 0x20])); - else if (usage > 0xaf && usage < 0xd1) - Notify((char*)pgm_read_word(&simuTitles2[usage - 0xb0])); - else - Notify(pstrUsagePageUndefined); -} - -const char *vrTitles0[] PROGMEM = -{ - pstrUsageBelt , - pstrUsageBodySuit , - pstrUsageFlexor , - pstrUsageGlove , - pstrUsageHeadTracker , - pstrUsageHeadMountedDisplay , - pstrUsageHandTracker , - pstrUsageOculometer , - pstrUsageVest , - pstrUsageAnimatronicDevice -}; -const char *vrTitles1[] PROGMEM = -{ - pstrUsageStereoEnable , - pstrUsageDisplayEnable -}; - -void ReportDescParser::PrintVRControlsPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x0b) - Notify((char*)pgm_read_word(&vrTitles0[usage - 1])); - else if (usage > 0x1f && usage < 0x22) - Notify((char*)pgm_read_word(&vrTitles1[usage - 0x20])); - else - Notify(pstrUsagePageUndefined); -} - -const char *sportsCtrlTitles0[] PROGMEM = -{ - pstrUsageBaseballBat , - pstrUsageGolfClub , - pstrUsageRowingMachine , - pstrUsageTreadmill -}; -const char *sportsCtrlTitles1[] PROGMEM = -{ - pstrUsageOar , - pstrUsageSlope , - pstrUsageRate , - pstrUsageStickSpeed , - pstrUsageStickFaceAngle , - pstrUsageStickHeelToe , - pstrUsageStickFollowThough , - pstrUsageStickTempo , - pstrUsageStickType , - pstrUsageStickHeight -}; -const char *sportsCtrlTitles2[] PROGMEM = -{ - pstrUsagePutter , - pstrUsage1Iron , - pstrUsage2Iron , - pstrUsage3Iron , - pstrUsage4Iron , - pstrUsage5Iron , - pstrUsage6Iron , - pstrUsage7Iron , - pstrUsage8Iron , - pstrUsage9Iron , - pstrUsage10Iron , - pstrUsage11Iron , - pstrUsageSandWedge , - pstrUsageLoftWedge , - pstrUsagePowerWedge , - pstrUsage1Wood , - pstrUsage3Wood , - pstrUsage5Wood , - pstrUsage7Wood , - pstrUsage9Wood -}; - -void ReportDescParser::PrintSportsControlsPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x05) - Notify((char*)pgm_read_word(&sportsCtrlTitles0[usage - 1])); - else if (usage > 0x2f && usage < 0x3a) - Notify((char*)pgm_read_word(&sportsCtrlTitles1[usage - 0x30])); - else if (usage > 0x4f && usage < 0x64) - Notify((char*)pgm_read_word(&sportsCtrlTitles2[usage - 0x50])); - else - Notify(pstrUsagePageUndefined); -} - - - - -const char *gameTitles0[] PROGMEM = -{ - pstrUsage3DGameController , - pstrUsagePinballDevice , - pstrUsageGunDevice -}; -const char *gameTitles1[] PROGMEM = -{ - pstrUsagePointOfView , - pstrUsageTurnRightLeft , - pstrUsagePitchForwardBackward , - pstrUsageRollRightLeft , - pstrUsageMoveRightLeft , - pstrUsageMoveForwardBackward , - pstrUsageMoveUpDown , - pstrUsageLeanRightLeft , - pstrUsageLeanForwardBackward , - pstrUsageHeightOfPOV , - pstrUsageFlipper , - pstrUsageSecondaryFlipper , - pstrUsageBump , - pstrUsageNewGame , - pstrUsageShootBall , - pstrUsagePlayer , - pstrUsageGunBolt , - pstrUsageGunClip , - pstrUsageGunSelector , - pstrUsageGunSingleShot , - pstrUsageGunBurst , - pstrUsageGunAutomatic , - pstrUsageGunSafety , - pstrUsageGamepadFireJump , - pstrUsageGamepadTrigger -}; - -void ReportDescParser::PrintGameControlsPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x04) - Notify((char*)pgm_read_word(&gameTitles0[usage - 1])); - else if (usage > 0x1f && usage < 0x3a) - Notify((char*)pgm_read_word(&gameTitles1[usage - 0x20])); - else - Notify(pstrUsagePageUndefined); -} - -const char *genDevCtrlTitles[] PROGMEM = -{ - pstrUsageBatteryStrength, - pstrUsageWirelessChannel, - pstrUsageWirelessID, - pstrUsageDiscoverWirelessControl, - pstrUsageSecurityCodeCharEntered, - pstrUsageSecurityCodeCharErased, - pstrUsageSecurityCodeCleared -}; - -void ReportDescParser::PrintGenericDeviceControlsPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x1f && usage < 0x27) - Notify((char*)pgm_read_word(&genDevCtrlTitles[usage - 0x20])); - else - Notify(pstrUsagePageUndefined); -} - -const char *ledTitles[] PROGMEM = -{ - pstrUsageNumLock , - pstrUsageCapsLock , - pstrUsageScrollLock , - pstrUsageCompose , - pstrUsageKana , - pstrUsagePower , - pstrUsageShift , - pstrUsageDoNotDisturb , - pstrUsageMute , - pstrUsageToneEnable , - pstrUsageHighCutFilter , - pstrUsageLowCutFilter , - pstrUsageEqualizerEnable , - pstrUsageSoundFieldOn , - pstrUsageSurroundOn , - pstrUsageRepeat , - pstrUsageStereo , - pstrUsageSamplingRateDetect , - pstrUsageSpinning , - pstrUsageCAV , - pstrUsageCLV , - pstrUsageRecordingFormatDetect , - pstrUsageOffHook , - pstrUsageRing , - pstrUsageMessageWaiting , - pstrUsageDataMode , - pstrUsageBatteryOperation , - pstrUsageBatteryOK , - pstrUsageBatteryLow , - pstrUsageSpeaker , - pstrUsageHeadSet , - pstrUsageHold , - pstrUsageMicrophone , - pstrUsageCoverage , - pstrUsageNightMode , - pstrUsageSendCalls , - pstrUsageCallPickup , - pstrUsageConference , - pstrUsageStandBy , - pstrUsageCameraOn , - pstrUsageCameraOff , - pstrUsageOnLine , - pstrUsageOffLine , - pstrUsageBusy , - pstrUsageReady , - pstrUsagePaperOut , - pstrUsagePaperJam , - pstrUsageRemote , - pstrUsageForward , - pstrUsageReverse , - pstrUsageStop , - pstrUsageRewind , - pstrUsageFastForward , - pstrUsagePlay , - pstrUsagePause , - pstrUsageRecord , - pstrUsageError , - pstrUsageSelectedIndicator , - pstrUsageInUseIndicator , - pstrUsageMultiModeIndicator , - pstrUsageIndicatorOn , - pstrUsageIndicatorFlash , - pstrUsageIndicatorSlowBlink , - pstrUsageIndicatorFastBlink , - pstrUsageIndicatorOff , - pstrUsageFlashOnTime , - pstrUsageSlowBlinkOnTime , - pstrUsageSlowBlinkOffTime , - pstrUsageFastBlinkOnTime , - pstrUsageFastBlinkOffTime , - pstrUsageIndicatorColor , - pstrUsageIndicatorRed , - pstrUsageIndicatorGreen , - pstrUsageIndicatorAmber , - pstrUsageGenericIndicator , - pstrUsageSystemSuspend , - pstrUsageExternalPowerConnected -}; - -void ReportDescParser::PrintLEDPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x4e) - Notify((char*)pgm_read_word(&ledTitles[usage - 1])); - else - Notify(pstrUsagePageUndefined); -} - -const char *telTitles0 [] PROGMEM = -{ - pstrUsagePhone , - pstrUsageAnsweringMachine , - pstrUsageMessageControls , - pstrUsageHandset , - pstrUsageHeadset , - pstrUsageTelephonyKeyPad , - pstrUsageProgrammableButton -}; -const char *telTitles1 [] PROGMEM = -{ - pstrUsageHookSwitch , - pstrUsageFlash , - pstrUsageFeature , - pstrUsageHold , - pstrUsageRedial , - pstrUsageTransfer , - pstrUsageDrop , - pstrUsagePark , - pstrUsageForwardCalls , - pstrUsageAlternateFunction , - pstrUsageLine , - pstrUsageSpeakerPhone , - pstrUsageConference , - pstrUsageRingEnable , - pstrUsageRingSelect , - pstrUsagePhoneMute , - pstrUsageCallerID , - pstrUsageSend -}; -const char *telTitles2 [] PROGMEM = -{ - pstrUsageSpeedDial , - pstrUsageStoreNumber , - pstrUsageRecallNumber , - pstrUsagePhoneDirectory -}; -const char *telTitles3 [] PROGMEM = -{ - pstrUsageVoiceMail , - pstrUsageScreenCalls , - pstrUsageDoNotDisturb , - pstrUsageMessage , - pstrUsageAnswerOnOff -}; -const char *telTitles4 [] PROGMEM = -{ - pstrUsageInsideDialTone , - pstrUsageOutsideDialTone , - pstrUsageInsideRingTone , - pstrUsageOutsideRingTone , - pstrUsagePriorityRingTone , - pstrUsageInsideRingback , - pstrUsagePriorityRingback , - pstrUsageLineBusyTone , - pstrUsageReorderTone , - pstrUsageCallWaitingTone , - pstrUsageConfirmationTone1 , - pstrUsageConfirmationTone2 , - pstrUsageTonesOff , - pstrUsageOutsideRingback , - pstrUsageRinger -}; -const char *telTitles5 [] PROGMEM = -{ - pstrUsagePhoneKey0 , - pstrUsagePhoneKey1 , - pstrUsagePhoneKey2 , - pstrUsagePhoneKey3 , - pstrUsagePhoneKey4 , - pstrUsagePhoneKey5 , - pstrUsagePhoneKey6 , - pstrUsagePhoneKey7 , - pstrUsagePhoneKey8 , - pstrUsagePhoneKey9 , - pstrUsagePhoneKeyStar , - pstrUsagePhoneKeyPound , - pstrUsagePhoneKeyA , - pstrUsagePhoneKeyB , - pstrUsagePhoneKeyC , - pstrUsagePhoneKeyD -}; - -void ReportDescParser::PrintTelephonyPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x08) - Notify((char*)pgm_read_word(&telTitles0[usage - 1])); - else if (usage > 0x1f && usage < 0x32) - Notify((char*)pgm_read_word(&telTitles1[usage - 0x1f])); - else if (usage > 0x4f && usage < 0x54) - Notify((char*)pgm_read_word(&telTitles2[usage - 0x4f])); - else if (usage > 0x6f && usage < 0x75) - Notify((char*)pgm_read_word(&telTitles3[usage - 0x6f])); - else if (usage > 0x8f && usage < 0x9f) - Notify((char*)pgm_read_word(&telTitles4[usage - 0x8f])); - else if (usage > 0xaf && usage < 0xc0) - Notify((char*)pgm_read_word(&telTitles5[usage - 0xaf])); - else - Notify(pstrUsagePageUndefined); -} - -const char *consTitles0[] PROGMEM = -{ - pstrUsageConsumerControl, - pstrUsageNumericKeyPad, - pstrUsageProgrammableButton, - pstrUsageMicrophone, - pstrUsageHeadphone, - pstrUsageGraphicEqualizer -}; -const char *consTitles1[] PROGMEM = -{ - pstrUsagePlus10 , - pstrUsagePlus100, - pstrUsageAMPM -}; -const char *consTitles2[] PROGMEM = -{ - pstrUsagePower , - pstrUsageReset , - pstrUsageSleep , - pstrUsageSleepAfter , - pstrUsageSleepMode , - pstrUsageIllumination , - pstrUsageFunctionButtons - -}; -const char *consTitles3[] PROGMEM = -{ - pstrUsageMenu , - pstrUsageMenuPick , - pstrUsageMenuUp , - pstrUsageMenuDown , - pstrUsageMenuLeft , - pstrUsageMenuRight , - pstrUsageMenuEscape , - pstrUsageMenuValueIncrease, - pstrUsageMenuValueDecrease -}; -const char *consTitles4[] PROGMEM = -{ - pstrUsageDataOnScreen , - pstrUsageClosedCaption , - pstrUsageClosedCaptionSelect, - pstrUsageVCRTV , - pstrUsageBroadcastMode , - pstrUsageSnapshot , - pstrUsageStill -}; -const char *consTitles5[] PROGMEM = -{ - pstrUsageSelection , - pstrUsageAssignSelection , - pstrUsageModeStep , - pstrUsageRecallLast , - pstrUsageEnterChannel , - pstrUsageOrderMovie , - pstrUsageChannel , - pstrUsageMediaSelection , - pstrUsageMediaSelectComputer , - pstrUsageMediaSelectTV , - pstrUsageMediaSelectWWW , - pstrUsageMediaSelectDVD , - pstrUsageMediaSelectTelephone , - pstrUsageMediaSelectProgramGuide , - pstrUsageMediaSelectVideoPhone , - pstrUsageMediaSelectGames , - pstrUsageMediaSelectMessages , - pstrUsageMediaSelectCD , - pstrUsageMediaSelectVCR , - pstrUsageMediaSelectTuner , - pstrUsageQuit , - pstrUsageHelp , - pstrUsageMediaSelectTape , - pstrUsageMediaSelectCable , - pstrUsageMediaSelectSatellite , - pstrUsageMediaSelectSecurity , - pstrUsageMediaSelectHome , - pstrUsageMediaSelectCall , - pstrUsageChannelIncrement , - pstrUsageChannelDecrement , - pstrUsageMediaSelectSAP , - pstrUsagePageReserved , - pstrUsageVCRPlus , - pstrUsageOnce , - pstrUsageDaily , - pstrUsageWeekly , - pstrUsageMonthly -}; -const char *consTitles6[] PROGMEM = -{ - pstrUsagePlay , - pstrUsagePause , - pstrUsageRecord , - pstrUsageFastForward , - pstrUsageRewind , - pstrUsageScanNextTrack , - pstrUsageScanPreviousTrack , - pstrUsageStop , - pstrUsageEject , - pstrUsageRandomPlay , - pstrUsageSelectDisk , - pstrUsageEnterDisk , - pstrUsageRepeat , - pstrUsageTracking , - pstrUsageTrackNormal , - pstrUsageSlowTracking , - pstrUsageFrameForward , - pstrUsageFrameBackwards , - pstrUsageMark , - pstrUsageClearMark , - pstrUsageRepeatFromMark , - pstrUsageReturnToMark , - pstrUsageSearchMarkForward , - pstrUsageSearchMarkBackwards , - pstrUsageCounterReset , - pstrUsageShowCounter , - pstrUsageTrackingIncrement , - pstrUsageTrackingDecrement , - pstrUsageStopEject , - pstrUsagePlayPause , - pstrUsagePlaySkip -}; -const char *consTitles7[] PROGMEM = -{ - pstrUsageVolume , - pstrUsageBalance , - pstrUsageMute , - pstrUsageBass , - pstrUsageTreble , - pstrUsageBassBoost , - pstrUsageSurroundMode , - pstrUsageLoudness , - pstrUsageMPX , - pstrUsageVolumeIncrement , - pstrUsageVolumeDecrement -}; -const char *consTitles8[] PROGMEM = -{ - pstrUsageSpeedSelect , - pstrUsagePlaybackSpeed , - pstrUsageStandardPlay , - pstrUsageLongPlay , - pstrUsageExtendedPlay , - pstrUsageSlow -}; -const char *consTitles9[] PROGMEM = -{ - pstrUsageFanEnable , - pstrUsageFanSpeed , - pstrUsageLightEnable , - pstrUsageLightIlluminationLevel , - pstrUsageClimateControlEnable , - pstrUsageRoomTemperature , - pstrUsageSecurityEnable , - pstrUsageFireAlarm , - pstrUsagePoliceAlarm , - pstrUsageProximity , - pstrUsageMotion , - pstrUsageDuresAlarm , - pstrUsageHoldupAlarm , - pstrUsageMedicalAlarm -}; -const char *consTitlesA[] PROGMEM = -{ - pstrUsageBalanceRight , - pstrUsageBalanceLeft , - pstrUsageBassIncrement , - pstrUsageBassDecrement , - pstrUsageTrebleIncrement , - pstrUsageTrebleDecrement -}; -const char *consTitlesB[] PROGMEM = -{ - pstrUsageSpeakerSystem , - pstrUsageChannelLeft , - pstrUsageChannelRight , - pstrUsageChannelCenter , - pstrUsageChannelFront , - pstrUsageChannelCenterFront , - pstrUsageChannelSide , - pstrUsageChannelSurround , - pstrUsageChannelLowFreqEnhancement , - pstrUsageChannelTop , - pstrUsageChannelUnknown -}; -const char *consTitlesC[] PROGMEM = -{ - pstrUsageSubChannel , - pstrUsageSubChannelIncrement , - pstrUsageSubChannelDecrement , - pstrUsageAlternateAudioIncrement , - pstrUsageAlternateAudioDecrement -}; -const char *consTitlesD[] PROGMEM = -{ - pstrUsageApplicationLaunchButtons , - pstrUsageALLaunchButtonConfigTool , - pstrUsageALProgrammableButton , - pstrUsageALConsumerControlConfig , - pstrUsageALWordProcessor , - pstrUsageALTextEditor , - pstrUsageALSpreadsheet , - pstrUsageALGraphicsEditor , - pstrUsageALPresentationApp , - pstrUsageALDatabaseApp , - pstrUsageALEmailReader , - pstrUsageALNewsreader , - pstrUsageALVoicemail , - pstrUsageALContactsAddressBook , - pstrUsageALCalendarSchedule , - pstrUsageALTaskProjectManager , - pstrUsageALLogJournalTimecard , - pstrUsageALCheckbookFinance , - pstrUsageALCalculator , - pstrUsageALAVCapturePlayback , - pstrUsageALLocalMachineBrowser , - pstrUsageALLANWANBrow , - pstrUsageALInternetBrowser , - pstrUsageALRemoteNetISPConnect , - pstrUsageALNetworkConference , - pstrUsageALNetworkChat , - pstrUsageALTelephonyDialer , - pstrUsageALLogon , - pstrUsageALLogoff , - pstrUsageALLogonLogoff , - pstrUsageALTermLockScrSav , - pstrUsageALControlPannel , - pstrUsageALCommandLineProcessorRun , - pstrUsageALProcessTaskManager , - pstrUsageALSelectTaskApplication , - pstrUsageALNextTaskApplication , - pstrUsageALPreviousTaskApplication , - pstrUsageALPreemptiveHaltTaskApp , - pstrUsageALIntegratedHelpCenter , - pstrUsageALDocuments , - pstrUsageALThesaurus , - pstrUsageALDictionary , - pstrUsageALDesktop , - pstrUsageALSpellCheck , - pstrUsageALGrammarCheck , - pstrUsageALWirelessStatus , - pstrUsageALKeyboardLayout , - pstrUsageALVirusProtection , - pstrUsageALEncryption , - pstrUsageALScreenSaver , - pstrUsageALAlarms , - pstrUsageALClock , - pstrUsageALFileBrowser , - pstrUsageALPowerStatus , - pstrUsageALImageBrowser , - pstrUsageALAudioBrowser , - pstrUsageALMovieBrowser , - pstrUsageALDigitalRightsManager , - pstrUsageALDigitalWallet , - pstrUsagePageReserved , - pstrUsageALInstantMessaging , - pstrUsageALOEMFeaturesBrowser , - pstrUsageALOEMHelp , - pstrUsageALOnlineCommunity , - pstrUsageALEntertainmentContentBrow , - pstrUsageALOnlineShoppingBrowser , - pstrUsageALSmartCardInfoHelp , - pstrUsageALMarketMonitorFinBrowser , - pstrUsageALCustomCorpNewsBrowser , - pstrUsageALOnlineActivityBrowser , - pstrUsageALResearchSearchBrowser , - pstrUsageALAudioPlayer -}; -const char *consTitlesE[] PROGMEM = -{ - pstrUsageGenericGUIAppControls , - pstrUsageACNew , - pstrUsageACOpen , - pstrUsageACClose , - pstrUsageACExit , - pstrUsageACMaximize , - pstrUsageACMinimize , - pstrUsageACSave , - pstrUsageACPrint , - pstrUsageACProperties , - pstrUsageACUndo , - pstrUsageACCopy , - pstrUsageACCut , - pstrUsageACPaste , - pstrUsageACSelectAll , - pstrUsageACFind , - pstrUsageACFindAndReplace , - pstrUsageACSearch , - pstrUsageACGoto , - pstrUsageACHome , - pstrUsageACBack , - pstrUsageACForward , - pstrUsageACStop , - pstrUsageACRefresh , - pstrUsageACPreviousLink , - pstrUsageACNextLink , - pstrUsageACBookmarks , - pstrUsageACHistory , - pstrUsageACSubscriptions , - pstrUsageACZoomIn , - pstrUsageACZoomOut , - pstrUsageACZoom , - pstrUsageACFullScreenView , - pstrUsageACNormalView , - pstrUsageACViewToggle , - pstrUsageACScrollUp , - pstrUsageACScrollDown , - pstrUsageACScroll , - pstrUsageACPanLeft , - pstrUsageACPanRight , - pstrUsageACPan , - pstrUsageACNewWindow , - pstrUsageACTileHoriz , - pstrUsageACTileVert , - pstrUsageACFormat , - pstrUsageACEdit , - pstrUsageACBold , - pstrUsageACItalics , - pstrUsageACUnderline , - pstrUsageACStrikethrough , - pstrUsageACSubscript , - pstrUsageACSuperscript , - pstrUsageACAllCaps , - pstrUsageACRotate , - pstrUsageACResize , - pstrUsageACFlipHorizontal , - pstrUsageACFlipVertical , - pstrUsageACMirrorHorizontal , - pstrUsageACMirrorVertical , - pstrUsageACFontSelect , - pstrUsageACFontColor , - pstrUsageACFontSize , - pstrUsageACJustifyLeft , - pstrUsageACJustifyCenterH , - pstrUsageACJustifyRight , - pstrUsageACJustifyBlockH , - pstrUsageACJustifyTop , - pstrUsageACJustifyCenterV , - pstrUsageACJustifyBottom , - pstrUsageACJustifyBlockV , - pstrUsageACIndentDecrease , - pstrUsageACIndentIncrease , - pstrUsageACNumberedList , - pstrUsageACRestartNumbering , - pstrUsageACBulletedList , - pstrUsageACPromote , - pstrUsageACDemote , - pstrUsageACYes , - pstrUsageACNo , - pstrUsageACCancel , - pstrUsageACCatalog , - pstrUsageACBuyChkout , - pstrUsageACAddToCart , - pstrUsageACExpand , - pstrUsageACExpandAll , - pstrUsageACCollapse , - pstrUsageACCollapseAll , - pstrUsageACPrintPreview , - pstrUsageACPasteSpecial , - pstrUsageACInsertMode , - pstrUsageACDelete , - pstrUsageACLock , - pstrUsageACUnlock , - pstrUsageACProtect , - pstrUsageACUnprotect , - pstrUsageACAttachComment , - pstrUsageACDeleteComment , - pstrUsageACViewComment , - pstrUsageACSelectWord , - pstrUsageACSelectSentence , - pstrUsageACSelectParagraph , - pstrUsageACSelectColumn , - pstrUsageACSelectRow , - pstrUsageACSelectTable , - pstrUsageACSelectObject , - pstrUsageACRedoRepeat , - pstrUsageACSort , - pstrUsageACSortAscending , - pstrUsageACSortDescending , - pstrUsageACFilter , - pstrUsageACSetClock , - pstrUsageACViewClock , - pstrUsageACSelectTimeZone , - pstrUsageACEditTimeZone , - pstrUsageACSetAlarm , - pstrUsageACClearAlarm , - pstrUsageACSnoozeAlarm , - pstrUsageACResetAlarm , - pstrUsageACSyncronize , - pstrUsageACSendReceive , - pstrUsageACSendTo , - pstrUsageACReply , - pstrUsageACReplyAll , - pstrUsageACForwardMessage , - pstrUsageACSend , - pstrUsageACAttachFile , - pstrUsageACUpload , - pstrUsageACDownload , - pstrUsageACSetBorders , - pstrUsageACInsertRow , - pstrUsageACInsertColumn , - pstrUsageACInsertFile , - pstrUsageACInsertPicture , - pstrUsageACInsertObject , - pstrUsageACInsertSymbol , - pstrUsageACSaveAndClose , - pstrUsageACRename , - pstrUsageACMerge , - pstrUsageACSplit , - pstrUsageACDistributeHorizontaly , - pstrUsageACDistributeVerticaly -}; - -void ReportDescParser::PrintConsumerPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x07) - Notify((char*)pgm_read_word(&consTitles0[usage - 1])); - else if (usage > 0x1f && usage < 0x23) - Notify((char*)pgm_read_word(&consTitles1[usage - 0x1f])); - else if (usage > 0x2f && usage < 0x37) - Notify((char*)pgm_read_word(&consTitles2[usage - 0x2f])); - else if (usage > 0x3f && usage < 0x49) - Notify((char*)pgm_read_word(&consTitles3[usage - 0x3f])); - else if (usage > 0x5f && usage < 0x67) - Notify((char*)pgm_read_word(&consTitles4[usage - 0x5f])); - else if (usage > 0x7f && usage < 0xa5) - Notify((char*)pgm_read_word(&consTitles5[usage - 0x7f])); - else if (usage > 0xaf && usage < 0xcf) - Notify((char*)pgm_read_word(&consTitles6[usage - 0xaf])); - else if (usage > 0xdf && usage < 0xeb) - Notify((char*)pgm_read_word(&consTitles7[usage - 0xdf])); - else if (usage > 0xef && usage < 0xf6) - Notify((char*)pgm_read_word(&consTitles8[usage - 0xef])); - else if (usage > 0xff && usage < 0x10e) - Notify((char*)pgm_read_word(&consTitles9[usage - 0xff])); - else if (usage > 0x14f && usage < 0x156) - Notify((char*)pgm_read_word(&consTitlesA[usage - 0x14f])); - else if (usage > 0x15f && usage < 0x16b) - Notify((char*)pgm_read_word(&consTitlesB[usage - 0x15f])); - else if (usage > 0x16f && usage < 0x175) - Notify((char*)pgm_read_word(&consTitlesC[usage - 0x16f])); - else if (usage > 0x17f && usage < 0x1c8) - Notify((char*)pgm_read_word(&consTitlesD[usage - 0x17f])); - else if (usage > 0x1ff && usage < 0x29d) - Notify((char*)pgm_read_word(&consTitlesE[usage - 0x1ff])); - else - Notify(pstrUsagePageUndefined); -} - -const char *digitTitles0[] PROGMEM = -{ - pstrUsageDigitizer , - pstrUsagePen , - pstrUsageLightPen , - pstrUsageTouchScreen , - pstrUsageTouchPad , - pstrUsageWhiteBoard , - pstrUsageCoordinateMeasuringMachine , - pstrUsage3DDigitizer , - pstrUsageStereoPlotter , - pstrUsageArticulatedArm , - pstrUsageArmature , - pstrUsageMultiplePointDigitizer , - pstrUsageFreeSpaceWand -}; -const char *digitTitles1[] PROGMEM = -{ - pstrUsageStylus , - pstrUsagePuck , - pstrUsageFinger - -}; -const char *digitTitles2[] PROGMEM = -{ - pstrUsageTipPressure , - pstrUsageBarrelPressure , - pstrUsageInRange , - pstrUsageTouch , - pstrUsageUntouch , - pstrUsageTap , - pstrUsageQuality , - pstrUsageDataValid , - pstrUsageTransducerIndex , - pstrUsageTabletFunctionKeys , - pstrUsageProgramChangeKeys , - pstrUsageBatteryStrength , - pstrUsageInvert , - pstrUsageXTilt , - pstrUsageYTilt , - pstrUsageAzimuth , - pstrUsageAltitude , - pstrUsageTwist , - pstrUsageTipSwitch , - pstrUsageSecondaryTipSwitch , - pstrUsageBarrelSwitch , - pstrUsageEraser , - pstrUsageTabletPick -}; - -void ReportDescParser::PrintDigitizerPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x0e) - Notify((char*)pgm_read_word(&digitTitles0[usage - 1])); - else if (usage > 0x1f && usage < 0x23) - Notify((char*)pgm_read_word(&digitTitles1[usage - 0x1f])); - else if (usage > 0x2f && usage < 0x47) - Notify((char*)pgm_read_word(&digitTitles2[usage - 0x2f])); - else - Notify(pstrUsagePageUndefined); -} - -const char *aplphanumTitles0[] PROGMEM = -{ - pstrUsageAlphanumericDisplay, - pstrUsageBitmappedDisplay -}; -const char *aplphanumTitles1[] PROGMEM = -{ - pstrUsageDisplayAttributesReport , - pstrUsageASCIICharacterSet , - pstrUsageDataReadBack , - pstrUsageFontReadBack , - pstrUsageDisplayControlReport , - pstrUsageClearDisplay , - pstrUsageDisplayEnable , - pstrUsageScreenSaverDelay , - pstrUsageScreenSaverEnable , - pstrUsageVerticalScroll , - pstrUsageHorizontalScroll , - pstrUsageCharacterReport , - pstrUsageDisplayData , - pstrUsageDisplayStatus , - pstrUsageStatusNotReady , - pstrUsageStatusReady , - pstrUsageErrorNotALoadableCharacter , - pstrUsageErrorFotDataCanNotBeRead , - pstrUsageCursorPositionReport , - pstrUsageRow , - pstrUsageColumn , - pstrUsageRows , - pstrUsageColumns , - pstrUsageCursorPixelPosition , - pstrUsageCursorMode , - pstrUsageCursorEnable , - pstrUsageCursorBlink , - pstrUsageFontReport , - pstrUsageFontData , - pstrUsageCharacterWidth , - pstrUsageCharacterHeight , - pstrUsageCharacterSpacingHorizontal , - pstrUsageCharacterSpacingVertical , - pstrUsageUnicodeCharset , - pstrUsageFont7Segment , - pstrUsage7SegmentDirectMap , - pstrUsageFont14Segment , - pstrUsage14SegmentDirectMap , - pstrUsageDisplayBrightness , - pstrUsageDisplayContrast , - pstrUsageCharacterAttribute , - pstrUsageAttributeReadback , - pstrUsageAttributeData , - pstrUsageCharAttributeEnhance , - pstrUsageCharAttributeUnderline , - pstrUsageCharAttributeBlink -}; -const char *aplphanumTitles2[] PROGMEM = -{ - pstrUsageBitmapSizeX , - pstrUsageBitmapSizeY , - pstrUsagePageReserved , - pstrUsageBitDepthFormat , - pstrUsageDisplayOrientation , - pstrUsagePaletteReport , - pstrUsagePaletteDataSize , - pstrUsagePaletteDataOffset , - pstrUsagePaletteData , - pstrUsageBlitReport , - pstrUsageBlitRectangleX1 , - pstrUsageBlitRectangleY1 , - pstrUsageBlitRectangleX2 , - pstrUsageBlitRectangleY2 , - pstrUsageBlitData , - pstrUsageSoftButton , - pstrUsageSoftButtonID , - pstrUsageSoftButtonSide , - pstrUsageSoftButtonOffset1 , - pstrUsageSoftButtonOffset2 , - pstrUsageSoftButtonReport -}; - -void ReportDescParser::PrintAlphanumDisplayPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage > 0x00 && usage < 0x03) - Notify((char*)pgm_read_word(&aplphanumTitles0[usage - 1])); - else if (usage > 0x1f && usage < 0x4e) - Notify((char*)pgm_read_word(&aplphanumTitles1[usage - 0x1f])); - else if (usage > 0x7f && usage < 0x96) - Notify((char*)pgm_read_word(&digitTitles2[usage - 0x80])); - else - Notify(pstrUsagePageUndefined); -} - -const char *medInstrTitles0[] PROGMEM = -{ - pstrUsageVCRAcquisition , - pstrUsageFreezeThaw , - pstrUsageClipStore , - pstrUsageUpdate , - pstrUsageNext , - pstrUsageSave , - pstrUsagePrint , - pstrUsageMicrophoneEnable -}; -const char *medInstrTitles1[] PROGMEM = -{ - pstrUsageCine , - pstrUsageTransmitPower , - pstrUsageVolume , - pstrUsageFocus , - pstrUsageDepth -}; -const char *medInstrTitles2[] PROGMEM = -{ - pstrUsageSoftStepPrimary , - pstrUsageSoftStepSecondary -}; -const char *medInstrTitles3[] PROGMEM = -{ - pstrUsageZoomSelect , - pstrUsageZoomAdjust , - pstrUsageSpectralDopplerModeSelect , - pstrUsageSpectralDopplerModeAdjust , - pstrUsageColorDopplerModeSelect , - pstrUsageColorDopplerModeAdjust , - pstrUsageMotionModeSelect , - pstrUsageMotionModeAdjust , - pstrUsage2DModeSelect , - pstrUsage2DModeAdjust -}; -const char *medInstrTitles4[] PROGMEM = -{ - pstrUsageSoftControlSelect , - pstrUsageSoftControlAdjust -}; - -void ReportDescParser::PrintMedicalInstrumentPageUsage(uint16_t usage) -{ - Notify(pstrSpace); - - if (usage == 1) - Notify(pstrUsageMedicalUltrasound); - else if (usage > 0x1f && usage < 0x28) - Notify((char*)pgm_read_word(&medInstrTitles0[usage - 0x1f])); - else if (usage > 0x3f && usage < 0x45) - Notify((char*)pgm_read_word(&medInstrTitles1[usage - 0x40])); - else if (usage > 0x5f && usage < 0x62) - Notify((char*)pgm_read_word(&medInstrTitles2[usage - 0x60])); - else if (usage == 0x70) - Notify(pstrUsageDepthGainCompensation); - else if (usage > 0x7f && usage < 0x8a) - Notify((char*)pgm_read_word(&medInstrTitles3[usage - 0x80])); - else if (usage > 0x9f && usage < 0xa2) - Notify((char*)pgm_read_word(&medInstrTitles4[usage - 0xa0])); - else - Notify(pstrUsagePageUndefined); -} - -void HID::PrintEndpointDescriptor( const USB_ENDPOINT_DESCRIPTOR* ep_ptr ) -{ - Notify(PSTR("Endpoint descriptor:")); - Notify(PSTR("\r\nLength:\t\t")); - PrintHex(ep_ptr->bLength); - Notify(PSTR("\r\nType:\t\t")); - PrintHex(ep_ptr->bDescriptorType); - Notify(PSTR("\r\nAddress:\t")); - PrintHex(ep_ptr->bEndpointAddress); - Notify(PSTR("\r\nAttributes:\t")); - PrintHex(ep_ptr->bmAttributes); - Notify(PSTR("\r\nMaxPktSize:\t")); - PrintHex(ep_ptr->wMaxPacketSize); - Notify(PSTR("\r\nPoll Intrv:\t")); - PrintHex(ep_ptr->bInterval); -} - -void HID::PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc) -{ - Notify(PSTR("\r\n\r\nHID Descriptor:\r\n")); - Notify(PSTR("bDescLength:\t\t")); - PrintHex(pDesc->bLength); - - Notify(PSTR("\r\nbDescriptorType:\t")); - PrintHex(pDesc->bDescriptorType); - - Notify(PSTR("\r\nbcdHID:\t\t\t")); - PrintHex(pDesc->bcdHID); - - Notify(PSTR("\r\nbCountryCode:\t\t")); - PrintHex(pDesc->bCountryCode); - - Notify(PSTR("\r\nbNumDescriptors:\t")); - PrintHex(pDesc->bNumDescriptors); - - Notify(PSTR("\r\nbDescrType:\t\t")); - PrintHex(pDesc->bDescrType); - - Notify(PSTR("\r\nwDescriptorLength:\t")); - PrintHex(pDesc->wDescriptorLength); -} diff --git a/hid.h b/hid.h deleted file mode 100644 index 7ca81b20..00000000 --- a/hid.h +++ /dev/null @@ -1,1195 +0,0 @@ -#if !defined(__HID_H__) -#define __HID_H__ - -#include -#include -#include "avrpins.h" -#include "max3421e.h" -#include "usbhost.h" -#include "usb_ch9.h" -#include "Usb.h" -#include - -#include "printhex.h" -#include "hexdump.h" -#include "message.h" - -#include "confdescparser.h" - -#define DATA_SIZE_MASK 0x03 -#define TYPE_MASK 0x0C -#define TAG_MASK 0xF0 - -#define DATA_SIZE_0 0x00 -#define DATA_SIZE_1 0x01 -#define DATA_SIZE_2 0x02 -#define DATA_SIZE_4 0x03 - -#define TYPE_MAIN 0x00 -#define TYPE_GLOBAL 0x04 -#define TYPE_LOCAL 0x08 - -#define TAG_MAIN_INPUT 0x80 -#define TAG_MAIN_OUTPUT 0x90 -#define TAG_MAIN_COLLECTION 0xA0 -#define TAG_MAIN_FEATURE 0xB0 -#define TAG_MAIN_ENDCOLLECTION 0xC0 - -#define TAG_GLOBAL_USAGEPAGE 0x00 -#define TAG_GLOBAL_LOGICALMIN 0x10 -#define TAG_GLOBAL_LOGICALMAX 0x20 -#define TAG_GLOBAL_PHYSMIN 0x30 -#define TAG_GLOBAL_PHYSMAX 0x40 -#define TAG_GLOBAL_UNITEXP 0x50 -#define TAG_GLOBAL_UNIT 0x60 -#define TAG_GLOBAL_REPORTSIZE 0x70 -#define TAG_GLOBAL_REPORTID 0x80 -#define TAG_GLOBAL_REPORTCOUNT 0x90 -#define TAG_GLOBAL_PUSH 0xA0 -#define TAG_GLOBAL_POP 0xB0 - -#define TAG_LOCAL_USAGE 0x00 -#define TAG_LOCAL_USAGEMIN 0x10 -#define TAG_LOCAL_USAGEMAX 0x20 - -/* HID requests */ -#define bmREQ_HIDOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -#define bmREQ_HIDIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -#define bmREQ_HIDREPORT USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_INTERFACE - -/* HID constants. Not part of chapter 9 */ -/* Class-Specific Requests */ -#define HID_REQUEST_GET_REPORT 0x01 -#define HID_REQUEST_GET_IDLE 0x02 -#define HID_REQUEST_GET_PROTOCOL 0x03 -#define HID_REQUEST_SET_REPORT 0x09 -#define HID_REQUEST_SET_IDLE 0x0A -#define HID_REQUEST_SET_PROTOCOL 0x0B - -/* Class Descriptor Types */ -#define HID_DESCRIPTOR_HID 0x21 -#define HID_DESCRIPTOR_REPORT 0x22 -#define HID_DESRIPTOR_PHY 0x23 - -/* Protocol Selection */ -#define BOOT_PROTOCOL 0x00 -#define RPT_PROTOCOL 0x01 - -/* HID Interface Class Code */ -#define HID_INTF 0x03 - -/* HID Interface Class SubClass Codes */ -#define HID_BOOT_INTF_SUBCLASS 0x01 - -/* HID Interface Class Protocol Codes */ -#define HID_PROTOCOL_NONE 0x00 -#define HID_PROTOCOL_KEYBOARD 0x01 -#define HID_PROTOCOL_MOUSE 0x02 - -///* HID descriptor */ -//typedef struct -//{ -// uint8_t bLength; -// uint8_t bDescriptorType; -// uint16_t bcdHID; // HID class specification release -// uint8_t bCountryCode; -// uint8_t bNumDescriptors; // Number of additional class specific descriptors -// uint8_t bDescrType; // Type of class descriptor -// uint16_t wDescriptorLength; // Total size of the Report descriptor -//} USB_HID_DESCRIPTOR; -// -//typedef struct -//{ -// uint8_t bDescrType; // Type of class descriptor -// uint16_t wDescriptorLength; // Total size of the Report descriptor -//} HID_CLASS_DESCRIPTOR_LEN_AND_TYPE; - -struct HidItemPrefix -{ - uint8_t bSize : 2; - uint8_t bType : 2; - uint8_t bTag : 4; -}; - -#define HID_ITEM_TYPE_MAIN 0 -#define HID_ITEM_TYPE_GLOBAL 1 -#define HID_ITEM_TYPE_LOCAL 2 -#define HID_ITEM_TYPE_RESERVED 3 - -#define HID_LONG_ITEM_PREFIX 0xfe // Long item prefix value - -#define bmHID_MAIN_ITEM_TAG 0xfc // Main item tag mask - -#define bmHID_MAIN_ITEM_INPUT 0x80 // Main item Input tag value -#define bmHID_MAIN_ITEM_OUTPUT 0x90 // Main item Output tag value -#define bmHID_MAIN_ITEM_FEATURE 0xb0 // Main item Feature tag value -#define bmHID_MAIN_ITEM_COLLECTION 0xa0 // Main item Collection tag value -#define bmHID_MAIN_ITEM_END_COLLECTION 0xce // Main item End Collection tag value - -#define HID_MAIN_ITEM_COLLECTION_PHYSICAL 0 -#define HID_MAIN_ITEM_COLLECTION_APPLICATION 1 -#define HID_MAIN_ITEM_COLLECTION_LOGICAL 2 -#define HID_MAIN_ITEM_COLLECTION_REPORT 3 -#define HID_MAIN_ITEM_COLLECTION_NAMED_ARRAY 4 -#define HID_MAIN_ITEM_COLLECTION_USAGE_SWITCH 5 -#define HID_MAIN_ITEM_COLLECTION_USAGE_MODIFIER 6 - -struct MainItemIOFeature -{ - uint8_t bmIsConstantOrData : 1; - uint8_t bmIsArrayOrVariable : 1; - uint8_t bmIsRelativeOrAbsolute : 1; - uint8_t bmIsWrapOrNoWrap : 1; - uint8_t bmIsNonLonearOrLinear : 1; - uint8_t bmIsNoPreferedOrPrefered : 1; - uint8_t bmIsNullOrNoNull : 1; - uint8_t bmIsVolatileOrNonVolatile : 1; -}; - -class ReportDescParser : public USBReadParser -{ -public: - typedef void (*UsagePageFunc)(uint16_t usage); - - static void PrintGenericDesktopPageUsage(uint16_t usage); - static void PrintSimulationControlsPageUsage(uint16_t usage); - static void PrintVRControlsPageUsage(uint16_t usage); - static void PrintSportsControlsPageUsage(uint16_t usage); - static void PrintGameControlsPageUsage(uint16_t usage); - static void PrintGenericDeviceControlsPageUsage(uint16_t usage); - static void PrintLEDPageUsage(uint16_t usage); - static void PrintTelephonyPageUsage(uint16_t usage); - static void PrintConsumerPageUsage(uint16_t usage); - static void PrintDigitizerPageUsage(uint16_t usage); - static void PrintAlphanumDisplayPageUsage(uint16_t usage); - static void PrintMedicalInstrumentPageUsage(uint16_t usage); - - static void PrintValue(uint8_t *p, uint8_t len); - static void PrintByteValue(uint8_t data); - -private: - static UsagePageFunc usagePageFunctions[]; - - MultiValueBuffer theBuffer; - MultiByteValueParser valParser; - ByteSkipper theSkipper; - uint8_t varBuffer[sizeof(USB_CONFIGURATION_DESCRIPTOR)]; - - uint8_t itemParseState; // Item parser state variable - uint8_t itemSize; // Item size - uint8_t itemPrefix; // Item prefix (first byte) - uint8_t rptSize; // Report Size - uint8_t rptCount; // Report Count - - uint8_t totalSize; // Report size in bytes - - uint8_t ParseItem(uint8_t **pp, uint16_t *pcntdn); - - UsagePageFunc pfUsage; - - static void PrintUsagePage(uint16_t page); - void SetUsagePage(uint16_t page); - -public: - ReportDescParser() : - itemParseState(0), - itemSize(0), - itemPrefix(0), - rptSize(0), - rptCount(0), - pfUsage(NULL) - { - theBuffer.pValue = varBuffer; - valParser.Initialize(&theBuffer); - theSkipper.Initialize(&theBuffer); - }; - - virtual void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset); - - enum - { - enErrorSuccess = 0 - , enErrorIncomplete // value or record is partialy read in buffer - , enErrorBufferTooSmall - }; -}; - - -#define maxHidInterfaces 3 -#define maxEpPerInterface 2 -#define totalEndpoints (maxHidInterfaces * maxEpPerInterface + 1) - -#define HID_MAX_HID_CLASS_DESCRIPTORS 5 - -class HID : public USBDeviceConfig, public UsbConfigXtracter -{ - // HID class specific descriptor type and length info obtained from HID descriptor - HID_CLASS_DESCRIPTOR_LEN_AND_TYPE descrInfo[HID_MAX_HID_CLASS_DESCRIPTORS]; - - // Returns HID class specific descriptor length by its type and order number - uint16_t GetHidClassDescrLen(uint8_t type, uint8_t num); - - static const uint8_t epInterruptInIndex; // InterruptIN endpoint index - static const uint8_t epInterruptOutIndex; // InterruptOUT endpoint index - - EpInfo epInfo[totalEndpoints]; - - struct HIDInterface - { - struct - { - uint8_t bmInterface : 3; - uint8_t bmAltSet : 3; - uint8_t bmProtocol : 2; - }; - uint8_t epIndex[maxEpPerInterface]; - }; - - HIDInterface hidInterfaces[maxHidInterfaces]; - - USB *pUsb; // USB class instance pointer - uint8_t bAddress; // address - uint8_t bConfNum; // configuration number - uint8_t bNumIface; // number of interfaces in the configuration - uint8_t bNumEP; // total number of EP in the configuration - uint32_t qNextPollTime; // next poll time - bool bPollEnable; // poll enable flag - - void Initialize(); - HIDInterface* FindInterface(uint8_t iface, uint8_t alt, uint8_t proto); - - void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); - void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc); - -public: - HID(USB *p); - - uint8_t setProto( uint8_t ep, uint8_t iface, uint8_t protocol ); - uint8_t getProto( uint8_t ep, uint8_t iface, uint8_t* dataptr ); - - uint8_t getReportDescr( uint8_t ep, USBReadParser *parser = NULL); - - uint8_t getHidDescr( uint8_t ep, uint16_t nbytes, uint8_t* dataptr ); - //uint8_t getHidDescr( uint8_t ep, uint16_t nbytes, uint8_t iface, uint8_t report_type, uint8_t report_id, uint8_t* dataptr ); - uint8_t setReport( uint8_t ep, uint16_t nbytes, uint8_t iface, uint8_t report_type, uint8_t report_id, uint8_t* dataptr ); - uint8_t getReport( uint8_t ep, uint16_t nbytes, uint8_t iface, uint8_t report_type, uint8_t report_id, uint8_t* dataptr ); - uint8_t getIdle( uint8_t ep, uint8_t iface, uint8_t reportID, uint8_t* dataptr ); - uint8_t setIdle( uint8_t ep, uint8_t iface, uint8_t reportID, uint8_t duration ); - - // USBDeviceConfig implementation - virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed); - virtual uint8_t Release(); - virtual uint8_t Poll(); - virtual uint8_t GetAddress() { return bAddress; }; - - // UsbConfigXtracter implementation - //virtual void ConfigXtract(const USB_CONFIGURATION_DESCRIPTOR *conf) {}; - //virtual void InterfaceXtract(uint8_t conf, const USB_INTERFACE_DESCRIPTOR *iface) {}; - virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep); -}; - -const char pstrSpace [] PROGMEM = " "; -const char pstrCRLF [] PROGMEM = "\r\n"; -const char pstrSingleTab [] PROGMEM = "\t"; -const char pstrDoubleTab [] PROGMEM = "\t\t"; -const char pstrTripleTab [] PROGMEM = "\t\t\t"; - -// Usage Page String Titles -const char pstrUsagePageUndefined [] PROGMEM = "Undef"; -const char pstrUsagePageGenericDesktopControls [] PROGMEM = "Gen Desktop Ctrls"; -const char pstrUsagePageSimulationControls [] PROGMEM = "Simu Ctrls"; -const char pstrUsagePageVRControls [] PROGMEM = "VR Ctrls"; -const char pstrUsagePageSportControls [] PROGMEM = "Sport Ctrls"; -const char pstrUsagePageGameControls [] PROGMEM = "Game Ctrls"; -const char pstrUsagePageGenericDeviceControls [] PROGMEM = "Gen Dev Ctrls"; -const char pstrUsagePageKeyboardKeypad [] PROGMEM = "Kbrd/Keypad"; -const char pstrUsagePageLEDs [] PROGMEM = "LEDs"; -const char pstrUsagePageButton [] PROGMEM = "Button"; -const char pstrUsagePageOrdinal [] PROGMEM = "Ordinal"; -const char pstrUsagePageTelephone [] PROGMEM = "Tel"; -const char pstrUsagePageConsumer [] PROGMEM = "Consumer"; -const char pstrUsagePageDigitizer [] PROGMEM = "Digitizer"; -const char pstrUsagePagePID [] PROGMEM = "PID"; -const char pstrUsagePageUnicode [] PROGMEM = "Unicode"; -const char pstrUsagePageAlphaNumericDisplay [] PROGMEM = "Alpha Num Disp"; -const char pstrUsagePageMedicalInstruments [] PROGMEM = "Medical Instr"; -const char pstrUsagePageMonitor [] PROGMEM = "Monitor"; -const char pstrUsagePagePower [] PROGMEM = "Power"; -const char pstrUsagePageBarCodeScanner [] PROGMEM = "Bar Code Scan"; -const char pstrUsagePageScale [] PROGMEM = "Scale"; -const char pstrUsagePageMSRDevices [] PROGMEM = "Magn Stripe Read Dev"; -const char pstrUsagePagePointOfSale [] PROGMEM = "POS"; -const char pstrUsagePageCameraControl [] PROGMEM = "Cam Ctrl"; -const char pstrUsagePageArcade [] PROGMEM = "Arcade"; -const char pstrUsagePageReserved [] PROGMEM = "Reserved"; -const char pstrUsagePageVendorDefined [] PROGMEM = "Vendor Def"; - -// Generic Desktop Controls Page -const char pstrUsagePointer [] PROGMEM = "Pointer"; -const char pstrUsageMouse [] PROGMEM = "Mouse"; -const char pstrUsageJoystick [] PROGMEM = "Joystick"; -const char pstrUsageGamePad [] PROGMEM = "Game Pad"; -const char pstrUsageKeyboard [] PROGMEM = "Kbrd"; -const char pstrUsageKeypad [] PROGMEM = "Keypad"; -const char pstrUsageMultiAxisController [] PROGMEM = "Multi-axis Ctrl"; -const char pstrUsageTabletPCSystemControls [] PROGMEM = "Tablet PC Sys Ctrls"; -const char pstrUsageX [] PROGMEM = "X"; -const char pstrUsageY [] PROGMEM = "Y"; -const char pstrUsageZ [] PROGMEM = "Z"; -const char pstrUsageRx [] PROGMEM = "Rx"; -const char pstrUsageRy [] PROGMEM = "Ry"; -const char pstrUsageRz [] PROGMEM = "Rz"; -const char pstrUsageSlider [] PROGMEM = "Slider"; -const char pstrUsageDial [] PROGMEM = "Dial"; -const char pstrUsageWheel [] PROGMEM = "Wheel"; -const char pstrUsageHatSwitch [] PROGMEM = "Hat Switch"; -const char pstrUsageCountedBuffer [] PROGMEM = "Counted Buf"; -const char pstrUsageByteCount [] PROGMEM = "Byte Count"; -const char pstrUsageMotionWakeup [] PROGMEM = "Motion Wakeup"; -const char pstrUsageStart [] PROGMEM = "Start"; -const char pstrUsageSelect [] PROGMEM = "Sel"; -const char pstrUsageVx [] PROGMEM = "Vx"; -const char pstrUsageVy [] PROGMEM = "Vy"; -const char pstrUsageVz [] PROGMEM = "Vz"; -const char pstrUsageVbrx [] PROGMEM = "Vbrx"; -const char pstrUsageVbry [] PROGMEM = "Vbry"; -const char pstrUsageVbrz [] PROGMEM = "Vbrz"; -const char pstrUsageVno [] PROGMEM = "Vno"; -const char pstrUsageFeatureNotification [] PROGMEM = "Feature Notif"; -const char pstrUsageResolutionMultiplier [] PROGMEM = "Res Mult"; -const char pstrUsageSystemControl [] PROGMEM = "Sys Ctrl"; -const char pstrUsageSystemPowerDown [] PROGMEM = "Sys Pwr Down"; -const char pstrUsageSystemSleep [] PROGMEM = "Sys Sleep"; -const char pstrUsageSystemWakeup [] PROGMEM = "Sys Wakeup"; -const char pstrUsageSystemContextMenu [] PROGMEM = "Sys Context Menu"; -const char pstrUsageSystemMainMenu [] PROGMEM = "Sys Main Menu"; -const char pstrUsageSystemAppMenu [] PROGMEM = "Sys App Menu"; -const char pstrUsageSystemMenuHelp [] PROGMEM = "Sys Menu Help"; -const char pstrUsageSystemMenuExit [] PROGMEM = "Sys Menu Exit"; -const char pstrUsageSystemMenuSelect [] PROGMEM = "Sys Menu Select"; -const char pstrUsageSystemMenuRight [] PROGMEM = "Sys Menu Right"; -const char pstrUsageSystemMenuLeft [] PROGMEM = "Sys Menu Left"; -const char pstrUsageSystemMenuUp [] PROGMEM = "Sys Menu Up"; -const char pstrUsageSystemMenuDown [] PROGMEM = "Sys Menu Down"; -const char pstrUsageSystemColdRestart [] PROGMEM = "Sys Cold Restart"; -const char pstrUsageSystemWarmRestart [] PROGMEM = "Sys Warm Restart"; -const char pstrUsageDPadUp [] PROGMEM = "D-pad Up"; -const char pstrUsageDPadDown [] PROGMEM = "D-pad Down"; -const char pstrUsageDPadRight [] PROGMEM = "D-pad Right"; -const char pstrUsageDPadLeft [] PROGMEM = "D-pad Left"; -const char pstrUsageSystemDock [] PROGMEM = "Sys Dock"; -const char pstrUsageSystemUndock [] PROGMEM = "Sys Undock"; -const char pstrUsageSystemSetup [] PROGMEM = "Sys Setup"; -const char pstrUsageSystemBreak [] PROGMEM = "Sys Break"; -const char pstrUsageSystemDebuggerBreak [] PROGMEM = "Sys Dbg Brk"; -const char pstrUsageApplicationBreak [] PROGMEM = "App Break"; -const char pstrUsageApplicationDebuggerBreak [] PROGMEM = "App Dbg Brk"; -const char pstrUsageSystemSpeakerMute [] PROGMEM = "Sys Spk Mute"; -const char pstrUsageSystemHibernate [] PROGMEM = "Sys Hiber"; -const char pstrUsageSystemDisplayInvert [] PROGMEM = "Sys Disp Inv"; -const char pstrUsageSystemDisplayInternal [] PROGMEM = "Sys Disp Int"; -const char pstrUsageSystemDisplayExternal [] PROGMEM = "Sys Disp Ext"; -const char pstrUsageSystemDisplayBoth [] PROGMEM = "Sys Disp Both"; -const char pstrUsageSystemDisplayDual [] PROGMEM = "Sys Disp Dual"; -const char pstrUsageSystemDisplayToggleIntExt [] PROGMEM = "Sys Disp Tgl Int/Ext"; -const char pstrUsageSystemDisplaySwapPriSec [] PROGMEM = "Sys Disp Swap Pri/Sec"; -const char pstrUsageSystemDisplayLCDAutoscale [] PROGMEM = "Sys Disp LCD Autoscale"; - -// Simulation Controls Page -const char pstrUsageFlightSimulationDevice [] PROGMEM = "Flight Simu Dev"; -const char pstrUsageAutomobileSimulationDevice [] PROGMEM = "Auto Simu Dev"; -const char pstrUsageTankSimulationDevice [] PROGMEM = "Tank Simu Dev"; -const char pstrUsageSpaceshipSimulationDevice [] PROGMEM = "Space Simu Dev"; -const char pstrUsageSubmarineSimulationDevice [] PROGMEM = "Subm Simu Dev"; -const char pstrUsageSailingSimulationDevice [] PROGMEM = "Sail Simu Dev"; -const char pstrUsageMotocicleSimulationDevice [] PROGMEM = "Moto Simu Dev"; -const char pstrUsageSportsSimulationDevice [] PROGMEM = "Sport Simu Dev"; -const char pstrUsageAirplaneSimulationDevice [] PROGMEM = "Airp Simu Dev"; -const char pstrUsageHelicopterSimulationDevice [] PROGMEM = "Heli Simu Dev"; -const char pstrUsageMagicCarpetSimulationDevice [] PROGMEM = "Magic Carpet Simu Dev"; -const char pstrUsageBicycleSimulationDevice [] PROGMEM = "Bike Simu Dev"; -const char pstrUsageFlightControlStick [] PROGMEM = "Flight Ctrl Stick"; -const char pstrUsageFlightStick [] PROGMEM = "Flight Stick"; -const char pstrUsageCyclicControl [] PROGMEM = "Cyclic Ctrl"; -const char pstrUsageCyclicTrim [] PROGMEM = "Cyclic Trim"; -const char pstrUsageFlightYoke [] PROGMEM = "Flight Yoke"; -const char pstrUsageTrackControl [] PROGMEM = "Track Ctrl"; -const char pstrUsageAileron [] PROGMEM = "Aileron"; -const char pstrUsageAileronTrim [] PROGMEM = "Aileron Trim"; -const char pstrUsageAntiTorqueControl [] PROGMEM = "Anti-Torque Ctrl"; -const char pstrUsageAutopilotEnable [] PROGMEM = "Autopilot Enable"; -const char pstrUsageChaffRelease [] PROGMEM = "Chaff Release"; -const char pstrUsageCollectiveControl [] PROGMEM = "Collective Ctrl"; -const char pstrUsageDiveBrake [] PROGMEM = "Dive Brake"; -const char pstrUsageElectronicCountermeasures [] PROGMEM = "El Countermeasures"; -const char pstrUsageElevator [] PROGMEM = "Elevator"; -const char pstrUsageElevatorTrim [] PROGMEM = "Elevator Trim"; -const char pstrUsageRudder [] PROGMEM = "Rudder"; -const char pstrUsageThrottle [] PROGMEM = "Throttle"; -const char pstrUsageFlightCommunications [] PROGMEM = "Flight Comm"; -const char pstrUsageFlareRelease [] PROGMEM = "Flare Release"; -const char pstrUsageLandingGear [] PROGMEM = "Landing Gear"; -const char pstrUsageToeBrake [] PROGMEM = "Toe Brake"; -const char pstrUsageTrigger [] PROGMEM = "Trigger"; -const char pstrUsageWeaponsArm [] PROGMEM = "Weapons Arm"; -const char pstrUsageWeaponsSelect [] PROGMEM = "Weapons Sel"; -const char pstrUsageWingFlaps [] PROGMEM = "Wing Flaps"; -const char pstrUsageAccelerator [] PROGMEM = "Accel"; -const char pstrUsageBrake [] PROGMEM = "Brake"; -const char pstrUsageClutch [] PROGMEM = "Clutch"; -const char pstrUsageShifter [] PROGMEM = "Shifter"; -const char pstrUsageSteering [] PROGMEM = "Steering"; -const char pstrUsageTurretDirection [] PROGMEM = "Turret Dir"; -const char pstrUsageBarrelElevation [] PROGMEM = "Barrel Ele"; -const char pstrUsageDivePlane [] PROGMEM = "Dive Plane"; -const char pstrUsageBallast [] PROGMEM = "Ballast"; -const char pstrUsageBicycleCrank [] PROGMEM = "Bicycle Crank"; -const char pstrUsageHandleBars [] PROGMEM = "Handle Bars"; -const char pstrUsageFrontBrake [] PROGMEM = "Front Brake"; -const char pstrUsageRearBrake [] PROGMEM = "Rear Brake"; - -// VR Controls Page -const char pstrUsageBelt [] PROGMEM = "Belt"; -const char pstrUsageBodySuit [] PROGMEM = "Body Suit"; -const char pstrUsageFlexor [] PROGMEM = "Flexor"; -const char pstrUsageGlove [] PROGMEM = "Glove"; -const char pstrUsageHeadTracker [] PROGMEM = "Head Track"; -const char pstrUsageHeadMountedDisplay [] PROGMEM = "Head Disp"; -const char pstrUsageHandTracker [] PROGMEM = "Hand Track"; -const char pstrUsageOculometer [] PROGMEM = "Oculometer"; -const char pstrUsageVest [] PROGMEM = "Vest"; -const char pstrUsageAnimatronicDevice [] PROGMEM = "Animat Dev"; -const char pstrUsageStereoEnable [] PROGMEM = "Stereo Enbl"; -const char pstrUsageDisplayEnable [] PROGMEM = "Display Enbl"; - -// Sport Controls Page -const char pstrUsageBaseballBat [] PROGMEM = "Baseball Bat"; -const char pstrUsageGolfClub [] PROGMEM = "Golf Club"; -const char pstrUsageRowingMachine [] PROGMEM = "Rowing Mach"; -const char pstrUsageTreadmill [] PROGMEM = "Treadmill"; -const char pstrUsageOar [] PROGMEM = "Oar"; -const char pstrUsageSlope [] PROGMEM = "Slope"; -const char pstrUsageRate [] PROGMEM = "Rate"; -const char pstrUsageStickSpeed [] PROGMEM = "Stick Speed"; -const char pstrUsageStickFaceAngle [] PROGMEM = "Stick Face Ang"; -const char pstrUsageStickHeelToe [] PROGMEM = "Stick Heel/Toe"; -const char pstrUsageStickFollowThough [] PROGMEM = "Stick Flw Thru"; -const char pstrUsageStickTempo [] PROGMEM = "Stick Tempo"; -const char pstrUsageStickType [] PROGMEM = "Stick Type"; -const char pstrUsageStickHeight [] PROGMEM = "Stick Hght"; -const char pstrUsagePutter [] PROGMEM = "Putter"; -const char pstrUsage1Iron [] PROGMEM = "1 Iron"; -const char pstrUsage2Iron [] PROGMEM = "2 Iron"; -const char pstrUsage3Iron [] PROGMEM = "3 Iron"; -const char pstrUsage4Iron [] PROGMEM = "4 Iron"; -const char pstrUsage5Iron [] PROGMEM = "5 Iron"; -const char pstrUsage6Iron [] PROGMEM = "6 Iron"; -const char pstrUsage7Iron [] PROGMEM = "7 Iron"; -const char pstrUsage8Iron [] PROGMEM = "8 Iron"; -const char pstrUsage9Iron [] PROGMEM = "9 Iron"; -const char pstrUsage10Iron [] PROGMEM = "10 Iron"; -const char pstrUsage11Iron [] PROGMEM = "11 Iron"; -const char pstrUsageSandWedge [] PROGMEM = "Sand Wedge"; -const char pstrUsageLoftWedge [] PROGMEM = "Loft Wedge"; -const char pstrUsagePowerWedge [] PROGMEM = "Pwr Wedge"; -const char pstrUsage1Wood [] PROGMEM = "1 Wood"; -const char pstrUsage3Wood [] PROGMEM = "3 Wood"; -const char pstrUsage5Wood [] PROGMEM = "5 Wood"; -const char pstrUsage7Wood [] PROGMEM = "7 Wood"; -const char pstrUsage9Wood [] PROGMEM = "9 Wood"; - -// Game Controls Page -const char pstrUsage3DGameController [] PROGMEM = "3D Game Ctrl"; -const char pstrUsagePinballDevice [] PROGMEM = "Pinball Dev"; -const char pstrUsageGunDevice [] PROGMEM = "Gun Dev"; -const char pstrUsagePointOfView [] PROGMEM = "POV"; -const char pstrUsageTurnRightLeft [] PROGMEM = "Turn Right Left"; -const char pstrUsagePitchForwardBackward [] PROGMEM = "Pitch Fwd/Back"; -const char pstrUsageRollRightLeft [] PROGMEM = "Roll Right/Left"; -const char pstrUsageMoveRightLeft [] PROGMEM = "Move Right/Left"; -const char pstrUsageMoveForwardBackward [] PROGMEM = "Move Fwd/Back"; -const char pstrUsageMoveUpDown [] PROGMEM = "Move Up/Down"; -const char pstrUsageLeanRightLeft [] PROGMEM = "Lean Right/Left"; -const char pstrUsageLeanForwardBackward [] PROGMEM = "Lean Fwd/Back"; -const char pstrUsageHeightOfPOV [] PROGMEM = "Height of POV"; -const char pstrUsageFlipper [] PROGMEM = "Flipper"; -const char pstrUsageSecondaryFlipper [] PROGMEM = "Second Flipper"; -const char pstrUsageBump [] PROGMEM = "Bump"; -const char pstrUsageNewGame [] PROGMEM = "New Game"; -const char pstrUsageShootBall [] PROGMEM = "Shoot Ball"; -const char pstrUsagePlayer [] PROGMEM = "Player"; -const char pstrUsageGunBolt [] PROGMEM = "Gun Bolt"; -const char pstrUsageGunClip [] PROGMEM = "Gun Clip"; -const char pstrUsageGunSelector [] PROGMEM = "Gun Sel"; -const char pstrUsageGunSingleShot [] PROGMEM = "Gun Sngl Shot"; -const char pstrUsageGunBurst [] PROGMEM = "Gun Burst"; -const char pstrUsageGunAutomatic [] PROGMEM = "Gun Auto"; -const char pstrUsageGunSafety [] PROGMEM = "Gun Safety"; -const char pstrUsageGamepadFireJump [] PROGMEM = "Gamepad Fire/Jump"; -const char pstrUsageGamepadTrigger [] PROGMEM = "Gamepad Trig"; - -// Generic Device Controls Page -const char pstrUsageBatteryStrength [] PROGMEM = "Bat Strength"; -const char pstrUsageWirelessChannel [] PROGMEM = "Wireless Ch"; -const char pstrUsageWirelessID [] PROGMEM = "Wireless ID"; -const char pstrUsageDiscoverWirelessControl [] PROGMEM = "Discover Wireless Ctrl"; -const char pstrUsageSecurityCodeCharEntered [] PROGMEM = "Sec Code Char Entrd"; -const char pstrUsageSecurityCodeCharErased [] PROGMEM = "Sec Code Char Erased"; -const char pstrUsageSecurityCodeCleared [] PROGMEM = "Sec Code Cleared"; - -// LED Page -const char pstrUsageNumLock [] PROGMEM = "Num Lock"; -const char pstrUsageCapsLock [] PROGMEM = "Caps Lock"; -const char pstrUsageScrollLock [] PROGMEM = "Scroll Lock"; -const char pstrUsageCompose [] PROGMEM = "Compose"; -const char pstrUsageKana [] PROGMEM = "Kana"; -const char pstrUsagePower [] PROGMEM = "Pwr"; -const char pstrUsageShift [] PROGMEM = "Shift"; -const char pstrUsageDoNotDisturb [] PROGMEM = "DND"; -const char pstrUsageMute [] PROGMEM = "Mute"; -const char pstrUsageToneEnable [] PROGMEM = "Tone Enbl"; -const char pstrUsageHighCutFilter [] PROGMEM = "High Cut Fltr"; -const char pstrUsageLowCutFilter [] PROGMEM = "Low Cut Fltr"; -const char pstrUsageEqualizerEnable [] PROGMEM = "Eq Enbl"; -const char pstrUsageSoundFieldOn [] PROGMEM = "Sound Field On"; -const char pstrUsageSurroundOn [] PROGMEM = "Surround On"; -const char pstrUsageRepeat [] PROGMEM = "Repeat"; -const char pstrUsageStereo [] PROGMEM = "Stereo"; -const char pstrUsageSamplingRateDetect [] PROGMEM = "Smpl Rate Detect"; -const char pstrUsageSpinning [] PROGMEM = "Spinning"; -const char pstrUsageCAV [] PROGMEM = "CAV"; -const char pstrUsageCLV [] PROGMEM = "CLV"; -const char pstrUsageRecordingFormatDetect [] PROGMEM = "Rec Format Detect"; -const char pstrUsageOffHook [] PROGMEM = "Off Hook"; -const char pstrUsageRing [] PROGMEM = "Ring"; -const char pstrUsageMessageWaiting [] PROGMEM = "Msg Wait"; -const char pstrUsageDataMode [] PROGMEM = "Data Mode"; -const char pstrUsageBatteryOperation [] PROGMEM = "Bat Op"; -const char pstrUsageBatteryOK [] PROGMEM = "Bat OK"; -const char pstrUsageBatteryLow [] PROGMEM = "Bat Low"; -const char pstrUsageSpeaker [] PROGMEM = "Speaker"; -const char pstrUsageHeadSet [] PROGMEM = "Head Set"; -const char pstrUsageHold [] PROGMEM = "Hold"; -const char pstrUsageMicrophone [] PROGMEM = "Mic"; -const char pstrUsageCoverage [] PROGMEM = "Coverage"; -const char pstrUsageNightMode [] PROGMEM = "Night Mode"; -const char pstrUsageSendCalls [] PROGMEM = "Send Calls"; -const char pstrUsageCallPickup [] PROGMEM = "Call Pickup"; -const char pstrUsageConference [] PROGMEM = "Conf"; -const char pstrUsageStandBy [] PROGMEM = "Stand-by"; -const char pstrUsageCameraOn [] PROGMEM = "Cam On"; -const char pstrUsageCameraOff [] PROGMEM = "Cam Off"; -const char pstrUsageOnLine [] PROGMEM = "On-Line"; -const char pstrUsageOffLine [] PROGMEM = "Off-Line"; -const char pstrUsageBusy [] PROGMEM = "Busy"; -const char pstrUsageReady [] PROGMEM = "Ready"; -const char pstrUsagePaperOut [] PROGMEM = "Paper Out"; -const char pstrUsagePaperJam [] PROGMEM = "Paper Jam"; -const char pstrUsageRemote [] PROGMEM = "Remote"; -const char pstrUsageForward [] PROGMEM = "Fwd"; -const char pstrUsageReverse [] PROGMEM = "Rev"; -const char pstrUsageStop [] PROGMEM = "Stop"; -const char pstrUsageRewind [] PROGMEM = "Rewind"; -const char pstrUsageFastForward [] PROGMEM = "Fast Fwd"; -const char pstrUsagePlay [] PROGMEM = "Play"; -const char pstrUsagePause [] PROGMEM = "Pause"; -const char pstrUsageRecord [] PROGMEM = "Rec"; -const char pstrUsageError [] PROGMEM = "Error"; -const char pstrUsageSelectedIndicator [] PROGMEM = "Usage Sel Ind"; -const char pstrUsageInUseIndicator [] PROGMEM = "Usage In Use Ind"; -const char pstrUsageMultiModeIndicator [] PROGMEM = "Usage Multi Mode Ind"; -const char pstrUsageIndicatorOn [] PROGMEM = "Ind On"; -const char pstrUsageIndicatorFlash [] PROGMEM = "Ind Flash"; -const char pstrUsageIndicatorSlowBlink [] PROGMEM = "Ind Slow Blk"; -const char pstrUsageIndicatorFastBlink [] PROGMEM = "Ind Fast Blk"; -const char pstrUsageIndicatorOff [] PROGMEM = "Ind Off"; -const char pstrUsageFlashOnTime [] PROGMEM = "Flash On Time"; -const char pstrUsageSlowBlinkOnTime [] PROGMEM = "Slow Blk On Time"; -const char pstrUsageSlowBlinkOffTime [] PROGMEM = "Slow Blk Off Time"; -const char pstrUsageFastBlinkOnTime [] PROGMEM = "Fast Blk On Time"; -const char pstrUsageFastBlinkOffTime [] PROGMEM = "Fast Blk Off Time"; -const char pstrUsageIndicatorColor [] PROGMEM = "Usage Ind Color"; -const char pstrUsageIndicatorRed [] PROGMEM = "Ind Red"; -const char pstrUsageIndicatorGreen [] PROGMEM = "Ind Green"; -const char pstrUsageIndicatorAmber [] PROGMEM = "Ind Amber"; -const char pstrUsageGenericIndicator [] PROGMEM = "Gen Ind"; -const char pstrUsageSystemSuspend [] PROGMEM = "Sys Suspend"; -const char pstrUsageExternalPowerConnected [] PROGMEM = "Ext Pwr Conn"; - -// Telephony Usage Page -const char pstrUsagePhone [] PROGMEM = "Phone"; -const char pstrUsageAnsweringMachine [] PROGMEM = "Answ Mach"; -const char pstrUsageMessageControls [] PROGMEM = "Msg Ctrls"; -const char pstrUsageHandset [] PROGMEM = "Handset"; -const char pstrUsageHeadset [] PROGMEM = "Headset"; -const char pstrUsageTelephonyKeyPad [] PROGMEM = "Tel Key Pad"; -const char pstrUsageProgrammableButton [] PROGMEM = "Prog Button"; -const char pstrUsageHookSwitch [] PROGMEM = "Hook Sw"; -const char pstrUsageFlash [] PROGMEM = "Flash"; -const char pstrUsageFeature [] PROGMEM = "Feature"; -//const char pstrUsageHold [] PROGMEM = "Hold"; -const char pstrUsageRedial [] PROGMEM = "Redial"; -const char pstrUsageTransfer [] PROGMEM = "Transfer"; -const char pstrUsageDrop [] PROGMEM = "Drop"; -const char pstrUsagePark [] PROGMEM = "Park"; -const char pstrUsageForwardCalls [] PROGMEM = "Fwd Calls"; -const char pstrUsageAlternateFunction [] PROGMEM = "Alt Func"; -const char pstrUsageLine [] PROGMEM = "Line"; -const char pstrUsageSpeakerPhone [] PROGMEM = "Spk Phone"; -//const char pstrUsageConference [] PROGMEM = "Conference"; -const char pstrUsageRingEnable [] PROGMEM = "Ring Enbl"; -const char pstrUsageRingSelect [] PROGMEM = "Ring Sel"; -const char pstrUsagePhoneMute [] PROGMEM = "Phone Mute"; -const char pstrUsageCallerID [] PROGMEM = "Caller ID"; -const char pstrUsageSend [] PROGMEM = "Send"; -const char pstrUsageSpeedDial [] PROGMEM = "Speed Dial"; -const char pstrUsageStoreNumber [] PROGMEM = "Store Num"; -const char pstrUsageRecallNumber [] PROGMEM = "Recall Num"; -const char pstrUsagePhoneDirectory [] PROGMEM = "Phone Dir"; -const char pstrUsageVoiceMail [] PROGMEM = "Voice Mail"; -const char pstrUsageScreenCalls [] PROGMEM = "Screen Calls"; -//const char pstrUsageDoNotDisturb [] PROGMEM = "Do Not Disturb"; -const char pstrUsageMessage [] PROGMEM = "Msg"; -const char pstrUsageAnswerOnOff [] PROGMEM = "Answer On/Off"; -const char pstrUsageInsideDialTone [] PROGMEM = "Inside Dial Tone"; -const char pstrUsageOutsideDialTone [] PROGMEM = "Outside Dial Tone"; -const char pstrUsageInsideRingTone [] PROGMEM = "Inside Ring Tone"; -const char pstrUsageOutsideRingTone [] PROGMEM = "Outside Ring Tone"; -const char pstrUsagePriorityRingTone [] PROGMEM = "Prior Ring Tone"; -const char pstrUsageInsideRingback [] PROGMEM = "Inside Ringback"; -const char pstrUsagePriorityRingback [] PROGMEM = "Priority Ringback"; -const char pstrUsageLineBusyTone [] PROGMEM = "Ln Busy Tone"; -const char pstrUsageReorderTone [] PROGMEM = "Reorder Tone"; -const char pstrUsageCallWaitingTone [] PROGMEM = "Call Wait Tone"; -const char pstrUsageConfirmationTone1 [] PROGMEM = "Cnfrm Tone1"; -const char pstrUsageConfirmationTone2 [] PROGMEM = "Cnfrm Tone2"; -const char pstrUsageTonesOff [] PROGMEM = "Tones Off"; -const char pstrUsageOutsideRingback [] PROGMEM = "Outside Ringback"; -const char pstrUsageRinger [] PROGMEM = "Ringer"; -const char pstrUsagePhoneKey0 [] PROGMEM = "0"; -const char pstrUsagePhoneKey1 [] PROGMEM = "1"; -const char pstrUsagePhoneKey2 [] PROGMEM = "2"; -const char pstrUsagePhoneKey3 [] PROGMEM = "3"; -const char pstrUsagePhoneKey4 [] PROGMEM = "4"; -const char pstrUsagePhoneKey5 [] PROGMEM = "5"; -const char pstrUsagePhoneKey6 [] PROGMEM = "6"; -const char pstrUsagePhoneKey7 [] PROGMEM = "7"; -const char pstrUsagePhoneKey8 [] PROGMEM = "8"; -const char pstrUsagePhoneKey9 [] PROGMEM = "9"; -const char pstrUsagePhoneKeyStar [] PROGMEM = "*"; -const char pstrUsagePhoneKeyPound [] PROGMEM = "#"; -const char pstrUsagePhoneKeyA [] PROGMEM = "A"; -const char pstrUsagePhoneKeyB [] PROGMEM = "B"; -const char pstrUsagePhoneKeyC [] PROGMEM = "C"; -const char pstrUsagePhoneKeyD [] PROGMEM = "D"; - -// Consumer Usage Page -const char pstrUsageConsumerControl [] PROGMEM = "Consumer Ctrl"; -const char pstrUsageNumericKeyPad [] PROGMEM = "Num Key Pad"; -//const char pstrUsageProgrammableButton [] PROGMEM = "Prog Btn"; -//const char pstrUsageMicrophone [] PROGMEM = "Mic"; -const char pstrUsageHeadphone [] PROGMEM = "Headphone"; -const char pstrUsageGraphicEqualizer [] PROGMEM = "Graph Eq"; -const char pstrUsagePlus10 [] PROGMEM = "+10"; -const char pstrUsagePlus100 [] PROGMEM = "+100"; -const char pstrUsageAMPM [] PROGMEM = "AM/PM"; -//const char pstrUsagePower [] PROGMEM = "Pwr"; -const char pstrUsageReset [] PROGMEM = "Reset"; -const char pstrUsageSleep [] PROGMEM = "Sleep"; -const char pstrUsageSleepAfter [] PROGMEM = "Sleep After"; -const char pstrUsageSleepMode [] PROGMEM = "Sleep Mode"; -const char pstrUsageIllumination [] PROGMEM = "Illumin"; -const char pstrUsageFunctionButtons [] PROGMEM = "Func Btns"; -const char pstrUsageMenu [] PROGMEM = "Menu"; -const char pstrUsageMenuPick [] PROGMEM = "Menu Pick"; -const char pstrUsageMenuUp [] PROGMEM = "Menu Up"; -const char pstrUsageMenuDown [] PROGMEM = "Menu Down"; -const char pstrUsageMenuLeft [] PROGMEM = "Menu Left"; -const char pstrUsageMenuRight [] PROGMEM = "Menu Right"; -const char pstrUsageMenuEscape [] PROGMEM = "Menu Esc"; -const char pstrUsageMenuValueIncrease [] PROGMEM = "Menu Val Inc"; -const char pstrUsageMenuValueDecrease [] PROGMEM = "Menu Val Dec"; -const char pstrUsageDataOnScreen [] PROGMEM = "Data On Scr"; -const char pstrUsageClosedCaption [] PROGMEM = "Closed Cptn"; -const char pstrUsageClosedCaptionSelect [] PROGMEM = "Closed Cptn Sel"; -const char pstrUsageVCRTV [] PROGMEM = "VCR/TV"; -const char pstrUsageBroadcastMode [] PROGMEM = "Brdcast Mode"; -const char pstrUsageSnapshot [] PROGMEM = "Snapshot"; -const char pstrUsageStill [] PROGMEM = "Still"; -const char pstrUsageSelection [] PROGMEM = "Sel"; -const char pstrUsageAssignSelection [] PROGMEM = "Assign Sel"; -const char pstrUsageModeStep [] PROGMEM = "Mode Step"; -const char pstrUsageRecallLast [] PROGMEM = "Recall Last"; -const char pstrUsageEnterChannel [] PROGMEM = "Entr Channel"; -const char pstrUsageOrderMovie [] PROGMEM = "Ord Movie"; -const char pstrUsageChannel [] PROGMEM = "Channel"; -const char pstrUsageMediaSelection [] PROGMEM = "Med Sel"; -const char pstrUsageMediaSelectComputer [] PROGMEM = "Med Sel Comp"; -const char pstrUsageMediaSelectTV [] PROGMEM = "Med Sel TV"; -const char pstrUsageMediaSelectWWW [] PROGMEM = "Med Sel WWW"; -const char pstrUsageMediaSelectDVD [] PROGMEM = "Med Sel DVD"; -const char pstrUsageMediaSelectTelephone [] PROGMEM = "Med Sel Tel"; -const char pstrUsageMediaSelectProgramGuide [] PROGMEM = "Med Sel PG"; -const char pstrUsageMediaSelectVideoPhone [] PROGMEM = "Med Sel Vid"; -const char pstrUsageMediaSelectGames [] PROGMEM = "Med Sel Games"; -const char pstrUsageMediaSelectMessages [] PROGMEM = "Med Sel Msg"; -const char pstrUsageMediaSelectCD [] PROGMEM = "Med Sel CD"; -const char pstrUsageMediaSelectVCR [] PROGMEM = "Med Sel VCR"; -const char pstrUsageMediaSelectTuner [] PROGMEM = "Med Sel Tuner"; -const char pstrUsageQuit [] PROGMEM = "Quit"; -const char pstrUsageHelp [] PROGMEM = "Help"; -const char pstrUsageMediaSelectTape [] PROGMEM = "Med Sel Tape"; -const char pstrUsageMediaSelectCable [] PROGMEM = "Med Sel Cbl"; -const char pstrUsageMediaSelectSatellite [] PROGMEM = "Med Sel Sat"; -const char pstrUsageMediaSelectSecurity [] PROGMEM = "Med Sel Secur"; -const char pstrUsageMediaSelectHome [] PROGMEM = "Med Sel Home"; -const char pstrUsageMediaSelectCall [] PROGMEM = "Med Sel Call"; -const char pstrUsageChannelIncrement [] PROGMEM = "Ch Inc"; -const char pstrUsageChannelDecrement [] PROGMEM = "Ch Dec"; -const char pstrUsageMediaSelectSAP [] PROGMEM = "Med Sel SAP"; -const char pstrUsageVCRPlus [] PROGMEM = "VCR+"; -const char pstrUsageOnce [] PROGMEM = "Once"; -const char pstrUsageDaily [] PROGMEM = "Daily"; -const char pstrUsageWeekly [] PROGMEM = "Weekly"; -const char pstrUsageMonthly [] PROGMEM = "Monthly"; -//const char pstrUsagePlay [] PROGMEM = "Play"; -//const char pstrUsagePause [] PROGMEM = "Pause"; -//const char pstrUsageRecord [] PROGMEM = "Rec"; -//const char pstrUsageFastForward [] PROGMEM = "FF"; -//const char pstrUsageRewind [] PROGMEM = "Rewind"; -const char pstrUsageScanNextTrack [] PROGMEM = "Next Track"; -const char pstrUsageScanPreviousTrack [] PROGMEM = "Prev Track"; -//const char pstrUsageStop [] PROGMEM = "Stop"; -const char pstrUsageEject [] PROGMEM = "Eject"; -const char pstrUsageRandomPlay [] PROGMEM = "Random"; -const char pstrUsageSelectDisk [] PROGMEM = "Sel Disk"; -const char pstrUsageEnterDisk [] PROGMEM = "Ent Disk"; -//const char pstrUsageRepeat [] PROGMEM = "Repeat"; -const char pstrUsageTracking [] PROGMEM = "Tracking"; -const char pstrUsageTrackNormal [] PROGMEM = "Trk Norm"; -const char pstrUsageSlowTracking [] PROGMEM = "Slow Trk"; -const char pstrUsageFrameForward [] PROGMEM = "Frm Fwd"; -const char pstrUsageFrameBackwards [] PROGMEM = "Frm Back"; -const char pstrUsageMark [] PROGMEM = "Mark"; -const char pstrUsageClearMark [] PROGMEM = "Clr Mark"; -const char pstrUsageRepeatFromMark [] PROGMEM = "Rpt Mark"; -const char pstrUsageReturnToMark [] PROGMEM = "Ret to Mark"; -const char pstrUsageSearchMarkForward [] PROGMEM = "Search Mark Fwd"; -const char pstrUsageSearchMarkBackwards [] PROGMEM = "Search Mark Back"; -const char pstrUsageCounterReset [] PROGMEM = "Counter Reset"; -const char pstrUsageShowCounter [] PROGMEM = "Show Counter"; -const char pstrUsageTrackingIncrement [] PROGMEM = "Track Inc"; -const char pstrUsageTrackingDecrement [] PROGMEM = "Track Dec"; -const char pstrUsageStopEject [] PROGMEM = "Stop/Eject"; -const char pstrUsagePlayPause [] PROGMEM = "Play/Pause"; -const char pstrUsagePlaySkip [] PROGMEM = "Play/Skip"; -const char pstrUsageVolume [] PROGMEM = "Vol"; -const char pstrUsageBalance [] PROGMEM = "Balance"; -//const char pstrUsageMute [] PROGMEM = "Mute"; -const char pstrUsageBass [] PROGMEM = "Bass"; -const char pstrUsageTreble [] PROGMEM = "Treble"; -const char pstrUsageBassBoost [] PROGMEM = "Bass Boost"; -const char pstrUsageSurroundMode [] PROGMEM = "Surround"; -const char pstrUsageLoudness [] PROGMEM = "Loud"; -const char pstrUsageMPX [] PROGMEM = "MPX"; -const char pstrUsageVolumeIncrement [] PROGMEM = "Vol Inc"; -const char pstrUsageVolumeDecrement [] PROGMEM = "Vol Dec"; -const char pstrUsageSpeedSelect [] PROGMEM = "Speed"; -const char pstrUsagePlaybackSpeed [] PROGMEM = "Play Speed"; -const char pstrUsageStandardPlay [] PROGMEM = "Std Play"; -const char pstrUsageLongPlay [] PROGMEM = "Long Play"; -const char pstrUsageExtendedPlay [] PROGMEM = "Ext Play"; -const char pstrUsageSlow [] PROGMEM = "Slow"; -const char pstrUsageFanEnable [] PROGMEM = "Fan Enbl"; -const char pstrUsageFanSpeed [] PROGMEM = "Fan Speed"; -const char pstrUsageLightEnable [] PROGMEM = "Light Enbl"; -const char pstrUsageLightIlluminationLevel [] PROGMEM = "Light Illum Lev"; -const char pstrUsageClimateControlEnable [] PROGMEM = "Climate Enbl"; -const char pstrUsageRoomTemperature [] PROGMEM = "Room Temp"; -const char pstrUsageSecurityEnable [] PROGMEM = "Secur Enbl"; -const char pstrUsageFireAlarm [] PROGMEM = "Fire Alm"; -const char pstrUsagePoliceAlarm [] PROGMEM = "Police Alm"; -const char pstrUsageProximity [] PROGMEM = "Prox"; -const char pstrUsageMotion [] PROGMEM = "Motion"; -const char pstrUsageDuresAlarm [] PROGMEM = "Dures Alm"; -const char pstrUsageHoldupAlarm [] PROGMEM = "Holdup Alm"; -const char pstrUsageMedicalAlarm [] PROGMEM = "Med Alm"; -const char pstrUsageBalanceRight [] PROGMEM = "Balance Right"; -const char pstrUsageBalanceLeft [] PROGMEM = "Balance Left"; -const char pstrUsageBassIncrement [] PROGMEM = "Bass Inc"; -const char pstrUsageBassDecrement [] PROGMEM = "Bass Dec"; -const char pstrUsageTrebleIncrement [] PROGMEM = "Treble Inc"; -const char pstrUsageTrebleDecrement [] PROGMEM = "Treble Dec"; -const char pstrUsageSpeakerSystem [] PROGMEM = "Spk Sys"; -const char pstrUsageChannelLeft [] PROGMEM = "Ch Left"; -const char pstrUsageChannelRight [] PROGMEM = "Ch Right"; -const char pstrUsageChannelCenter [] PROGMEM = "Ch Center"; -const char pstrUsageChannelFront [] PROGMEM = "Ch Front"; -const char pstrUsageChannelCenterFront [] PROGMEM = "Ch Cntr Front"; -const char pstrUsageChannelSide [] PROGMEM = "Ch Side"; -const char pstrUsageChannelSurround [] PROGMEM = "Ch Surround"; -const char pstrUsageChannelLowFreqEnhancement [] PROGMEM = "Ch Low Freq Enh"; -const char pstrUsageChannelTop [] PROGMEM = "Ch Top"; -const char pstrUsageChannelUnknown [] PROGMEM = "Ch Unk"; -const char pstrUsageSubChannel [] PROGMEM = "Sub-ch"; -const char pstrUsageSubChannelIncrement [] PROGMEM = "Sub-ch Inc"; -const char pstrUsageSubChannelDecrement [] PROGMEM = "Sub-ch Dec"; -const char pstrUsageAlternateAudioIncrement [] PROGMEM = "Alt Aud Inc"; -const char pstrUsageAlternateAudioDecrement [] PROGMEM = "Alt Aud Dec"; -const char pstrUsageApplicationLaunchButtons [] PROGMEM = "App Launch Btns"; -const char pstrUsageALLaunchButtonConfigTool [] PROGMEM = "AL Launch Conf Tl"; -const char pstrUsageALProgrammableButton [] PROGMEM = "AL Pgm Btn"; -const char pstrUsageALConsumerControlConfig [] PROGMEM = "AL Cons Ctrl Cfg"; -const char pstrUsageALWordProcessor [] PROGMEM = "AL Word Proc"; -const char pstrUsageALTextEditor [] PROGMEM = "AL Txt Edtr"; -const char pstrUsageALSpreadsheet [] PROGMEM = "AL Sprdsheet"; -const char pstrUsageALGraphicsEditor [] PROGMEM = "AL Graph Edtr"; -const char pstrUsageALPresentationApp [] PROGMEM = "AL Present App"; -const char pstrUsageALDatabaseApp [] PROGMEM = "AL DB App"; -const char pstrUsageALEmailReader [] PROGMEM = "AL E-mail Rdr"; -const char pstrUsageALNewsreader [] PROGMEM = "AL Newsrdr"; -const char pstrUsageALVoicemail [] PROGMEM = "AL Voicemail"; -const char pstrUsageALContactsAddressBook [] PROGMEM = "AL Addr Book"; -const char pstrUsageALCalendarSchedule [] PROGMEM = "AL Clndr/Schdlr"; -const char pstrUsageALTaskProjectManager [] PROGMEM = "AL Task/Prj Mgr"; -const char pstrUsageALLogJournalTimecard [] PROGMEM = "AL Log/Jrnl/Tmcrd"; -const char pstrUsageALCheckbookFinance [] PROGMEM = "AL Chckbook/Fin"; -const char pstrUsageALCalculator [] PROGMEM = "AL Calc"; -const char pstrUsageALAVCapturePlayback [] PROGMEM = "AL A/V Capt/Play"; -const char pstrUsageALLocalMachineBrowser [] PROGMEM = "AL Loc Mach Brow"; -const char pstrUsageALLANWANBrow [] PROGMEM = "AL LAN/WAN Brow"; -const char pstrUsageALInternetBrowser [] PROGMEM = "AL I-net Brow"; -const char pstrUsageALRemoteNetISPConnect [] PROGMEM = "AL Rem Net Con"; -const char pstrUsageALNetworkConference [] PROGMEM = "AL Net Conf"; -const char pstrUsageALNetworkChat [] PROGMEM = "AL Net Chat"; -const char pstrUsageALTelephonyDialer [] PROGMEM = "AL Tel/Dial"; -const char pstrUsageALLogon [] PROGMEM = "AL Logon"; -const char pstrUsageALLogoff [] PROGMEM = "AL Logoff"; -const char pstrUsageALLogonLogoff [] PROGMEM = "AL Logon/Logoff"; -const char pstrUsageALTermLockScrSav [] PROGMEM = "AL Term Lock/Scr Sav"; -const char pstrUsageALControlPannel [] PROGMEM = "AL Ctrl Pan"; -const char pstrUsageALCommandLineProcessorRun [] PROGMEM = "AL Cmd/Run"; -const char pstrUsageALProcessTaskManager [] PROGMEM = "AL Task Mgr"; -const char pstrUsageALSelectTaskApplication [] PROGMEM = "AL Sel App"; -const char pstrUsageALNextTaskApplication [] PROGMEM = "AL Next App"; -const char pstrUsageALPreviousTaskApplication [] PROGMEM = "AL Prev App"; -const char pstrUsageALPreemptiveHaltTaskApp [] PROGMEM = "AL Prmpt Halt App"; -const char pstrUsageALIntegratedHelpCenter [] PROGMEM = "AL Hlp Cntr"; -const char pstrUsageALDocuments [] PROGMEM = "AL Docs"; -const char pstrUsageALThesaurus [] PROGMEM = "AL Thsrs"; -const char pstrUsageALDictionary [] PROGMEM = "AL Dict"; -const char pstrUsageALDesktop [] PROGMEM = "AL Desktop"; -const char pstrUsageALSpellCheck [] PROGMEM = "AL Spell Chk"; -const char pstrUsageALGrammarCheck [] PROGMEM = "AL Gram Chk"; -const char pstrUsageALWirelessStatus [] PROGMEM = "AL Wireless Sts"; -const char pstrUsageALKeyboardLayout [] PROGMEM = "AL Kbd Layout"; -const char pstrUsageALVirusProtection [] PROGMEM = "AL Vir Protect"; -const char pstrUsageALEncryption [] PROGMEM = "AL Encrypt"; -const char pstrUsageALScreenSaver [] PROGMEM = "AL Scr Sav"; -const char pstrUsageALAlarms [] PROGMEM = "AL Alarms"; -const char pstrUsageALClock [] PROGMEM = "AL Clock"; -const char pstrUsageALFileBrowser [] PROGMEM = "AL File Brow"; -const char pstrUsageALPowerStatus [] PROGMEM = "AL Pwr Sts"; -const char pstrUsageALImageBrowser [] PROGMEM = "AL Img Brow"; -const char pstrUsageALAudioBrowser [] PROGMEM = "AL Aud Brow"; -const char pstrUsageALMovieBrowser [] PROGMEM = "AL Mov Brow"; -const char pstrUsageALDigitalRightsManager [] PROGMEM = "AL Dig Rights Mgr"; -const char pstrUsageALDigitalWallet [] PROGMEM = "AL Dig Wallet"; -const char pstrUsageALInstantMessaging [] PROGMEM = "AL Inst Msg"; -const char pstrUsageALOEMFeaturesBrowser [] PROGMEM = "AL OEM Tips Brow"; -const char pstrUsageALOEMHelp [] PROGMEM = "AL OEM Hlp"; -const char pstrUsageALOnlineCommunity [] PROGMEM = "AL Online Com"; -const char pstrUsageALEntertainmentContentBrow [] PROGMEM = "AL Ent Cont Brow"; -const char pstrUsageALOnlineShoppingBrowser [] PROGMEM = "AL Online Shop Brow"; -const char pstrUsageALSmartCardInfoHelp [] PROGMEM = "AL SmartCard Inf"; -const char pstrUsageALMarketMonitorFinBrowser [] PROGMEM = "AL Market Brow"; -const char pstrUsageALCustomCorpNewsBrowser [] PROGMEM = "AL Cust Corp News Brow"; -const char pstrUsageALOnlineActivityBrowser [] PROGMEM = "AL Online Act Brow"; -const char pstrUsageALResearchSearchBrowser [] PROGMEM = "AL Search Brow"; -const char pstrUsageALAudioPlayer [] PROGMEM = "AL Aud Player"; -const char pstrUsageGenericGUIAppControls [] PROGMEM = "Gen GUI App Ctrl"; -const char pstrUsageACNew [] PROGMEM = "AC New"; -const char pstrUsageACOpen [] PROGMEM = "AC Open"; -const char pstrUsageACClose [] PROGMEM = "AC Close"; -const char pstrUsageACExit [] PROGMEM = "AC Exit"; -const char pstrUsageACMaximize [] PROGMEM = "AC Max"; -const char pstrUsageACMinimize [] PROGMEM = "AC Min"; -const char pstrUsageACSave [] PROGMEM = "AC Save"; -const char pstrUsageACPrint [] PROGMEM = "AC Print"; -const char pstrUsageACProperties [] PROGMEM = "AC Prop"; -const char pstrUsageACUndo [] PROGMEM = "AC Undo"; -const char pstrUsageACCopy [] PROGMEM = "AC Copy"; -const char pstrUsageACCut [] PROGMEM = "AC Cut"; -const char pstrUsageACPaste [] PROGMEM = "AC Paste"; -const char pstrUsageACSelectAll [] PROGMEM = "AC Sel All"; -const char pstrUsageACFind [] PROGMEM = "AC Find"; -const char pstrUsageACFindAndReplace [] PROGMEM = "AC Find/Replace"; -const char pstrUsageACSearch [] PROGMEM = "AC Search"; -const char pstrUsageACGoto [] PROGMEM = "AC Goto"; -const char pstrUsageACHome [] PROGMEM = "AC Home"; -const char pstrUsageACBack [] PROGMEM = "AC Back"; -const char pstrUsageACForward [] PROGMEM = "AC Fwd"; -const char pstrUsageACStop [] PROGMEM = "AC Stop"; -const char pstrUsageACRefresh [] PROGMEM = "AC Refresh"; -const char pstrUsageACPreviousLink [] PROGMEM = "AC Prev Link"; -const char pstrUsageACNextLink [] PROGMEM = "AC Next Link"; -const char pstrUsageACBookmarks [] PROGMEM = "AC Bkmarks"; -const char pstrUsageACHistory [] PROGMEM = "AC Hist"; -const char pstrUsageACSubscriptions [] PROGMEM = "AC Subscr"; -const char pstrUsageACZoomIn [] PROGMEM = "AC Zoom In"; -const char pstrUsageACZoomOut [] PROGMEM = "AC Zoom Out"; -const char pstrUsageACZoom [] PROGMEM = "AC Zoom"; -const char pstrUsageACFullScreenView [] PROGMEM = "AC Full Scr"; -const char pstrUsageACNormalView [] PROGMEM = "AC Norm View"; -const char pstrUsageACViewToggle [] PROGMEM = "AC View Tgl"; -const char pstrUsageACScrollUp [] PROGMEM = "AC Scroll Up"; -const char pstrUsageACScrollDown [] PROGMEM = "AC Scroll Down"; -const char pstrUsageACScroll [] PROGMEM = "AC Scroll"; -const char pstrUsageACPanLeft [] PROGMEM = "AC Pan Left"; -const char pstrUsageACPanRight [] PROGMEM = "AC Pan Right"; -const char pstrUsageACPan [] PROGMEM = "AC Pan"; -const char pstrUsageACNewWindow [] PROGMEM = "AC New Wnd"; -const char pstrUsageACTileHoriz [] PROGMEM = "AC Tile Horiz"; -const char pstrUsageACTileVert [] PROGMEM = "AC Tile Vert"; -const char pstrUsageACFormat [] PROGMEM = "AC Frmt"; -const char pstrUsageACEdit [] PROGMEM = "AC Edit"; -const char pstrUsageACBold [] PROGMEM = "AC Bold"; -const char pstrUsageACItalics [] PROGMEM = "AC Ital"; -const char pstrUsageACUnderline [] PROGMEM = "AC Under"; -const char pstrUsageACStrikethrough [] PROGMEM = "AC Strike"; -const char pstrUsageACSubscript [] PROGMEM = "AC Sub"; -const char pstrUsageACSuperscript [] PROGMEM = "AC Super"; -const char pstrUsageACAllCaps [] PROGMEM = "AC All Caps"; -const char pstrUsageACRotate [] PROGMEM = "AC Rotate"; -const char pstrUsageACResize [] PROGMEM = "AC Resize"; -const char pstrUsageACFlipHorizontal [] PROGMEM = "AC Flp H"; -const char pstrUsageACFlipVertical [] PROGMEM = "AC Flp V"; -const char pstrUsageACMirrorHorizontal [] PROGMEM = "AC Mir H"; -const char pstrUsageACMirrorVertical [] PROGMEM = "AC Mir V"; -const char pstrUsageACFontSelect [] PROGMEM = "AC Fnt Sel"; -const char pstrUsageACFontColor [] PROGMEM = "AC Fnt Clr"; -const char pstrUsageACFontSize [] PROGMEM = "AC Fnt Size"; -const char pstrUsageACJustifyLeft [] PROGMEM = "AC Just Left"; -const char pstrUsageACJustifyCenterH [] PROGMEM = "AC Just Cent H"; -const char pstrUsageACJustifyRight [] PROGMEM = "AC Just Right"; -const char pstrUsageACJustifyBlockH [] PROGMEM = "AC Just Block H"; -const char pstrUsageACJustifyTop [] PROGMEM = "AC Just Top"; -const char pstrUsageACJustifyCenterV [] PROGMEM = "AC Just Cent V"; -const char pstrUsageACJustifyBottom [] PROGMEM = "AC Just Bot"; -const char pstrUsageACJustifyBlockV [] PROGMEM = "AC Just Block V"; -const char pstrUsageACIndentDecrease [] PROGMEM = "AC Indent Dec"; -const char pstrUsageACIndentIncrease [] PROGMEM = "AC Indent Inc"; -const char pstrUsageACNumberedList [] PROGMEM = "AC Num List"; -const char pstrUsageACRestartNumbering [] PROGMEM = "AC Res Num"; -const char pstrUsageACBulletedList [] PROGMEM = "AC Blt List"; -const char pstrUsageACPromote [] PROGMEM = "AC Promote"; -const char pstrUsageACDemote [] PROGMEM = "AC Demote"; -const char pstrUsageACYes [] PROGMEM = "AC Yes"; -const char pstrUsageACNo [] PROGMEM = "AC No"; -const char pstrUsageACCancel [] PROGMEM = "AC Cancel"; -const char pstrUsageACCatalog [] PROGMEM = "AC Ctlg"; -const char pstrUsageACBuyChkout [] PROGMEM = "AC Buy"; -const char pstrUsageACAddToCart [] PROGMEM = "AC Add2Cart"; -const char pstrUsageACExpand [] PROGMEM = "AC Xpnd"; -const char pstrUsageACExpandAll [] PROGMEM = "AC Xpand All"; -const char pstrUsageACCollapse [] PROGMEM = "AC Collapse"; -const char pstrUsageACCollapseAll [] PROGMEM = "AC Collapse All"; -const char pstrUsageACPrintPreview [] PROGMEM = "AC Prn Prevw"; -const char pstrUsageACPasteSpecial [] PROGMEM = "AC Paste Spec"; -const char pstrUsageACInsertMode [] PROGMEM = "AC Ins Mode"; -const char pstrUsageACDelete [] PROGMEM = "AC Del"; -const char pstrUsageACLock [] PROGMEM = "AC Lock"; -const char pstrUsageACUnlock [] PROGMEM = "AC Unlock"; -const char pstrUsageACProtect [] PROGMEM = "AC Prot"; -const char pstrUsageACUnprotect [] PROGMEM = "AC Unprot"; -const char pstrUsageACAttachComment [] PROGMEM = "AC Attach Cmnt"; -const char pstrUsageACDeleteComment [] PROGMEM = "AC Del Cmnt"; -const char pstrUsageACViewComment [] PROGMEM = "AC View Cmnt"; -const char pstrUsageACSelectWord [] PROGMEM = "AC Sel Word"; -const char pstrUsageACSelectSentence [] PROGMEM = "AC Sel Sntc"; -const char pstrUsageACSelectParagraph [] PROGMEM = "AC Sel Para"; -const char pstrUsageACSelectColumn [] PROGMEM = "AC Sel Col"; -const char pstrUsageACSelectRow [] PROGMEM = "AC Sel Row"; -const char pstrUsageACSelectTable [] PROGMEM = "AC Sel Tbl"; -const char pstrUsageACSelectObject [] PROGMEM = "AC Sel Obj"; -const char pstrUsageACRedoRepeat [] PROGMEM = "AC Redo"; -const char pstrUsageACSort [] PROGMEM = "AC Sort"; -const char pstrUsageACSortAscending [] PROGMEM = "AC Sort Asc"; -const char pstrUsageACSortDescending [] PROGMEM = "AC Sort Desc"; -const char pstrUsageACFilter [] PROGMEM = "AC Filt"; -const char pstrUsageACSetClock [] PROGMEM = "AC Set Clk"; -const char pstrUsageACViewClock [] PROGMEM = "AC View Clk"; -const char pstrUsageACSelectTimeZone [] PROGMEM = "AC Sel Time Z"; -const char pstrUsageACEditTimeZone [] PROGMEM = "AC Edt Time Z"; -const char pstrUsageACSetAlarm [] PROGMEM = "AC Set Alm"; -const char pstrUsageACClearAlarm [] PROGMEM = "AC Clr Alm"; -const char pstrUsageACSnoozeAlarm [] PROGMEM = "AC Snz Alm"; -const char pstrUsageACResetAlarm [] PROGMEM = "AC Rst Alm"; -const char pstrUsageACSyncronize [] PROGMEM = "AC Sync"; -const char pstrUsageACSendReceive [] PROGMEM = "AC Snd/Rcv"; -const char pstrUsageACSendTo [] PROGMEM = "AC Snd To"; -const char pstrUsageACReply [] PROGMEM = "AC Reply"; -const char pstrUsageACReplyAll [] PROGMEM = "AC Reply All"; -const char pstrUsageACForwardMessage [] PROGMEM = "AC Fwd Msg"; -const char pstrUsageACSend [] PROGMEM = "AC Snd"; -const char pstrUsageACAttachFile [] PROGMEM = "AC Att File"; -const char pstrUsageACUpload [] PROGMEM = "AC Upld"; -const char pstrUsageACDownload [] PROGMEM = "AC Dnld"; -const char pstrUsageACSetBorders [] PROGMEM = "AC Set Brd"; -const char pstrUsageACInsertRow [] PROGMEM = "AC Ins Row"; -const char pstrUsageACInsertColumn [] PROGMEM = "AC Ins Col"; -const char pstrUsageACInsertFile [] PROGMEM = "AC Ins File"; -const char pstrUsageACInsertPicture [] PROGMEM = "AC Ins Pic"; -const char pstrUsageACInsertObject [] PROGMEM = "AC Ins Obj"; -const char pstrUsageACInsertSymbol [] PROGMEM = "AC Ins Sym"; -const char pstrUsageACSaveAndClose [] PROGMEM = "AC Sav&Cls"; -const char pstrUsageACRename [] PROGMEM = "AC Rename"; -const char pstrUsageACMerge [] PROGMEM = "AC Merge"; -const char pstrUsageACSplit [] PROGMEM = "AC Split"; -const char pstrUsageACDistributeHorizontaly [] PROGMEM = "AC Dist Hor"; -const char pstrUsageACDistributeVerticaly [] PROGMEM = "AC Dist Ver"; - -// Digitaizers -const char pstrUsageDigitizer [] PROGMEM = "Digitizer"; -const char pstrUsagePen [] PROGMEM = "Pen"; -const char pstrUsageLightPen [] PROGMEM = "Light Pen"; -const char pstrUsageTouchScreen [] PROGMEM = "Touch Scr"; -const char pstrUsageTouchPad [] PROGMEM = "Touch Pad"; -const char pstrUsageWhiteBoard [] PROGMEM = "White Brd"; -const char pstrUsageCoordinateMeasuringMachine [] PROGMEM = "Coord Meas Mach"; -const char pstrUsage3DDigitizer [] PROGMEM = "3D Dgtz"; -const char pstrUsageStereoPlotter [] PROGMEM = "Stereo Plot"; -const char pstrUsageArticulatedArm [] PROGMEM = "Art Arm"; -const char pstrUsageArmature [] PROGMEM = "Armature"; -const char pstrUsageMultiplePointDigitizer [] PROGMEM = "Multi Point Dgtz"; -const char pstrUsageFreeSpaceWand [] PROGMEM = "Free Space Wand"; -const char pstrUsageStylus [] PROGMEM = "Stylus"; -const char pstrUsagePuck [] PROGMEM = "Puck"; -const char pstrUsageFinger [] PROGMEM = "Finger"; -const char pstrUsageTipPressure [] PROGMEM = "Tip Press"; -const char pstrUsageBarrelPressure [] PROGMEM = "Brl Press"; -const char pstrUsageInRange [] PROGMEM = "In Range"; -const char pstrUsageTouch [] PROGMEM = "Touch"; -const char pstrUsageUntouch [] PROGMEM = "Untouch"; -const char pstrUsageTap [] PROGMEM = "Tap"; -const char pstrUsageQuality [] PROGMEM = "Qlty"; -const char pstrUsageDataValid [] PROGMEM = "Data Valid"; -const char pstrUsageTransducerIndex [] PROGMEM = "Transducer Ind"; -const char pstrUsageTabletFunctionKeys [] PROGMEM = "Tabl Func Keys"; -const char pstrUsageProgramChangeKeys [] PROGMEM = "Pgm Chng Keys"; -//const char pstrUsageBatteryStrength [] PROGMEM = "Bat Strength"; -const char pstrUsageInvert [] PROGMEM = "Invert"; -const char pstrUsageXTilt [] PROGMEM = "X Tilt"; -const char pstrUsageYTilt [] PROGMEM = "Y Tilt"; -const char pstrUsageAzimuth [] PROGMEM = "Azimuth"; -const char pstrUsageAltitude [] PROGMEM = "Altitude"; -const char pstrUsageTwist [] PROGMEM = "Twist"; -const char pstrUsageTipSwitch [] PROGMEM = "Tip Sw"; -const char pstrUsageSecondaryTipSwitch [] PROGMEM = "Scnd Tip Sw"; -const char pstrUsageBarrelSwitch [] PROGMEM = "Brl Sw"; -const char pstrUsageEraser [] PROGMEM = "Eraser"; -const char pstrUsageTabletPick [] PROGMEM = "Tbl Pick"; - -// Alphanumeric Display Page -const char pstrUsageAlphanumericDisplay [] PROGMEM = "Alphanum Disp"; -const char pstrUsageBitmappedDisplay [] PROGMEM = "Bmp Disp"; -const char pstrUsageDisplayAttributesReport [] PROGMEM = "Disp Attr Rpt"; -const char pstrUsageASCIICharacterSet [] PROGMEM = "ASCII chset"; -const char pstrUsageDataReadBack [] PROGMEM = "Data Rd Back"; -const char pstrUsageFontReadBack [] PROGMEM = "Fnt Rd Back"; -const char pstrUsageDisplayControlReport [] PROGMEM = "Disp Ctrl Rpt"; -const char pstrUsageClearDisplay [] PROGMEM = "Clr Disp"; -//const char pstrUsageDisplayEnable [] PROGMEM = "Disp Enbl"; -const char pstrUsageScreenSaverDelay [] PROGMEM = "Scr Sav Delay"; -const char pstrUsageScreenSaverEnable [] PROGMEM = "Scr Sav Enbl"; -const char pstrUsageVerticalScroll [] PROGMEM = "V Scroll"; -const char pstrUsageHorizontalScroll [] PROGMEM = "H Scroll"; -const char pstrUsageCharacterReport [] PROGMEM = "Char Rpt"; -const char pstrUsageDisplayData [] PROGMEM = "Disp Data"; -const char pstrUsageDisplayStatus [] PROGMEM = "Disp Stat"; -const char pstrUsageStatusNotReady [] PROGMEM = "Stat !Ready"; -const char pstrUsageStatusReady [] PROGMEM = "Stat Ready"; -const char pstrUsageErrorNotALoadableCharacter [] PROGMEM = "Err Not Ld Char"; -const char pstrUsageErrorFotDataCanNotBeRead [] PROGMEM = "Fnt Data Rd Err"; -const char pstrUsageCursorPositionReport [] PROGMEM = "Cur Pos Rpt"; -const char pstrUsageRow [] PROGMEM = "Row"; -const char pstrUsageColumn [] PROGMEM = "Col"; -const char pstrUsageRows [] PROGMEM = "Rows"; -const char pstrUsageColumns [] PROGMEM = "Cols"; -const char pstrUsageCursorPixelPosition [] PROGMEM = "Cur Pix Pos"; -const char pstrUsageCursorMode [] PROGMEM = "Cur Mode"; -const char pstrUsageCursorEnable [] PROGMEM = "Cur Enbl"; -const char pstrUsageCursorBlink [] PROGMEM = "Cur Blnk"; -const char pstrUsageFontReport [] PROGMEM = "Fnt Rpt"; -const char pstrUsageFontData [] PROGMEM = "Fnt Data"; -const char pstrUsageCharacterWidth [] PROGMEM = "Char Wdth"; -const char pstrUsageCharacterHeight [] PROGMEM = "Char Hght"; -const char pstrUsageCharacterSpacingHorizontal [] PROGMEM = "Char Space H"; -const char pstrUsageCharacterSpacingVertical [] PROGMEM = "Char Space V"; -const char pstrUsageUnicodeCharset [] PROGMEM = "Unicode Char"; -const char pstrUsageFont7Segment [] PROGMEM = "Fnt 7-seg"; -const char pstrUsage7SegmentDirectMap [] PROGMEM = "7-seg map"; -const char pstrUsageFont14Segment [] PROGMEM = "Fnt 14-seg"; -const char pstrUsage14SegmentDirectMap [] PROGMEM = "14-seg map"; -const char pstrUsageDisplayBrightness [] PROGMEM = "Disp Bright"; -const char pstrUsageDisplayContrast [] PROGMEM = "Disp Cntrst"; -const char pstrUsageCharacterAttribute [] PROGMEM = "Char Attr"; -const char pstrUsageAttributeReadback [] PROGMEM = "Attr Readbk"; -const char pstrUsageAttributeData [] PROGMEM = "Attr Data"; -const char pstrUsageCharAttributeEnhance [] PROGMEM = "Char Attr Enh"; -const char pstrUsageCharAttributeUnderline [] PROGMEM = "Char Attr Undl"; -const char pstrUsageCharAttributeBlink [] PROGMEM = "Char Attr Blnk"; -const char pstrUsageBitmapSizeX [] PROGMEM = "Bmp Size X"; -const char pstrUsageBitmapSizeY [] PROGMEM = "Bmp Size Y"; -const char pstrUsageBitDepthFormat [] PROGMEM = "Bit Dpth Fmt"; -const char pstrUsageDisplayOrientation [] PROGMEM = "Disp Ornt"; -const char pstrUsagePaletteReport [] PROGMEM = "Pal Rpt"; -const char pstrUsagePaletteDataSize [] PROGMEM = "Pal Data Size"; -const char pstrUsagePaletteDataOffset [] PROGMEM = "Pal Data Off"; -const char pstrUsagePaletteData [] PROGMEM = "Pal Data"; -const char pstrUsageBlitReport [] PROGMEM = "Blit Rpt"; -const char pstrUsageBlitRectangleX1 [] PROGMEM = "Blit Rect X1"; -const char pstrUsageBlitRectangleY1 [] PROGMEM = "Blit Rect Y1"; -const char pstrUsageBlitRectangleX2 [] PROGMEM = "Blit Rect X2"; -const char pstrUsageBlitRectangleY2 [] PROGMEM = "Blit Rect Y2"; -const char pstrUsageBlitData [] PROGMEM = "Blit Data"; -const char pstrUsageSoftButton [] PROGMEM = "Soft Btn"; -const char pstrUsageSoftButtonID [] PROGMEM = "Soft Btn ID"; -const char pstrUsageSoftButtonSide [] PROGMEM = "Soft Btn Side"; -const char pstrUsageSoftButtonOffset1 [] PROGMEM = "Soft Btn Off1"; -const char pstrUsageSoftButtonOffset2 [] PROGMEM = "Soft Btn Off2"; -const char pstrUsageSoftButtonReport [] PROGMEM = "Soft Btn Rpt"; - -// Medical Instrument Page -const char pstrUsageMedicalUltrasound [] PROGMEM = "Med Ultrasnd"; -const char pstrUsageVCRAcquisition [] PROGMEM = "VCR/Acq"; -const char pstrUsageFreezeThaw [] PROGMEM = "Freeze"; -const char pstrUsageClipStore [] PROGMEM = "Clip Store"; -const char pstrUsageUpdate [] PROGMEM = "Update"; -const char pstrUsageNext [] PROGMEM = "Next"; -const char pstrUsageSave [] PROGMEM = "Save"; -const char pstrUsagePrint [] PROGMEM = "Print"; -const char pstrUsageMicrophoneEnable [] PROGMEM = "Mic Enbl"; -const char pstrUsageCine [] PROGMEM = "Cine"; -const char pstrUsageTransmitPower [] PROGMEM = "Trans Pwr"; -//const char pstrUsageVolume [] PROGMEM = "Vol"; -const char pstrUsageFocus [] PROGMEM = "Focus"; -const char pstrUsageDepth [] PROGMEM = "Depth"; -const char pstrUsageSoftStepPrimary [] PROGMEM = "Soft Stp-Pri"; -const char pstrUsageSoftStepSecondary [] PROGMEM = "Soft Stp-Sec"; -const char pstrUsageDepthGainCompensation [] PROGMEM = "Dpth Gain Comp"; -const char pstrUsageZoomSelect [] PROGMEM = "Zoom Sel"; -const char pstrUsageZoomAdjust [] PROGMEM = "Zoom Adj"; -const char pstrUsageSpectralDopplerModeSelect [] PROGMEM = "Spec Dop Mode Sel"; -const char pstrUsageSpectralDopplerModeAdjust [] PROGMEM = "Spec Dop Mode Adj"; -const char pstrUsageColorDopplerModeSelect [] PROGMEM = "Color Dop Mode Sel"; -const char pstrUsageColorDopplerModeAdjust [] PROGMEM = "Color Dop Mode Adj"; -const char pstrUsageMotionModeSelect [] PROGMEM = "Motion Mode Sel"; -const char pstrUsageMotionModeAdjust [] PROGMEM = "Motion Mode Adj"; -const char pstrUsage2DModeSelect [] PROGMEM = "2D Mode Sel"; -const char pstrUsage2DModeAdjust [] PROGMEM = "2D Mode Adj"; -const char pstrUsageSoftControlSelect [] PROGMEM = "Soft Ctrl Sel"; -const char pstrUsageSoftControlAdjust [] PROGMEM = "Soft Ctrl Adj"; - - -#endif // __HID_H__ \ No newline at end of file diff --git a/masstorage.cpp b/masstorage.cpp deleted file mode 100644 index 21c25202..00000000 --- a/masstorage.cpp +++ /dev/null @@ -1,328 +0,0 @@ -#include "masstorage.h" - -const uint8_t BulkOnly::epDataInIndex = 1; -const uint8_t BulkOnly::epDataOutIndex = 2; -const uint8_t BulkOnly::epInterruptInIndex = 3; - -BulkOnly::BulkOnly(USB *p /*, CDCAsyncOper *pasync*/) : - pUsb(p), - //pAsync(pasync), - bAddress(0), - qNextPollTime(0), - bPollEnable(false), - bIface(0), - bNumEP(1) -{ - for(uint8_t i=0; iRegisterDeviceClass(this); -} - -uint8_t BulkOnly::Init(uint8_t parent, uint8_t port, bool lowspeed) -{ - const uint8_t constBufSize = sizeof(USB_DEVICE_DESCRIPTOR); - - uint8_t buf[constBufSize]; - uint8_t rcode; - UsbDevice *p = NULL; - EpInfo *oldep_ptr = NULL; - uint8_t num_of_conf; // number of configurations - - AddressPool &addrPool = pUsb->GetAddressPool(); - - USBTRACE("MS Init\r\n"); - - if (bAddress) - return USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE; - - // Get pointer to pseudo device with address 0 assigned - p = addrPool.GetUsbDevicePtr(0); - - if (!p) - return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - if (!p->epinfo) - { - USBTRACE("epinfo\r\n"); - return USB_ERROR_EPINFO_IS_NULL; - } - - // Save old pointer to EP_RECORD of address 0 - oldep_ptr = p->epinfo; - - // Temporary assign new pointer to epInfo to p->epinfo in order to avoid toggle inconsistence - p->epinfo = epInfo; - - p->lowspeed = lowspeed; - - // Get device descriptor - rcode = pUsb->getDevDescr( 0, 0, constBufSize, (uint8_t*)buf ); - - // Restore p->epinfo - p->epinfo = oldep_ptr; - - if( rcode ) - goto FailGetDevDescr; - - // Allocate new address according to device class - bAddress = addrPool.AllocAddress(parent, false, port); - - if (!bAddress) - return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL; - - // Extract Max Packet Size from the device descriptor - epInfo[0].maxPktSize = (uint8_t)((USB_DEVICE_DESCRIPTOR*)buf)->bMaxPacketSize0; - - // Assign new address to the device - rcode = pUsb->setAddr( 0, 0, bAddress ); - - if (rcode) - { - p->lowspeed = false; - addrPool.FreeAddress(bAddress); - bAddress = 0; - USBTRACE2("setAddr:",rcode); - return rcode; - } - - USBTRACE2("Addr:", bAddress); - - p->lowspeed = false; - - p = addrPool.GetUsbDevicePtr(bAddress); - - if (!p) - return USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL; - - p->lowspeed = lowspeed; - - num_of_conf = ((USB_DEVICE_DESCRIPTOR*)buf)->bNumConfigurations; - - // Assign epInfo to epinfo pointer - rcode = pUsb->setEpInfoEntry(bAddress, 1, epInfo); - - if (rcode) - goto FailSetDevTblEntry; - - USBTRACE2("NC:", num_of_conf); - - for (uint8_t i=0; i HexDump; - ConfigDescParser< USB_CLASS_MASS_STORAGE, - MASS_SUBCLASS_SCSI, - MASS_PROTO_BBB, - CP_MASK_COMPARE_CLASS | - CP_MASK_COMPARE_SUBCLASS | - CP_MASK_COMPARE_PROTOCOL> BulkOnlyParser(this); - - rcode = pUsb->getConfDescr(bAddress, 0, i, &HexDump); - rcode = pUsb->getConfDescr(bAddress, 0, i, &BulkOnlyParser); - - - if (bNumEP > 1) - break; - } // for - - if (bNumEP < 4) - return USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED; - - // Assign epInfo to epinfo pointer - rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo); - - USBTRACE2("Conf:", bConfNum); - - // Set Configuration Value - rcode = pUsb->setConf(bAddress, 0, bConfNum); - - if (rcode) - goto FailSetConf; - - //rcode = pAsync->OnInit(this); - - if (rcode) - goto FailOnInit; - - USBTRACE("MS configured\r\n"); - - //bPollEnable = true; - - //USBTRACE("Poll enabled\r\n"); - return 0; - -FailGetDevDescr: - USBTRACE("getDevDescr:"); - goto Fail; - -FailSetDevTblEntry: - USBTRACE("setDevTblEn:"); - goto Fail; - -FailGetConfDescr: - USBTRACE("getConf:"); - goto Fail; - -FailSetConf: - USBTRACE("setConf:"); - goto Fail; - -FailOnInit: - USBTRACE("OnInit:"); - goto Fail; - -Fail: - Serial.println(rcode, HEX); - Release(); - return rcode; -} - - -void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *pep) -{ - ErrorMessage(PSTR("Conf.Val"), conf); - ErrorMessage(PSTR("Iface Num"),iface); - ErrorMessage(PSTR("Alt.Set"), alt); - - bConfNum = conf; - - uint8_t index; - - if ((pep->bmAttributes & 0x03) == 3 && (pep->bEndpointAddress & 0x80) == 0x80) - index = epInterruptInIndex; - else - if ((pep->bmAttributes & 0x02) == 2) - index = ((pep->bEndpointAddress & 0x80) == 0x80) ? epDataInIndex : epDataOutIndex; - else - return; - - // Fill in the endpoint info structure - epInfo[index].epAddr = (pep->bEndpointAddress & 0x0F); - epInfo[index].maxPktSize = (uint8_t)pep->wMaxPacketSize; - epInfo[index].epAttribs = 0; - - bNumEP ++; - - PrintEndpointDescriptor(pep); -} - -uint8_t BulkOnly::Release() -{ - pUsb->GetAddressPool().FreeAddress(bAddress); - - bIface = 0; - bNumEP = 1; - - bAddress = 0; - qNextPollTime = 0; - bPollEnable = false; - return 0; -} - -uint8_t BulkOnly::Poll() -{ - uint8_t rcode = 0; - - if (!bPollEnable) - return 0; - - uint32_t time_now = millis(); - - //if (qNextPollTime <= time_now) - //{ - // qNextPollTime = time_now + 100; - - // uint8_t rcode; - // const uint8_t constBufSize = 16; - // uint8_t buf[constBufSize]; - - // for (uint8_t i=0; i epInfo[epInterruptInIndex].maxPktSize) - // ? epInfo[epInterruptInIndex].maxPktSize : constBufSize; - // rcode = pUsb->inTransfer(bAddress, epInfo[epInterruptInIndex].epAddr, &read, buf); - - // if (rcode) - // return rcode; - - // for (uint8_t i=0; i(buf[i]); - // Serial.print(" "); - // } - // USBTRACE("\r\n"); - //} - return rcode; -} - -//uint8_t ACM::RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr) -//{ -// return pUsb->inTransfer(bAddress, epInfo[epDataInIndex].epAddr, bytes_rcvd, dataptr); -//} -// -//uint8_t ACM::SndData(uint16_t nbytes, uint8_t *dataptr) -//{ -// return pUsb->outTransfer(bAddress, epInfo[epDataOutIndex].epAddr, nbytes, dataptr); -//} -// -//uint8_t ACM::SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr) -//{ -// return( pUsb->ctrlReq( bAddress, 0, bmREQ_CDCOUT, CDC_SET_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, nbytes, nbytes, dataptr, NULL )); -//} -// -//uint8_t ACM::GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr) -//{ -// return( pUsb->ctrlReq( bAddress, 0, bmREQ_CDCIN, CDC_GET_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, nbytes, nbytes, dataptr, NULL )); -//} -// -//uint8_t ACM::ClearCommFeature(uint16_t fid) -//{ -// return( pUsb->ctrlReq( bAddress, 0, bmREQ_CDCOUT, CDC_CLEAR_COMM_FEATURE, (fid & 0xff), (fid >> 8), bControlIface, 0, 0, NULL, NULL )); -//} -// -//uint8_t ACM::SetLineCoding(const LINE_CODING *dataptr) -//{ -// return( pUsb->ctrlReq( bAddress, 0, bmREQ_CDCOUT, CDC_SET_LINE_CODING, 0x00, 0x00, bControlIface, sizeof(LINE_CODING), sizeof(LINE_CODING), (uint8_t*)dataptr, NULL )); -//} -// -//uint8_t ACM::GetLineCoding(LINE_CODING *dataptr) -//{ -// return( pUsb->ctrlReq( bAddress, 0, bmREQ_CDCIN, CDC_GET_LINE_CODING, 0x00, 0x00, bControlIface, sizeof(LINE_CODING), sizeof(LINE_CODING), (uint8_t*)dataptr, NULL )); -//} -// -//uint8_t ACM::SetControlLineState(uint8_t state) -//{ -// return( pUsb->ctrlReq( bAddress, 0, bmREQ_CDCOUT, CDC_SET_CONTROL_LINE_STATE, state, 0, bControlIface, 0, 0, NULL, NULL )); -//} -// -//uint8_t ACM::SendBreak(uint16_t duration) -//{ -// return( pUsb->ctrlReq( bAddress, 0, bmREQ_CDCOUT, CDC_SEND_BREAK, (duration & 0xff), (duration >> 8), bControlIface, 0, 0, NULL, NULL )); -//} - - -void BulkOnly::PrintEndpointDescriptor( const USB_ENDPOINT_DESCRIPTOR* ep_ptr ) -{ - Notify(PSTR("Endpoint descriptor:")); - Notify(PSTR("\r\nLength:\t\t")); - PrintHex(ep_ptr->bLength); - Notify(PSTR("\r\nType:\t\t")); - PrintHex(ep_ptr->bDescriptorType); - Notify(PSTR("\r\nAddress:\t")); - PrintHex(ep_ptr->bEndpointAddress); - Notify(PSTR("\r\nAttributes:\t")); - PrintHex(ep_ptr->bmAttributes); - Notify(PSTR("\r\nMaxPktSize:\t")); - PrintHex(ep_ptr->wMaxPacketSize); - Notify(PSTR("\r\nPoll Intrv:\t")); - PrintHex(ep_ptr->bInterval); - Notify(PSTR("\r\n")); -} diff --git a/masstorage.h b/masstorage.h deleted file mode 100644 index ac92e737..00000000 --- a/masstorage.h +++ /dev/null @@ -1,119 +0,0 @@ -#if !defined(__MASSTORAGE_H__) -#define __MASSTORAGE_H__ - -#include -#include -#include "avrpins.h" -#include "max3421e.h" -#include "usbhost.h" -#include "usb_ch9.h" -#include "Usb.h" -#include - -#include "printhex.h" -#include "hexdump.h" -#include "message.h" - -#include "confdescparser.h" - -//#define bmREQ_CDCOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE -//#define bmREQ_CDCIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE - -// Mass Storage Subclass Constants -#define MASS_SUBCLASS_SCSI_NOT_REPORTED 0x00 // De facto use -#define MASS_SUBCLASS_RBC 0x01 -#define MASS_SUBCLASS_ATAPI 0x02 // MMC-5 (ATAPI) -#define MASS_SUBCLASS_OBSOLETE1 0x03 // Was QIC-157 -#define MASS_SUBCLASS_UFI 0x04 // Specifies how to interface Floppy Disk Drives to USB -#define MASS_SUBCLASS_OBSOLETE2 0x05 // Was SFF-8070i -#define MASS_SUBCLASS_SCSI 0x06 // SCSI Transparent Command Set -#define MASS_SUBCLASS_LSDFS 0x07 // Specifies how host has to negotiate access before trying SCSI -#define MASS_SUBCLASS_IEEE1667 0x08 - -// Mass Storage Class Protocols -#define MASS_PROTO_CBI 0x00 // CBI (with command completion interrupt) -#define MASS_PROTO_CBI_NO_INT 0x01 // CBI (without command completion interrupt) -#define MASS_PROTO_OBSOLETE 0x02 -#define MASS_PROTO_BBB 0x50 // Bulk Only Transport -#define MASS_PROTO_UAS 0x62 - -// Request Codes -#define MASS_REQ_ADSC 0x00 -#define MASS_REQ_GET 0xFC -#define MASS_REQ_PUT 0xFD -#define MASS_REQ_GET_MAX_LUN 0xFE -#define MASS_REQ_BOMSR 0xFF // Bulk-Only Mass Storage Reset - -#define MASS_CBW_SIGNATURE 0x43425355 -#define MASS_CBS_SIGNATURE 0x53425355 - -struct CommandBlockWrapper -{ - uint32_t dCBWSignature; - uint32_t dCBWTag; - uint32_t dCBWDataTransferLength; - uint8_t bmCBWFlags; - - struct - { - uint8_t bCBWLUN : 4; - uint8_t bReserved1 : 4; - }; - struct - { - uint8_t bCBWCBLength : 4; - uint8_t bReserved2 : 4; - }; - - uint8_t CBWCB[16]; -}; - -struct CommandStatusWrapper -{ - uint32_t dCSWSignature; - uint32_t dCSWTag; - uint32_t dCSWDataResidue; - uint8_t bCSWStatus; -}; - -#define MASS_MAX_ENDPOINTS 3 - -class BulkOnly : public USBDeviceConfig, public UsbConfigXtracter -{ -protected: - static const uint8_t epDataInIndex; // DataIn endpoint index - static const uint8_t epDataOutIndex; // DataOUT endpoint index - static const uint8_t epInterruptInIndex; // InterruptIN endpoint index - - USB *pUsb; -// CDCAsyncOper *pAsync; - uint8_t bAddress; - uint8_t bConfNum; // configuration number - uint8_t bIface; // interface value - uint8_t bNumEP; // total number of EP in the configuration - uint32_t qNextPollTime; // next poll time - bool bPollEnable; // poll enable flag - - EpInfo epInfo[MASS_MAX_ENDPOINTS]; - - void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr); - -public: - BulkOnly(USB *p); - - uint8_t Reset(); - uint8_t GetMaxLun(uint8_t *max_lun); - - uint8_t ResetRecovery(); - - // USBDeviceConfig implementation - virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed); - virtual uint8_t Release(); - virtual uint8_t Poll(); - virtual uint8_t GetAddress() { return bAddress; }; - - // UsbConfigXtracter implementation - virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep); -}; - -#endif // __MASSTORAGE_H__ \ No newline at end of file