diff options
Diffstat (limited to 'lib/usbhost/USB_Host_Shield_2.0/hidescriptorparser.cpp')
-rw-r--r-- | lib/usbhost/USB_Host_Shield_2.0/hidescriptorparser.cpp | 1588 |
1 files changed, 1588 insertions, 0 deletions
diff --git a/lib/usbhost/USB_Host_Shield_2.0/hidescriptorparser.cpp b/lib/usbhost/USB_Host_Shield_2.0/hidescriptorparser.cpp new file mode 100644 index 000000000..e4491b4e9 --- /dev/null +++ b/lib/usbhost/USB_Host_Shield_2.0/hidescriptorparser.cpp | |||
@@ -0,0 +1,1588 @@ | |||
1 | /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. | ||
2 | |||
3 | This software may be distributed and modified under the terms of the GNU | ||
4 | General Public License version 2 (GPL2) as published by the Free Software | ||
5 | Foundation and appearing in the file GPL2.TXT included in the packaging of | ||
6 | this file. Please note that GPL2 Section 2[b] requires that all works based | ||
7 | on this software must also be made publicly available under the terms of | ||
8 | the GPL2 ("Copyleft"). | ||
9 | |||
10 | Contact information | ||
11 | ------------------- | ||
12 | |||
13 | Circuits At Home, LTD | ||
14 | Web : http://www.circuitsathome.com | ||
15 | e-mail : support@circuitsathome.com | ||
16 | */ | ||
17 | |||
18 | #include "hidescriptorparser.h" | ||
19 | |||
20 | const char * const ReportDescParserBase::usagePageTitles0[] PROGMEM = { | ||
21 | pstrUsagePageGenericDesktopControls, | ||
22 | pstrUsagePageSimulationControls, | ||
23 | pstrUsagePageVRControls, | ||
24 | pstrUsagePageSportControls, | ||
25 | pstrUsagePageGameControls, | ||
26 | pstrUsagePageGenericDeviceControls, | ||
27 | pstrUsagePageKeyboardKeypad, | ||
28 | pstrUsagePageLEDs, | ||
29 | pstrUsagePageButton, | ||
30 | pstrUsagePageOrdinal, | ||
31 | pstrUsagePageTelephone, | ||
32 | pstrUsagePageConsumer, | ||
33 | pstrUsagePageDigitizer, | ||
34 | pstrUsagePagePID, | ||
35 | pstrUsagePageUnicode | ||
36 | }; | ||
37 | |||
38 | const char * const ReportDescParserBase::usagePageTitles1[] PROGMEM = { | ||
39 | pstrUsagePageBarCodeScanner, | ||
40 | pstrUsagePageScale, | ||
41 | pstrUsagePageMSRDevices, | ||
42 | pstrUsagePagePointOfSale, | ||
43 | pstrUsagePageCameraControl, | ||
44 | pstrUsagePageArcade | ||
45 | }; | ||
46 | const char * const ReportDescParserBase::genDesktopTitles0[] PROGMEM = { | ||
47 | pstrUsagePointer, | ||
48 | pstrUsageMouse, | ||
49 | pstrUsageJoystick, | ||
50 | pstrUsageGamePad, | ||
51 | pstrUsageKeyboard, | ||
52 | pstrUsageKeypad, | ||
53 | pstrUsageMultiAxisController, | ||
54 | pstrUsageTabletPCSystemControls | ||
55 | |||
56 | }; | ||
57 | const char * const ReportDescParserBase::genDesktopTitles1[] PROGMEM = { | ||
58 | pstrUsageX, | ||
59 | pstrUsageY, | ||
60 | pstrUsageZ, | ||
61 | pstrUsageRx, | ||
62 | pstrUsageRy, | ||
63 | pstrUsageRz, | ||
64 | pstrUsageSlider, | ||
65 | pstrUsageDial, | ||
66 | pstrUsageWheel, | ||
67 | pstrUsageHatSwitch, | ||
68 | pstrUsageCountedBuffer, | ||
69 | pstrUsageByteCount, | ||
70 | pstrUsageMotionWakeup, | ||
71 | pstrUsageStart, | ||
72 | pstrUsageSelect, | ||
73 | pstrUsagePageReserved, | ||
74 | pstrUsageVx, | ||
75 | pstrUsageVy, | ||
76 | pstrUsageVz, | ||
77 | pstrUsageVbrx, | ||
78 | pstrUsageVbry, | ||
79 | pstrUsageVbrz, | ||
80 | pstrUsageVno, | ||
81 | pstrUsageFeatureNotification, | ||
82 | pstrUsageResolutionMultiplier | ||
83 | }; | ||
84 | const char * const ReportDescParserBase::genDesktopTitles2[] PROGMEM = { | ||
85 | pstrUsageSystemControl, | ||
86 | pstrUsageSystemPowerDown, | ||
87 | pstrUsageSystemSleep, | ||
88 | pstrUsageSystemWakeup, | ||
89 | pstrUsageSystemContextMenu, | ||
90 | pstrUsageSystemMainMenu, | ||
91 | pstrUsageSystemAppMenu, | ||
92 | pstrUsageSystemMenuHelp, | ||
93 | pstrUsageSystemMenuExit, | ||
94 | pstrUsageSystemMenuSelect, | ||
95 | pstrUsageSystemMenuRight, | ||
96 | pstrUsageSystemMenuLeft, | ||
97 | pstrUsageSystemMenuUp, | ||
98 | pstrUsageSystemMenuDown, | ||
99 | pstrUsageSystemColdRestart, | ||
100 | pstrUsageSystemWarmRestart, | ||
101 | pstrUsageDPadUp, | ||
102 | pstrUsageDPadDown, | ||
103 | pstrUsageDPadRight, | ||
104 | pstrUsageDPadLeft | ||
105 | }; | ||
106 | const char * const ReportDescParserBase::genDesktopTitles3[] PROGMEM = { | ||
107 | pstrUsageSystemDock, | ||
108 | pstrUsageSystemUndock, | ||
109 | pstrUsageSystemSetup, | ||
110 | pstrUsageSystemBreak, | ||
111 | pstrUsageSystemDebuggerBreak, | ||
112 | pstrUsageApplicationBreak, | ||
113 | pstrUsageApplicationDebuggerBreak, | ||
114 | pstrUsageSystemSpeakerMute, | ||
115 | pstrUsageSystemHibernate | ||
116 | }; | ||
117 | const char * const ReportDescParserBase::genDesktopTitles4[] PROGMEM = { | ||
118 | pstrUsageSystemDisplayInvert, | ||
119 | pstrUsageSystemDisplayInternal, | ||
120 | pstrUsageSystemDisplayExternal, | ||
121 | pstrUsageSystemDisplayBoth, | ||
122 | pstrUsageSystemDisplayDual, | ||
123 | pstrUsageSystemDisplayToggleIntExt, | ||
124 | pstrUsageSystemDisplaySwapPriSec, | ||
125 | pstrUsageSystemDisplayLCDAutoscale | ||
126 | }; | ||
127 | const char * const ReportDescParserBase::simuTitles0[] PROGMEM = { | ||
128 | pstrUsageFlightSimulationDevice, | ||
129 | pstrUsageAutomobileSimulationDevice, | ||
130 | pstrUsageTankSimulationDevice, | ||
131 | pstrUsageSpaceshipSimulationDevice, | ||
132 | pstrUsageSubmarineSimulationDevice, | ||
133 | pstrUsageSailingSimulationDevice, | ||
134 | pstrUsageMotocicleSimulationDevice, | ||
135 | pstrUsageSportsSimulationDevice, | ||
136 | pstrUsageAirplaneSimulationDevice, | ||
137 | pstrUsageHelicopterSimulationDevice, | ||
138 | pstrUsageMagicCarpetSimulationDevice, | ||
139 | pstrUsageBicycleSimulationDevice | ||
140 | }; | ||
141 | const char * const ReportDescParserBase::simuTitles1[] PROGMEM = { | ||
142 | pstrUsageFlightControlStick, | ||
143 | pstrUsageFlightStick, | ||
144 | pstrUsageCyclicControl, | ||
145 | pstrUsageCyclicTrim, | ||
146 | pstrUsageFlightYoke, | ||
147 | pstrUsageTrackControl | ||
148 | }; | ||
149 | const char * const ReportDescParserBase::simuTitles2[] PROGMEM = { | ||
150 | pstrUsageAileron, | ||
151 | pstrUsageAileronTrim, | ||
152 | pstrUsageAntiTorqueControl, | ||
153 | pstrUsageAutopilotEnable, | ||
154 | pstrUsageChaffRelease, | ||
155 | pstrUsageCollectiveControl, | ||
156 | pstrUsageDiveBrake, | ||
157 | pstrUsageElectronicCountermeasures, | ||
158 | pstrUsageElevator, | ||
159 | pstrUsageElevatorTrim, | ||
160 | pstrUsageRudder, | ||
161 | pstrUsageThrottle, | ||
162 | pstrUsageFlightCommunications, | ||
163 | pstrUsageFlareRelease, | ||
164 | pstrUsageLandingGear, | ||
165 | pstrUsageToeBrake, | ||
166 | pstrUsageTrigger, | ||
167 | pstrUsageWeaponsArm, | ||
168 | pstrUsageWeaponsSelect, | ||
169 | pstrUsageWingFlaps, | ||
170 | pstrUsageAccelerator, | ||
171 | pstrUsageBrake, | ||
172 | pstrUsageClutch, | ||
173 | pstrUsageShifter, | ||
174 | pstrUsageSteering, | ||
175 | pstrUsageTurretDirection, | ||
176 | pstrUsageBarrelElevation, | ||
177 | pstrUsageDivePlane, | ||
178 | pstrUsageBallast, | ||
179 | pstrUsageBicycleCrank, | ||
180 | pstrUsageHandleBars, | ||
181 | pstrUsageFrontBrake, | ||
182 | pstrUsageRearBrake | ||
183 | }; | ||
184 | const char * const ReportDescParserBase::vrTitles0[] PROGMEM = { | ||
185 | pstrUsageBelt, | ||
186 | pstrUsageBodySuit, | ||
187 | pstrUsageFlexor, | ||
188 | pstrUsageGlove, | ||
189 | pstrUsageHeadTracker, | ||
190 | pstrUsageHeadMountedDisplay, | ||
191 | pstrUsageHandTracker, | ||
192 | pstrUsageOculometer, | ||
193 | pstrUsageVest, | ||
194 | pstrUsageAnimatronicDevice | ||
195 | }; | ||
196 | const char * const ReportDescParserBase::vrTitles1[] PROGMEM = { | ||
197 | pstrUsageStereoEnable, | ||
198 | pstrUsageDisplayEnable | ||
199 | }; | ||
200 | const char * const ReportDescParserBase::sportsCtrlTitles0[] PROGMEM = { | ||
201 | pstrUsageBaseballBat, | ||
202 | pstrUsageGolfClub, | ||
203 | pstrUsageRowingMachine, | ||
204 | pstrUsageTreadmill | ||
205 | }; | ||
206 | const char * const ReportDescParserBase::sportsCtrlTitles1[] PROGMEM = { | ||
207 | pstrUsageOar, | ||
208 | pstrUsageSlope, | ||
209 | pstrUsageRate, | ||
210 | pstrUsageStickSpeed, | ||
211 | pstrUsageStickFaceAngle, | ||
212 | pstrUsageStickHeelToe, | ||
213 | pstrUsageStickFollowThough, | ||
214 | pstrUsageStickTempo, | ||
215 | pstrUsageStickType, | ||
216 | pstrUsageStickHeight | ||
217 | }; | ||
218 | const char * const ReportDescParserBase::sportsCtrlTitles2[] PROGMEM = { | ||
219 | pstrUsagePutter, | ||
220 | pstrUsage1Iron, | ||
221 | pstrUsage2Iron, | ||
222 | pstrUsage3Iron, | ||
223 | pstrUsage4Iron, | ||
224 | pstrUsage5Iron, | ||
225 | pstrUsage6Iron, | ||
226 | pstrUsage7Iron, | ||
227 | pstrUsage8Iron, | ||
228 | pstrUsage9Iron, | ||
229 | pstrUsage10Iron, | ||
230 | pstrUsage11Iron, | ||
231 | pstrUsageSandWedge, | ||
232 | pstrUsageLoftWedge, | ||
233 | pstrUsagePowerWedge, | ||
234 | pstrUsage1Wood, | ||
235 | pstrUsage3Wood, | ||
236 | pstrUsage5Wood, | ||
237 | pstrUsage7Wood, | ||
238 | pstrUsage9Wood | ||
239 | }; | ||
240 | const char * const ReportDescParserBase::gameTitles0[] PROGMEM = { | ||
241 | pstrUsage3DGameController, | ||
242 | pstrUsagePinballDevice, | ||
243 | pstrUsageGunDevice | ||
244 | }; | ||
245 | const char * const ReportDescParserBase::gameTitles1[] PROGMEM = { | ||
246 | pstrUsagePointOfView, | ||
247 | pstrUsageTurnRightLeft, | ||
248 | pstrUsagePitchForwardBackward, | ||
249 | pstrUsageRollRightLeft, | ||
250 | pstrUsageMoveRightLeft, | ||
251 | pstrUsageMoveForwardBackward, | ||
252 | pstrUsageMoveUpDown, | ||
253 | pstrUsageLeanRightLeft, | ||
254 | pstrUsageLeanForwardBackward, | ||
255 | pstrUsageHeightOfPOV, | ||
256 | pstrUsageFlipper, | ||
257 | pstrUsageSecondaryFlipper, | ||
258 | pstrUsageBump, | ||
259 | pstrUsageNewGame, | ||
260 | pstrUsageShootBall, | ||
261 | pstrUsagePlayer, | ||
262 | pstrUsageGunBolt, | ||
263 | pstrUsageGunClip, | ||
264 | pstrUsageGunSelector, | ||
265 | pstrUsageGunSingleShot, | ||
266 | pstrUsageGunBurst, | ||
267 | pstrUsageGunAutomatic, | ||
268 | pstrUsageGunSafety, | ||
269 | pstrUsageGamepadFireJump, | ||
270 | pstrUsageGamepadTrigger | ||
271 | }; | ||
272 | const char * const ReportDescParserBase::genDevCtrlTitles[] PROGMEM = { | ||
273 | pstrUsageBatteryStrength, | ||
274 | pstrUsageWirelessChannel, | ||
275 | pstrUsageWirelessID, | ||
276 | pstrUsageDiscoverWirelessControl, | ||
277 | pstrUsageSecurityCodeCharEntered, | ||
278 | pstrUsageSecurityCodeCharErased, | ||
279 | pstrUsageSecurityCodeCleared | ||
280 | }; | ||
281 | const char * const ReportDescParserBase::ledTitles[] PROGMEM = { | ||
282 | pstrUsageNumLock, | ||
283 | pstrUsageCapsLock, | ||
284 | pstrUsageScrollLock, | ||
285 | pstrUsageCompose, | ||
286 | pstrUsageKana, | ||
287 | pstrUsagePower, | ||
288 | pstrUsageShift, | ||
289 | pstrUsageDoNotDisturb, | ||
290 | pstrUsageMute, | ||
291 | pstrUsageToneEnable, | ||
292 | pstrUsageHighCutFilter, | ||
293 | pstrUsageLowCutFilter, | ||
294 | pstrUsageEqualizerEnable, | ||
295 | pstrUsageSoundFieldOn, | ||
296 | pstrUsageSurroundOn, | ||
297 | pstrUsageRepeat, | ||
298 | pstrUsageStereo, | ||
299 | pstrUsageSamplingRateDetect, | ||
300 | pstrUsageSpinning, | ||
301 | pstrUsageCAV, | ||
302 | pstrUsageCLV, | ||
303 | pstrUsageRecordingFormatDetect, | ||
304 | pstrUsageOffHook, | ||
305 | pstrUsageRing, | ||
306 | pstrUsageMessageWaiting, | ||
307 | pstrUsageDataMode, | ||
308 | pstrUsageBatteryOperation, | ||
309 | pstrUsageBatteryOK, | ||
310 | pstrUsageBatteryLow, | ||
311 | pstrUsageSpeaker, | ||
312 | pstrUsageHeadSet, | ||
313 | pstrUsageHold, | ||
314 | pstrUsageMicrophone, | ||
315 | pstrUsageCoverage, | ||
316 | pstrUsageNightMode, | ||
317 | pstrUsageSendCalls, | ||
318 | pstrUsageCallPickup, | ||
319 | pstrUsageConference, | ||
320 | pstrUsageStandBy, | ||
321 | pstrUsageCameraOn, | ||
322 | pstrUsageCameraOff, | ||
323 | pstrUsageOnLine, | ||
324 | pstrUsageOffLine, | ||
325 | pstrUsageBusy, | ||
326 | pstrUsageReady, | ||
327 | pstrUsagePaperOut, | ||
328 | pstrUsagePaperJam, | ||
329 | pstrUsageRemote, | ||
330 | pstrUsageForward, | ||
331 | pstrUsageReverse, | ||
332 | pstrUsageStop, | ||
333 | pstrUsageRewind, | ||
334 | pstrUsageFastForward, | ||
335 | pstrUsagePlay, | ||
336 | pstrUsagePause, | ||
337 | pstrUsageRecord, | ||
338 | pstrUsageError, | ||
339 | pstrUsageSelectedIndicator, | ||
340 | pstrUsageInUseIndicator, | ||
341 | pstrUsageMultiModeIndicator, | ||
342 | pstrUsageIndicatorOn, | ||
343 | pstrUsageIndicatorFlash, | ||
344 | pstrUsageIndicatorSlowBlink, | ||
345 | pstrUsageIndicatorFastBlink, | ||
346 | pstrUsageIndicatorOff, | ||
347 | pstrUsageFlashOnTime, | ||
348 | pstrUsageSlowBlinkOnTime, | ||
349 | pstrUsageSlowBlinkOffTime, | ||
350 | pstrUsageFastBlinkOnTime, | ||
351 | pstrUsageFastBlinkOffTime, | ||
352 | pstrUsageIndicatorColor, | ||
353 | pstrUsageIndicatorRed, | ||
354 | pstrUsageIndicatorGreen, | ||
355 | pstrUsageIndicatorAmber, | ||
356 | pstrUsageGenericIndicator, | ||
357 | pstrUsageSystemSuspend, | ||
358 | pstrUsageExternalPowerConnected | ||
359 | }; | ||
360 | const char * const ReportDescParserBase::telTitles0 [] PROGMEM = { | ||
361 | pstrUsagePhone, | ||
362 | pstrUsageAnsweringMachine, | ||
363 | pstrUsageMessageControls, | ||
364 | pstrUsageHandset, | ||
365 | pstrUsageHeadset, | ||
366 | pstrUsageTelephonyKeyPad, | ||
367 | pstrUsageProgrammableButton | ||
368 | }; | ||
369 | const char * const ReportDescParserBase::telTitles1 [] PROGMEM = { | ||
370 | pstrUsageHookSwitch, | ||
371 | pstrUsageFlash, | ||
372 | pstrUsageFeature, | ||
373 | pstrUsageHold, | ||
374 | pstrUsageRedial, | ||
375 | pstrUsageTransfer, | ||
376 | pstrUsageDrop, | ||
377 | pstrUsagePark, | ||
378 | pstrUsageForwardCalls, | ||
379 | pstrUsageAlternateFunction, | ||
380 | pstrUsageLine, | ||
381 | pstrUsageSpeakerPhone, | ||
382 | pstrUsageConference, | ||
383 | pstrUsageRingEnable, | ||
384 | pstrUsageRingSelect, | ||
385 | pstrUsagePhoneMute, | ||
386 | pstrUsageCallerID, | ||
387 | pstrUsageSend | ||
388 | }; | ||
389 | const char * const ReportDescParserBase::telTitles2 [] PROGMEM = { | ||
390 | pstrUsageSpeedDial, | ||
391 | pstrUsageStoreNumber, | ||
392 | pstrUsageRecallNumber, | ||
393 | pstrUsagePhoneDirectory | ||
394 | }; | ||
395 | const char * const ReportDescParserBase::telTitles3 [] PROGMEM = { | ||
396 | pstrUsageVoiceMail, | ||
397 | pstrUsageScreenCalls, | ||
398 | pstrUsageDoNotDisturb, | ||
399 | pstrUsageMessage, | ||
400 | pstrUsageAnswerOnOff | ||
401 | }; | ||
402 | const char * const ReportDescParserBase::telTitles4 [] PROGMEM = { | ||
403 | pstrUsageInsideDialTone, | ||
404 | pstrUsageOutsideDialTone, | ||
405 | pstrUsageInsideRingTone, | ||
406 | pstrUsageOutsideRingTone, | ||
407 | pstrUsagePriorityRingTone, | ||
408 | pstrUsageInsideRingback, | ||
409 | pstrUsagePriorityRingback, | ||
410 | pstrUsageLineBusyTone, | ||
411 | pstrUsageReorderTone, | ||
412 | pstrUsageCallWaitingTone, | ||
413 | pstrUsageConfirmationTone1, | ||
414 | pstrUsageConfirmationTone2, | ||
415 | pstrUsageTonesOff, | ||
416 | pstrUsageOutsideRingback, | ||
417 | pstrUsageRinger | ||
418 | }; | ||
419 | const char * const ReportDescParserBase::telTitles5 [] PROGMEM = { | ||
420 | pstrUsagePhoneKey0, | ||
421 | pstrUsagePhoneKey1, | ||
422 | pstrUsagePhoneKey2, | ||
423 | pstrUsagePhoneKey3, | ||
424 | pstrUsagePhoneKey4, | ||
425 | pstrUsagePhoneKey5, | ||
426 | pstrUsagePhoneKey6, | ||
427 | pstrUsagePhoneKey7, | ||
428 | pstrUsagePhoneKey8, | ||
429 | pstrUsagePhoneKey9, | ||
430 | pstrUsagePhoneKeyStar, | ||
431 | pstrUsagePhoneKeyPound, | ||
432 | pstrUsagePhoneKeyA, | ||
433 | pstrUsagePhoneKeyB, | ||
434 | pstrUsagePhoneKeyC, | ||
435 | pstrUsagePhoneKeyD | ||
436 | }; | ||
437 | const char * const ReportDescParserBase::consTitles0[] PROGMEM = { | ||
438 | pstrUsageConsumerControl, | ||
439 | pstrUsageNumericKeyPad, | ||
440 | pstrUsageProgrammableButton, | ||
441 | pstrUsageMicrophone, | ||
442 | pstrUsageHeadphone, | ||
443 | pstrUsageGraphicEqualizer | ||
444 | }; | ||
445 | const char * const ReportDescParserBase::consTitles1[] PROGMEM = { | ||
446 | pstrUsagePlus10, | ||
447 | pstrUsagePlus100, | ||
448 | pstrUsageAMPM | ||
449 | }; | ||
450 | const char * const ReportDescParserBase::consTitles2[] PROGMEM = { | ||
451 | pstrUsagePower, | ||
452 | pstrUsageReset, | ||
453 | pstrUsageSleep, | ||
454 | pstrUsageSleepAfter, | ||
455 | pstrUsageSleepMode, | ||
456 | pstrUsageIllumination, | ||
457 | pstrUsageFunctionButtons | ||
458 | |||
459 | }; | ||
460 | const char * const ReportDescParserBase::consTitles3[] PROGMEM = { | ||
461 | pstrUsageMenu, | ||
462 | pstrUsageMenuPick, | ||
463 | pstrUsageMenuUp, | ||
464 | pstrUsageMenuDown, | ||
465 | pstrUsageMenuLeft, | ||
466 | pstrUsageMenuRight, | ||
467 | pstrUsageMenuEscape, | ||
468 | pstrUsageMenuValueIncrease, | ||
469 | pstrUsageMenuValueDecrease | ||
470 | }; | ||
471 | const char * const ReportDescParserBase::consTitles4[] PROGMEM = { | ||
472 | pstrUsageDataOnScreen, | ||
473 | pstrUsageClosedCaption, | ||
474 | pstrUsageClosedCaptionSelect, | ||
475 | pstrUsageVCRTV, | ||
476 | pstrUsageBroadcastMode, | ||
477 | pstrUsageSnapshot, | ||
478 | pstrUsageStill | ||
479 | }; | ||
480 | const char * const ReportDescParserBase::consTitles5[] PROGMEM = { | ||
481 | pstrUsageSelection, | ||
482 | pstrUsageAssignSelection, | ||
483 | pstrUsageModeStep, | ||
484 | pstrUsageRecallLast, | ||
485 | pstrUsageEnterChannel, | ||
486 | pstrUsageOrderMovie, | ||
487 | pstrUsageChannel, | ||
488 | pstrUsageMediaSelection, | ||
489 | pstrUsageMediaSelectComputer, | ||
490 | pstrUsageMediaSelectTV, | ||
491 | pstrUsageMediaSelectWWW, | ||
492 | pstrUsageMediaSelectDVD, | ||
493 | pstrUsageMediaSelectTelephone, | ||
494 | pstrUsageMediaSelectProgramGuide, | ||
495 | pstrUsageMediaSelectVideoPhone, | ||
496 | pstrUsageMediaSelectGames, | ||
497 | pstrUsageMediaSelectMessages, | ||
498 | pstrUsageMediaSelectCD, | ||
499 | pstrUsageMediaSelectVCR, | ||
500 | pstrUsageMediaSelectTuner, | ||
501 | pstrUsageQuit, | ||
502 | pstrUsageHelp, | ||
503 | pstrUsageMediaSelectTape, | ||
504 | pstrUsageMediaSelectCable, | ||
505 | pstrUsageMediaSelectSatellite, | ||
506 | pstrUsageMediaSelectSecurity, | ||
507 | pstrUsageMediaSelectHome, | ||
508 | pstrUsageMediaSelectCall, | ||
509 | pstrUsageChannelIncrement, | ||
510 | pstrUsageChannelDecrement, | ||
511 | pstrUsageMediaSelectSAP, | ||
512 | pstrUsagePageReserved, | ||
513 | pstrUsageVCRPlus, | ||
514 | pstrUsageOnce, | ||
515 | pstrUsageDaily, | ||
516 | pstrUsageWeekly, | ||
517 | pstrUsageMonthly | ||
518 | }; | ||
519 | const char * const ReportDescParserBase::consTitles6[] PROGMEM = { | ||
520 | pstrUsagePlay, | ||
521 | pstrUsagePause, | ||
522 | pstrUsageRecord, | ||
523 | pstrUsageFastForward, | ||
524 | pstrUsageRewind, | ||
525 | pstrUsageScanNextTrack, | ||
526 | pstrUsageScanPreviousTrack, | ||
527 | pstrUsageStop, | ||
528 | pstrUsageEject, | ||
529 | pstrUsageRandomPlay, | ||
530 | pstrUsageSelectDisk, | ||
531 | pstrUsageEnterDisk, | ||
532 | pstrUsageRepeat, | ||
533 | pstrUsageTracking, | ||
534 | pstrUsageTrackNormal, | ||
535 | pstrUsageSlowTracking, | ||
536 | pstrUsageFrameForward, | ||
537 | pstrUsageFrameBackwards, | ||
538 | pstrUsageMark, | ||
539 | pstrUsageClearMark, | ||
540 | pstrUsageRepeatFromMark, | ||
541 | pstrUsageReturnToMark, | ||
542 | pstrUsageSearchMarkForward, | ||
543 | pstrUsageSearchMarkBackwards, | ||
544 | pstrUsageCounterReset, | ||
545 | pstrUsageShowCounter, | ||
546 | pstrUsageTrackingIncrement, | ||
547 | pstrUsageTrackingDecrement, | ||
548 | pstrUsageStopEject, | ||
549 | pstrUsagePlayPause, | ||
550 | pstrUsagePlaySkip | ||
551 | }; | ||
552 | const char * const ReportDescParserBase::consTitles7[] PROGMEM = { | ||
553 | pstrUsageVolume, | ||
554 | pstrUsageBalance, | ||
555 | pstrUsageMute, | ||
556 | pstrUsageBass, | ||
557 | pstrUsageTreble, | ||
558 | pstrUsageBassBoost, | ||
559 | pstrUsageSurroundMode, | ||
560 | pstrUsageLoudness, | ||
561 | pstrUsageMPX, | ||
562 | pstrUsageVolumeIncrement, | ||
563 | pstrUsageVolumeDecrement | ||
564 | }; | ||
565 | const char * const ReportDescParserBase::consTitles8[] PROGMEM = { | ||
566 | pstrUsageSpeedSelect, | ||
567 | pstrUsagePlaybackSpeed, | ||
568 | pstrUsageStandardPlay, | ||
569 | pstrUsageLongPlay, | ||
570 | pstrUsageExtendedPlay, | ||
571 | pstrUsageSlow | ||
572 | }; | ||
573 | const char * const ReportDescParserBase::consTitles9[] PROGMEM = { | ||
574 | pstrUsageFanEnable, | ||
575 | pstrUsageFanSpeed, | ||
576 | pstrUsageLightEnable, | ||
577 | pstrUsageLightIlluminationLevel, | ||
578 | pstrUsageClimateControlEnable, | ||
579 | pstrUsageRoomTemperature, | ||
580 | pstrUsageSecurityEnable, | ||
581 | pstrUsageFireAlarm, | ||
582 | pstrUsagePoliceAlarm, | ||
583 | pstrUsageProximity, | ||
584 | pstrUsageMotion, | ||
585 | pstrUsageDuresAlarm, | ||
586 | pstrUsageHoldupAlarm, | ||
587 | pstrUsageMedicalAlarm | ||
588 | }; | ||
589 | const char * const ReportDescParserBase::consTitlesA[] PROGMEM = { | ||
590 | pstrUsageBalanceRight, | ||
591 | pstrUsageBalanceLeft, | ||
592 | pstrUsageBassIncrement, | ||
593 | pstrUsageBassDecrement, | ||
594 | pstrUsageTrebleIncrement, | ||
595 | pstrUsageTrebleDecrement | ||
596 | }; | ||
597 | const char * const ReportDescParserBase::consTitlesB[] PROGMEM = { | ||
598 | pstrUsageSpeakerSystem, | ||
599 | pstrUsageChannelLeft, | ||
600 | pstrUsageChannelRight, | ||
601 | pstrUsageChannelCenter, | ||
602 | pstrUsageChannelFront, | ||
603 | pstrUsageChannelCenterFront, | ||
604 | pstrUsageChannelSide, | ||
605 | pstrUsageChannelSurround, | ||
606 | pstrUsageChannelLowFreqEnhancement, | ||
607 | pstrUsageChannelTop, | ||
608 | pstrUsageChannelUnknown | ||
609 | }; | ||
610 | const char * const ReportDescParserBase::consTitlesC[] PROGMEM = { | ||
611 | pstrUsageSubChannel, | ||
612 | pstrUsageSubChannelIncrement, | ||
613 | pstrUsageSubChannelDecrement, | ||
614 | pstrUsageAlternateAudioIncrement, | ||
615 | pstrUsageAlternateAudioDecrement | ||
616 | }; | ||
617 | const char * const ReportDescParserBase::consTitlesD[] PROGMEM = { | ||
618 | pstrUsageApplicationLaunchButtons, | ||
619 | pstrUsageALLaunchButtonConfigTool, | ||
620 | pstrUsageALProgrammableButton, | ||
621 | pstrUsageALConsumerControlConfig, | ||
622 | pstrUsageALWordProcessor, | ||
623 | pstrUsageALTextEditor, | ||
624 | pstrUsageALSpreadsheet, | ||
625 | pstrUsageALGraphicsEditor, | ||
626 | pstrUsageALPresentationApp, | ||
627 | pstrUsageALDatabaseApp, | ||
628 | pstrUsageALEmailReader, | ||
629 | pstrUsageALNewsreader, | ||
630 | pstrUsageALVoicemail, | ||
631 | pstrUsageALContactsAddressBook, | ||
632 | pstrUsageALCalendarSchedule, | ||
633 | pstrUsageALTaskProjectManager, | ||
634 | pstrUsageALLogJournalTimecard, | ||
635 | pstrUsageALCheckbookFinance, | ||
636 | pstrUsageALCalculator, | ||
637 | pstrUsageALAVCapturePlayback, | ||
638 | pstrUsageALLocalMachineBrowser, | ||
639 | pstrUsageALLANWANBrow, | ||
640 | pstrUsageALInternetBrowser, | ||
641 | pstrUsageALRemoteNetISPConnect, | ||
642 | pstrUsageALNetworkConference, | ||
643 | pstrUsageALNetworkChat, | ||
644 | pstrUsageALTelephonyDialer, | ||
645 | pstrUsageALLogon, | ||
646 | pstrUsageALLogoff, | ||
647 | pstrUsageALLogonLogoff, | ||
648 | pstrUsageALTermLockScrSav, | ||
649 | pstrUsageALControlPannel, | ||
650 | pstrUsageALCommandLineProcessorRun, | ||
651 | pstrUsageALProcessTaskManager, | ||
652 | pstrUsageALSelectTaskApplication, | ||
653 | pstrUsageALNextTaskApplication, | ||
654 | pstrUsageALPreviousTaskApplication, | ||
655 | pstrUsageALPreemptiveHaltTaskApp, | ||
656 | pstrUsageALIntegratedHelpCenter, | ||
657 | pstrUsageALDocuments, | ||
658 | pstrUsageALThesaurus, | ||
659 | pstrUsageALDictionary, | ||
660 | pstrUsageALDesktop, | ||
661 | pstrUsageALSpellCheck, | ||
662 | pstrUsageALGrammarCheck, | ||
663 | pstrUsageALWirelessStatus, | ||
664 | pstrUsageALKeyboardLayout, | ||
665 | pstrUsageALVirusProtection, | ||
666 | pstrUsageALEncryption, | ||
667 | pstrUsageALScreenSaver, | ||
668 | pstrUsageALAlarms, | ||
669 | pstrUsageALClock, | ||
670 | pstrUsageALFileBrowser, | ||
671 | pstrUsageALPowerStatus, | ||
672 | pstrUsageALImageBrowser, | ||
673 | pstrUsageALAudioBrowser, | ||
674 | pstrUsageALMovieBrowser, | ||
675 | pstrUsageALDigitalRightsManager, | ||
676 | pstrUsageALDigitalWallet, | ||
677 | pstrUsagePageReserved, | ||
678 | pstrUsageALInstantMessaging, | ||
679 | pstrUsageALOEMFeaturesBrowser, | ||
680 | pstrUsageALOEMHelp, | ||
681 | pstrUsageALOnlineCommunity, | ||
682 | pstrUsageALEntertainmentContentBrow, | ||
683 | pstrUsageALOnlineShoppingBrowser, | ||
684 | pstrUsageALSmartCardInfoHelp, | ||
685 | pstrUsageALMarketMonitorFinBrowser, | ||
686 | pstrUsageALCustomCorpNewsBrowser, | ||
687 | pstrUsageALOnlineActivityBrowser, | ||
688 | pstrUsageALResearchSearchBrowser, | ||
689 | pstrUsageALAudioPlayer | ||
690 | }; | ||
691 | const char * const ReportDescParserBase::consTitlesE[] PROGMEM = { | ||
692 | pstrUsageGenericGUIAppControls, | ||
693 | pstrUsageACNew, | ||
694 | pstrUsageACOpen, | ||
695 | pstrUsageACClose, | ||
696 | pstrUsageACExit, | ||
697 | pstrUsageACMaximize, | ||
698 | pstrUsageACMinimize, | ||
699 | pstrUsageACSave, | ||
700 | pstrUsageACPrint, | ||
701 | pstrUsageACProperties, | ||
702 | pstrUsageACUndo, | ||
703 | pstrUsageACCopy, | ||
704 | pstrUsageACCut, | ||
705 | pstrUsageACPaste, | ||
706 | pstrUsageACSelectAll, | ||
707 | pstrUsageACFind, | ||
708 | pstrUsageACFindAndReplace, | ||
709 | pstrUsageACSearch, | ||
710 | pstrUsageACGoto, | ||
711 | pstrUsageACHome, | ||
712 | pstrUsageACBack, | ||
713 | pstrUsageACForward, | ||
714 | pstrUsageACStop, | ||
715 | pstrUsageACRefresh, | ||
716 | pstrUsageACPreviousLink, | ||
717 | pstrUsageACNextLink, | ||
718 | pstrUsageACBookmarks, | ||
719 | pstrUsageACHistory, | ||
720 | pstrUsageACSubscriptions, | ||
721 | pstrUsageACZoomIn, | ||
722 | pstrUsageACZoomOut, | ||
723 | pstrUsageACZoom, | ||
724 | pstrUsageACFullScreenView, | ||
725 | pstrUsageACNormalView, | ||
726 | pstrUsageACViewToggle, | ||
727 | pstrUsageACScrollUp, | ||
728 | pstrUsageACScrollDown, | ||
729 | pstrUsageACScroll, | ||
730 | pstrUsageACPanLeft, | ||
731 | pstrUsageACPanRight, | ||
732 | pstrUsageACPan, | ||
733 | pstrUsageACNewWindow, | ||
734 | pstrUsageACTileHoriz, | ||
735 | pstrUsageACTileVert, | ||
736 | pstrUsageACFormat, | ||
737 | pstrUsageACEdit, | ||
738 | pstrUsageACBold, | ||
739 | pstrUsageACItalics, | ||
740 | pstrUsageACUnderline, | ||
741 | pstrUsageACStrikethrough, | ||
742 | pstrUsageACSubscript, | ||
743 | pstrUsageACSuperscript, | ||
744 | pstrUsageACAllCaps, | ||
745 | pstrUsageACRotate, | ||
746 | pstrUsageACResize, | ||
747 | pstrUsageACFlipHorizontal, | ||
748 | pstrUsageACFlipVertical, | ||
749 | pstrUsageACMirrorHorizontal, | ||
750 | pstrUsageACMirrorVertical, | ||
751 | pstrUsageACFontSelect, | ||
752 | pstrUsageACFontColor, | ||
753 | pstrUsageACFontSize, | ||
754 | pstrUsageACJustifyLeft, | ||
755 | pstrUsageACJustifyCenterH, | ||
756 | pstrUsageACJustifyRight, | ||
757 | pstrUsageACJustifyBlockH, | ||
758 | pstrUsageACJustifyTop, | ||
759 | pstrUsageACJustifyCenterV, | ||
760 | pstrUsageACJustifyBottom, | ||
761 | pstrUsageACJustifyBlockV, | ||
762 | pstrUsageACIndentDecrease, | ||
763 | pstrUsageACIndentIncrease, | ||
764 | pstrUsageACNumberedList, | ||
765 | pstrUsageACRestartNumbering, | ||
766 | pstrUsageACBulletedList, | ||
767 | pstrUsageACPromote, | ||
768 | pstrUsageACDemote, | ||
769 | pstrUsageACYes, | ||
770 | pstrUsageACNo, | ||
771 | pstrUsageACCancel, | ||
772 | pstrUsageACCatalog, | ||
773 | pstrUsageACBuyChkout, | ||
774 | pstrUsageACAddToCart, | ||
775 | pstrUsageACExpand, | ||
776 | pstrUsageACExpandAll, | ||
777 | pstrUsageACCollapse, | ||
778 | pstrUsageACCollapseAll, | ||
779 | pstrUsageACPrintPreview, | ||
780 | pstrUsageACPasteSpecial, | ||
781 | pstrUsageACInsertMode, | ||
782 | pstrUsageACDelete, | ||
783 | pstrUsageACLock, | ||
784 | pstrUsageACUnlock, | ||
785 | pstrUsageACProtect, | ||
786 | pstrUsageACUnprotect, | ||
787 | pstrUsageACAttachComment, | ||
788 | pstrUsageACDeleteComment, | ||
789 | pstrUsageACViewComment, | ||
790 | pstrUsageACSelectWord, | ||
791 | pstrUsageACSelectSentence, | ||
792 | pstrUsageACSelectParagraph, | ||
793 | pstrUsageACSelectColumn, | ||
794 | pstrUsageACSelectRow, | ||
795 | pstrUsageACSelectTable, | ||
796 | pstrUsageACSelectObject, | ||
797 | pstrUsageACRedoRepeat, | ||
798 | pstrUsageACSort, | ||
799 | pstrUsageACSortAscending, | ||
800 | pstrUsageACSortDescending, | ||
801 | pstrUsageACFilter, | ||
802 | pstrUsageACSetClock, | ||
803 | pstrUsageACViewClock, | ||
804 | pstrUsageACSelectTimeZone, | ||
805 | pstrUsageACEditTimeZone, | ||
806 | pstrUsageACSetAlarm, | ||
807 | pstrUsageACClearAlarm, | ||
808 | pstrUsageACSnoozeAlarm, | ||
809 | pstrUsageACResetAlarm, | ||
810 | pstrUsageACSyncronize, | ||
811 | pstrUsageACSendReceive, | ||
812 | pstrUsageACSendTo, | ||
813 | pstrUsageACReply, | ||
814 | pstrUsageACReplyAll, | ||
815 | pstrUsageACForwardMessage, | ||
816 | pstrUsageACSend, | ||
817 | pstrUsageACAttachFile, | ||
818 | pstrUsageACUpload, | ||
819 | pstrUsageACDownload, | ||
820 | pstrUsageACSetBorders, | ||
821 | pstrUsageACInsertRow, | ||
822 | pstrUsageACInsertColumn, | ||
823 | pstrUsageACInsertFile, | ||
824 | pstrUsageACInsertPicture, | ||
825 | pstrUsageACInsertObject, | ||
826 | pstrUsageACInsertSymbol, | ||
827 | pstrUsageACSaveAndClose, | ||
828 | pstrUsageACRename, | ||
829 | pstrUsageACMerge, | ||
830 | pstrUsageACSplit, | ||
831 | pstrUsageACDistributeHorizontaly, | ||
832 | pstrUsageACDistributeVerticaly | ||
833 | }; | ||
834 | const char * const ReportDescParserBase::digitTitles0[] PROGMEM = { | ||
835 | pstrUsageDigitizer, | ||
836 | pstrUsagePen, | ||
837 | pstrUsageLightPen, | ||
838 | pstrUsageTouchScreen, | ||
839 | pstrUsageTouchPad, | ||
840 | pstrUsageWhiteBoard, | ||
841 | pstrUsageCoordinateMeasuringMachine, | ||
842 | pstrUsage3DDigitizer, | ||
843 | pstrUsageStereoPlotter, | ||
844 | pstrUsageArticulatedArm, | ||
845 | pstrUsageArmature, | ||
846 | pstrUsageMultiplePointDigitizer, | ||
847 | pstrUsageFreeSpaceWand | ||
848 | }; | ||
849 | const char * const ReportDescParserBase::digitTitles1[] PROGMEM = { | ||
850 | pstrUsageStylus, | ||
851 | pstrUsagePuck, | ||
852 | pstrUsageFinger | ||
853 | |||
854 | }; | ||
855 | const char * const ReportDescParserBase::digitTitles2[] PROGMEM = { | ||
856 | pstrUsageTipPressure, | ||
857 | pstrUsageBarrelPressure, | ||
858 | pstrUsageInRange, | ||
859 | pstrUsageTouch, | ||
860 | pstrUsageUntouch, | ||
861 | pstrUsageTap, | ||
862 | pstrUsageQuality, | ||
863 | pstrUsageDataValid, | ||
864 | pstrUsageTransducerIndex, | ||
865 | pstrUsageTabletFunctionKeys, | ||
866 | pstrUsageProgramChangeKeys, | ||
867 | pstrUsageBatteryStrength, | ||
868 | pstrUsageInvert, | ||
869 | pstrUsageXTilt, | ||
870 | pstrUsageYTilt, | ||
871 | pstrUsageAzimuth, | ||
872 | pstrUsageAltitude, | ||
873 | pstrUsageTwist, | ||
874 | pstrUsageTipSwitch, | ||
875 | pstrUsageSecondaryTipSwitch, | ||
876 | pstrUsageBarrelSwitch, | ||
877 | pstrUsageEraser, | ||
878 | pstrUsageTabletPick | ||
879 | }; | ||
880 | const char * const ReportDescParserBase::aplphanumTitles0[] PROGMEM = { | ||
881 | pstrUsageAlphanumericDisplay, | ||
882 | pstrUsageBitmappedDisplay | ||
883 | }; | ||
884 | const char * const ReportDescParserBase::aplphanumTitles1[] PROGMEM = { | ||
885 | pstrUsageDisplayAttributesReport, | ||
886 | pstrUsageASCIICharacterSet, | ||
887 | pstrUsageDataReadBack, | ||
888 | pstrUsageFontReadBack, | ||
889 | pstrUsageDisplayControlReport, | ||
890 | pstrUsageClearDisplay, | ||
891 | pstrUsageDisplayEnable, | ||
892 | pstrUsageScreenSaverDelay, | ||
893 | pstrUsageScreenSaverEnable, | ||
894 | pstrUsageVerticalScroll, | ||
895 | pstrUsageHorizontalScroll, | ||
896 | pstrUsageCharacterReport, | ||
897 | pstrUsageDisplayData, | ||
898 | pstrUsageDisplayStatus, | ||
899 | pstrUsageStatusNotReady, | ||
900 | pstrUsageStatusReady, | ||
901 | pstrUsageErrorNotALoadableCharacter, | ||
902 | pstrUsageErrorFotDataCanNotBeRead, | ||
903 | pstrUsageCursorPositionReport, | ||
904 | pstrUsageRow, | ||
905 | pstrUsageColumn, | ||
906 | pstrUsageRows, | ||
907 | pstrUsageColumns, | ||
908 | pstrUsageCursorPixelPosition, | ||
909 | pstrUsageCursorMode, | ||
910 | pstrUsageCursorEnable, | ||
911 | pstrUsageCursorBlink, | ||
912 | pstrUsageFontReport, | ||
913 | pstrUsageFontData, | ||
914 | pstrUsageCharacterWidth, | ||
915 | pstrUsageCharacterHeight, | ||
916 | pstrUsageCharacterSpacingHorizontal, | ||
917 | pstrUsageCharacterSpacingVertical, | ||
918 | pstrUsageUnicodeCharset, | ||
919 | pstrUsageFont7Segment, | ||
920 | pstrUsage7SegmentDirectMap, | ||
921 | pstrUsageFont14Segment, | ||
922 | pstrUsage14SegmentDirectMap, | ||
923 | pstrUsageDisplayBrightness, | ||
924 | pstrUsageDisplayContrast, | ||
925 | pstrUsageCharacterAttribute, | ||
926 | pstrUsageAttributeReadback, | ||
927 | pstrUsageAttributeData, | ||
928 | pstrUsageCharAttributeEnhance, | ||
929 | pstrUsageCharAttributeUnderline, | ||
930 | pstrUsageCharAttributeBlink | ||
931 | }; | ||
932 | const char * const ReportDescParserBase::aplphanumTitles2[] PROGMEM = { | ||
933 | pstrUsageBitmapSizeX, | ||
934 | pstrUsageBitmapSizeY, | ||
935 | pstrUsagePageReserved, | ||
936 | pstrUsageBitDepthFormat, | ||
937 | pstrUsageDisplayOrientation, | ||
938 | pstrUsagePaletteReport, | ||
939 | pstrUsagePaletteDataSize, | ||
940 | pstrUsagePaletteDataOffset, | ||
941 | pstrUsagePaletteData, | ||
942 | pstrUsageBlitReport, | ||
943 | pstrUsageBlitRectangleX1, | ||
944 | pstrUsageBlitRectangleY1, | ||
945 | pstrUsageBlitRectangleX2, | ||
946 | pstrUsageBlitRectangleY2, | ||
947 | pstrUsageBlitData, | ||
948 | pstrUsageSoftButton, | ||
949 | pstrUsageSoftButtonID, | ||
950 | pstrUsageSoftButtonSide, | ||
951 | pstrUsageSoftButtonOffset1, | ||
952 | pstrUsageSoftButtonOffset2, | ||
953 | pstrUsageSoftButtonReport | ||
954 | }; | ||
955 | const char * const ReportDescParserBase::medInstrTitles0[] PROGMEM = { | ||
956 | pstrUsageVCRAcquisition, | ||
957 | pstrUsageFreezeThaw, | ||
958 | pstrUsageClipStore, | ||
959 | pstrUsageUpdate, | ||
960 | pstrUsageNext, | ||
961 | pstrUsageSave, | ||
962 | pstrUsagePrint, | ||
963 | pstrUsageMicrophoneEnable | ||
964 | }; | ||
965 | const char * const ReportDescParserBase::medInstrTitles1[] PROGMEM = { | ||
966 | pstrUsageCine, | ||
967 | pstrUsageTransmitPower, | ||
968 | pstrUsageVolume, | ||
969 | pstrUsageFocus, | ||
970 | pstrUsageDepth | ||
971 | }; | ||
972 | const char * const ReportDescParserBase::medInstrTitles2[] PROGMEM = { | ||
973 | pstrUsageSoftStepPrimary, | ||
974 | pstrUsageSoftStepSecondary | ||
975 | }; | ||
976 | const char * const ReportDescParserBase::medInstrTitles3[] PROGMEM = { | ||
977 | pstrUsageZoomSelect, | ||
978 | pstrUsageZoomAdjust, | ||
979 | pstrUsageSpectralDopplerModeSelect, | ||
980 | pstrUsageSpectralDopplerModeAdjust, | ||
981 | pstrUsageColorDopplerModeSelect, | ||
982 | pstrUsageColorDopplerModeAdjust, | ||
983 | pstrUsageMotionModeSelect, | ||
984 | pstrUsageMotionModeAdjust, | ||
985 | pstrUsage2DModeSelect, | ||
986 | pstrUsage2DModeAdjust | ||
987 | }; | ||
988 | const char * const ReportDescParserBase::medInstrTitles4[] PROGMEM = { | ||
989 | pstrUsageSoftControlSelect, | ||
990 | pstrUsageSoftControlAdjust | ||
991 | }; | ||
992 | |||
993 | void ReportDescParserBase::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) { | ||
994 | uint16_t cntdn = (uint16_t)len; | ||
995 | uint8_t *p = (uint8_t*)pbuf; | ||
996 | |||
997 | |||
998 | totalSize = 0; | ||
999 | |||
1000 | while(cntdn) { | ||
1001 | //USB_HOST_SERIAL.println(""); | ||
1002 | //PrintHex<uint16_t>(offset + len - cntdn); | ||
1003 | //USB_HOST_SERIAL.print(":"); | ||
1004 | |||
1005 | ParseItem(&p, &cntdn); | ||
1006 | |||
1007 | //if (ParseItem(&p, &cntdn)) | ||
1008 | // return; | ||
1009 | } | ||
1010 | //USBTRACE2("Total:", totalSize); | ||
1011 | } | ||
1012 | |||
1013 | void ReportDescParserBase::PrintValue(uint8_t *p, uint8_t len) { | ||
1014 | E_Notify(PSTR("("), 0x80); | ||
1015 | for(; len; p++, len--) | ||
1016 | PrintHex<uint8_t > (*p, 0x80); | ||
1017 | E_Notify(PSTR(")"), 0x80); | ||
1018 | } | ||
1019 | |||
1020 | void ReportDescParserBase::PrintByteValue(uint8_t data) { | ||
1021 | E_Notify(PSTR("("), 0x80); | ||
1022 | PrintHex<uint8_t > (data, 0x80); | ||
1023 | E_Notify(PSTR(")"), 0x80); | ||
1024 | } | ||
1025 | |||
1026 | void ReportDescParserBase::PrintItemTitle(uint8_t prefix) { | ||
1027 | switch(prefix & (TYPE_MASK | TAG_MASK)) { | ||
1028 | case (TYPE_GLOBAL | TAG_GLOBAL_PUSH): | ||
1029 | E_Notify(PSTR("\r\nPush"), 0x80); | ||
1030 | break; | ||
1031 | case (TYPE_GLOBAL | TAG_GLOBAL_POP): | ||
1032 | E_Notify(PSTR("\r\nPop"), 0x80); | ||
1033 | break; | ||
1034 | case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE): | ||
1035 | E_Notify(PSTR("\r\nUsage Page"), 0x80); | ||
1036 | break; | ||
1037 | case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN): | ||
1038 | E_Notify(PSTR("\r\nLogical Min"), 0x80); | ||
1039 | break; | ||
1040 | case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX): | ||
1041 | E_Notify(PSTR("\r\nLogical Max"), 0x80); | ||
1042 | break; | ||
1043 | case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN): | ||
1044 | E_Notify(PSTR("\r\nPhysical Min"), 0x80); | ||
1045 | break; | ||
1046 | case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX): | ||
1047 | E_Notify(PSTR("\r\nPhysical Max"), 0x80); | ||
1048 | break; | ||
1049 | case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP): | ||
1050 | E_Notify(PSTR("\r\nUnit Exp"), 0x80); | ||
1051 | break; | ||
1052 | case (TYPE_GLOBAL | TAG_GLOBAL_UNIT): | ||
1053 | E_Notify(PSTR("\r\nUnit"), 0x80); | ||
1054 | break; | ||
1055 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE): | ||
1056 | E_Notify(PSTR("\r\nReport Size"), 0x80); | ||
1057 | break; | ||
1058 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT): | ||
1059 | E_Notify(PSTR("\r\nReport Count"), 0x80); | ||
1060 | break; | ||
1061 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID): | ||
1062 | E_Notify(PSTR("\r\nReport Id"), 0x80); | ||
1063 | break; | ||
1064 | case (TYPE_LOCAL | TAG_LOCAL_USAGE): | ||
1065 | E_Notify(PSTR("\r\nUsage"), 0x80); | ||
1066 | break; | ||
1067 | case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN): | ||
1068 | E_Notify(PSTR("\r\nUsage Min"), 0x80); | ||
1069 | break; | ||
1070 | case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX): | ||
1071 | E_Notify(PSTR("\r\nUsage Max"), 0x80); | ||
1072 | break; | ||
1073 | case (TYPE_MAIN | TAG_MAIN_COLLECTION): | ||
1074 | E_Notify(PSTR("\r\nCollection"), 0x80); | ||
1075 | break; | ||
1076 | case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION): | ||
1077 | E_Notify(PSTR("\r\nEnd Collection"), 0x80); | ||
1078 | break; | ||
1079 | case (TYPE_MAIN | TAG_MAIN_INPUT): | ||
1080 | E_Notify(PSTR("\r\nInput"), 0x80); | ||
1081 | break; | ||
1082 | case (TYPE_MAIN | TAG_MAIN_OUTPUT): | ||
1083 | E_Notify(PSTR("\r\nOutput"), 0x80); | ||
1084 | break; | ||
1085 | case (TYPE_MAIN | TAG_MAIN_FEATURE): | ||
1086 | E_Notify(PSTR("\r\nFeature"), 0x80); | ||
1087 | break; | ||
1088 | } // switch (**pp & (TYPE_MASK | TAG_MASK)) | ||
1089 | } | ||
1090 | |||
1091 | uint8_t ReportDescParserBase::ParseItem(uint8_t **pp, uint16_t *pcntdn) { | ||
1092 | //uint8_t ret = enErrorSuccess; | ||
1093 | //reinterpret_cast<>(varBuffer); | ||
1094 | switch(itemParseState) { | ||
1095 | case 0: | ||
1096 | if(**pp == HID_LONG_ITEM_PREFIX) | ||
1097 | USBTRACE("\r\nLONG\r\n"); | ||
1098 | else { | ||
1099 | uint8_t size = ((**pp) & DATA_SIZE_MASK); | ||
1100 | |||
1101 | itemPrefix = (**pp); | ||
1102 | itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size); | ||
1103 | |||
1104 | PrintItemTitle(itemPrefix); | ||
1105 | } | ||
1106 | (*pp)++; | ||
1107 | (*pcntdn)--; | ||
1108 | itemSize--; | ||
1109 | itemParseState = 1; | ||
1110 | |||
1111 | if(!itemSize) | ||
1112 | break; | ||
1113 | |||
1114 | if(!pcntdn) | ||
1115 | return enErrorIncomplete; | ||
1116 | case 1: | ||
1117 | //USBTRACE2("\r\niSz:",itemSize); | ||
1118 | |||
1119 | theBuffer.valueSize = itemSize; | ||
1120 | valParser.Initialize(&theBuffer); | ||
1121 | itemParseState = 2; | ||
1122 | case 2: | ||
1123 | if(!valParser.Parse(pp, pcntdn)) | ||
1124 | return enErrorIncomplete; | ||
1125 | itemParseState = 3; | ||
1126 | case 3: | ||
1127 | { | ||
1128 | uint8_t data = *((uint8_t*)varBuffer); | ||
1129 | |||
1130 | switch(itemPrefix & (TYPE_MASK | TAG_MASK)) { | ||
1131 | case (TYPE_LOCAL | TAG_LOCAL_USAGE): | ||
1132 | if(pfUsage) { | ||
1133 | if(theBuffer.valueSize > 1) { | ||
1134 | uint16_t* ui16 = reinterpret_cast<uint16_t *>(varBuffer); | ||
1135 | pfUsage(*ui16); | ||
1136 | } else | ||
1137 | pfUsage(data); | ||
1138 | } | ||
1139 | break; | ||
1140 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE): | ||
1141 | rptSize = data; | ||
1142 | PrintByteValue(data); | ||
1143 | break; | ||
1144 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT): | ||
1145 | rptCount = data; | ||
1146 | PrintByteValue(data); | ||
1147 | break; | ||
1148 | case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN): | ||
1149 | case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX): | ||
1150 | case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN): | ||
1151 | case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX): | ||
1152 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID): | ||
1153 | case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN): | ||
1154 | case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX): | ||
1155 | case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP): | ||
1156 | case (TYPE_GLOBAL | TAG_GLOBAL_UNIT): | ||
1157 | PrintValue(varBuffer, theBuffer.valueSize); | ||
1158 | break; | ||
1159 | case (TYPE_GLOBAL | TAG_GLOBAL_PUSH): | ||
1160 | case (TYPE_GLOBAL | TAG_GLOBAL_POP): | ||
1161 | break; | ||
1162 | case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE): | ||
1163 | SetUsagePage(data); | ||
1164 | PrintUsagePage(data); | ||
1165 | PrintByteValue(data); | ||
1166 | break; | ||
1167 | case (TYPE_MAIN | TAG_MAIN_COLLECTION): | ||
1168 | case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION): | ||
1169 | switch(data) { | ||
1170 | case 0x00: | ||
1171 | E_Notify(PSTR(" Physical"), 0x80); | ||
1172 | break; | ||
1173 | case 0x01: | ||
1174 | E_Notify(PSTR(" Application"), 0x80); | ||
1175 | break; | ||
1176 | case 0x02: | ||
1177 | E_Notify(PSTR(" Logical"), 0x80); | ||
1178 | break; | ||
1179 | case 0x03: | ||
1180 | E_Notify(PSTR(" Report"), 0x80); | ||
1181 | break; | ||
1182 | case 0x04: | ||
1183 | E_Notify(PSTR(" Named Array"), 0x80); | ||
1184 | break; | ||
1185 | case 0x05: | ||
1186 | E_Notify(PSTR(" Usage Switch"), 0x80); | ||
1187 | break; | ||
1188 | case 0x06: | ||
1189 | E_Notify(PSTR(" Usage Modifier"), 0x80); | ||
1190 | break; | ||
1191 | default: | ||
1192 | E_Notify(PSTR(" Vendor Defined("), 0x80); | ||
1193 | PrintHex<uint8_t > (data, 0x80); | ||
1194 | E_Notify(PSTR(")"), 0x80); | ||
1195 | } | ||
1196 | break; | ||
1197 | case (TYPE_MAIN | TAG_MAIN_INPUT): | ||
1198 | case (TYPE_MAIN | TAG_MAIN_OUTPUT): | ||
1199 | case (TYPE_MAIN | TAG_MAIN_FEATURE): | ||
1200 | totalSize += (uint16_t)rptSize * (uint16_t)rptCount; | ||
1201 | rptSize = 0; | ||
1202 | rptCount = 0; | ||
1203 | E_Notify(PSTR("("), 0x80); | ||
1204 | PrintBin<uint8_t > (data, 0x80); | ||
1205 | E_Notify(PSTR(")"), 0x80); | ||
1206 | break; | ||
1207 | } // switch (**pp & (TYPE_MASK | TAG_MASK)) | ||
1208 | } | ||
1209 | } // switch (itemParseState) | ||
1210 | itemParseState = 0; | ||
1211 | return enErrorSuccess; | ||
1212 | } | ||
1213 | |||
1214 | ReportDescParserBase::UsagePageFunc ReportDescParserBase::usagePageFunctions[] /*PROGMEM*/ = { | ||
1215 | &ReportDescParserBase::PrintGenericDesktopPageUsage, | ||
1216 | &ReportDescParserBase::PrintSimulationControlsPageUsage, | ||
1217 | &ReportDescParserBase::PrintVRControlsPageUsage, | ||
1218 | &ReportDescParserBase::PrintSportsControlsPageUsage, | ||
1219 | &ReportDescParserBase::PrintGameControlsPageUsage, | ||
1220 | &ReportDescParserBase::PrintGenericDeviceControlsPageUsage, | ||
1221 | NULL, // Keyboard/Keypad | ||
1222 | &ReportDescParserBase::PrintLEDPageUsage, | ||
1223 | &ReportDescParserBase::PrintButtonPageUsage, | ||
1224 | &ReportDescParserBase::PrintOrdinalPageUsage, | ||
1225 | &ReportDescParserBase::PrintTelephonyPageUsage, | ||
1226 | &ReportDescParserBase::PrintConsumerPageUsage, | ||
1227 | &ReportDescParserBase::PrintDigitizerPageUsage, | ||
1228 | NULL, // Reserved | ||
1229 | NULL, // PID | ||
1230 | NULL // Unicode | ||
1231 | }; | ||
1232 | |||
1233 | void ReportDescParserBase::SetUsagePage(uint16_t page) { | ||
1234 | pfUsage = NULL; | ||
1235 | |||
1236 | if(VALUE_BETWEEN(page, 0x00, 0x11)) { | ||
1237 | pfUsage = (usagePageFunctions[page - 1]); | ||
1238 | |||
1239 | } else { | ||
1240 | switch(page) { | ||
1241 | case 0x14: | ||
1242 | pfUsage = &ReportDescParserBase::PrintAlphanumDisplayPageUsage; | ||
1243 | break; | ||
1244 | case 0x40: | ||
1245 | pfUsage = &ReportDescParserBase::PrintMedicalInstrumentPageUsage; | ||
1246 | break; | ||
1247 | } | ||
1248 | } | ||
1249 | } | ||
1250 | |||
1251 | void ReportDescParserBase::PrintUsagePage(uint16_t page) { | ||
1252 | const char * const * w; | ||
1253 | E_Notify(pstrSpace, 0x80); | ||
1254 | |||
1255 | output_if_between(page, 0x00, 0x11, w, E_Notify, usagePageTitles0, 0x80) | ||
1256 | else output_if_between(page, 0x8b, 0x92, w, E_Notify, usagePageTitles1, 0x80) | ||
1257 | else if(VALUE_BETWEEN(page, 0x7f, 0x84)) | ||
1258 | E_Notify(pstrUsagePageMonitor, 0x80); | ||
1259 | else if(VALUE_BETWEEN(page, 0x83, 0x8c)) | ||
1260 | E_Notify(pstrUsagePagePower, 0x80); | ||
1261 | else if(page > 0xfeff /* && page <= 0xffff */) | ||
1262 | E_Notify(pstrUsagePageVendorDefined, 0x80); | ||
1263 | else | ||
1264 | switch(page) { | ||
1265 | case 0x14: | ||
1266 | E_Notify(pstrUsagePageAlphaNumericDisplay, 0x80); | ||
1267 | break; | ||
1268 | case 0x40: | ||
1269 | E_Notify(pstrUsagePageMedicalInstruments, 0x80); | ||
1270 | break; | ||
1271 | default: | ||
1272 | E_Notify(pstrUsagePageUndefined, 0x80); | ||
1273 | } | ||
1274 | } | ||
1275 | |||
1276 | void ReportDescParserBase::PrintButtonPageUsage(uint16_t usage) { | ||
1277 | E_Notify(pstrSpace, 0x80); | ||
1278 | E_Notify(PSTR("Btn"), 0x80); | ||
1279 | PrintHex<uint16_t > (usage, 0x80); | ||
1280 | E_Notify(PSTR("\r\n"), 0x80); | ||
1281 | //USB_HOST_SERIAL.print(usage, HEX); | ||
1282 | } | ||
1283 | |||
1284 | void ReportDescParserBase::PrintOrdinalPageUsage(uint16_t usage) { | ||
1285 | E_Notify(pstrSpace, 0x80); | ||
1286 | E_Notify(PSTR("Inst"), 0x80); | ||
1287 | // Sorry, HEX for now... | ||
1288 | PrintHex<uint16_t > (usage, 0x80); | ||
1289 | E_Notify(PSTR("\r\n"), 0x80); | ||
1290 | //USB_HOST_SERIAL.print(usage, DEC); | ||
1291 | } | ||
1292 | |||
1293 | void ReportDescParserBase::PrintGenericDesktopPageUsage(uint16_t usage) { | ||
1294 | const char * const * w; | ||
1295 | E_Notify(pstrSpace, 0x80); | ||
1296 | |||
1297 | output_if_between(usage, 0x00, 0x0a, w, E_Notify, genDesktopTitles0, 0x80) | ||
1298 | else output_if_between(usage, 0x2f, 0x49, w, E_Notify, genDesktopTitles1, 0x80) | ||
1299 | else output_if_between(usage, 0x7f, 0x94, w, E_Notify, genDesktopTitles2, 0x80) | ||
1300 | else output_if_between(usage, 0x9f, 0xa9, w, E_Notify, genDesktopTitles3, 0x80) | ||
1301 | else output_if_between(usage, 0xaf, 0xb8, w, E_Notify, genDesktopTitles4, 0x80) | ||
1302 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1303 | } | ||
1304 | |||
1305 | void ReportDescParserBase::PrintSimulationControlsPageUsage(uint16_t usage) { | ||
1306 | const char * const * w; | ||
1307 | E_Notify(pstrSpace, 0x80); | ||
1308 | |||
1309 | output_if_between(usage, 0x00, 0x0d, w, E_Notify, simuTitles0, 0x80) | ||
1310 | else output_if_between(usage, 0x1f, 0x26, w, E_Notify, simuTitles1, 0x80) | ||
1311 | else output_if_between(usage, 0xaf, 0xd1, w, E_Notify, simuTitles2, 0x80) | ||
1312 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1313 | } | ||
1314 | |||
1315 | void ReportDescParserBase::PrintVRControlsPageUsage(uint16_t usage) { | ||
1316 | const char * const * w; | ||
1317 | E_Notify(pstrSpace, 0x80); | ||
1318 | |||
1319 | output_if_between(usage, 0x00, 0x0b, w, E_Notify, vrTitles0, 0x80) | ||
1320 | else output_if_between(usage, 0x1f, 0x22, w, E_Notify, vrTitles1, 0x80) | ||
1321 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1322 | } | ||
1323 | |||
1324 | void ReportDescParserBase::PrintSportsControlsPageUsage(uint16_t usage) { | ||
1325 | const char * const * w; | ||
1326 | E_Notify(pstrSpace, 0x80); | ||
1327 | |||
1328 | output_if_between(usage, 0x00, 0x05, w, E_Notify, sportsCtrlTitles0, 0x80) | ||
1329 | else output_if_between(usage, 0x2f, 0x3a, w, E_Notify, sportsCtrlTitles1, 0x80) | ||
1330 | else output_if_between(usage, 0x4f, 0x64, w, E_Notify, sportsCtrlTitles2, 0x80) | ||
1331 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1332 | } | ||
1333 | |||
1334 | void ReportDescParserBase::PrintGameControlsPageUsage(uint16_t usage) { | ||
1335 | const char * const * w; | ||
1336 | E_Notify(pstrSpace, 0x80); | ||
1337 | |||
1338 | output_if_between(usage, 0x00, 0x04, w, E_Notify, gameTitles0, 0x80) | ||
1339 | else output_if_between(usage, 0x1f, 0x3a, w, E_Notify, gameTitles1, 0x80) | ||
1340 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1341 | } | ||
1342 | |||
1343 | void ReportDescParserBase::PrintGenericDeviceControlsPageUsage(uint16_t usage) { | ||
1344 | const char * const * w; | ||
1345 | E_Notify(pstrSpace, 0x80); | ||
1346 | |||
1347 | output_if_between(usage, 0x1f, 0x27, w, E_Notify, genDevCtrlTitles, 0x80) | ||
1348 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1349 | } | ||
1350 | |||
1351 | void ReportDescParserBase::PrintLEDPageUsage(uint16_t usage) { | ||
1352 | const char * const * w; | ||
1353 | E_Notify(pstrSpace, 0x80); | ||
1354 | |||
1355 | output_if_between(usage, 0x00, 0x4e, w, E_Notify, ledTitles, 0x80) | ||
1356 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1357 | } | ||
1358 | |||
1359 | void ReportDescParserBase::PrintTelephonyPageUsage(uint16_t usage) { | ||
1360 | const char * const * w; | ||
1361 | E_Notify(pstrSpace, 0x80); | ||
1362 | |||
1363 | output_if_between(usage, 0x00, 0x08, w, E_Notify, telTitles0, 0x80) | ||
1364 | else output_if_between(usage, 0x1f, 0x32, w, E_Notify, telTitles1, 0x80) | ||
1365 | else output_if_between(usage, 0x4f, 0x54, w, E_Notify, telTitles2, 0x80) | ||
1366 | else output_if_between(usage, 0x6f, 0x75, w, E_Notify, telTitles3, 0x80) | ||
1367 | else output_if_between(usage, 0x8f, 0x9f, w, E_Notify, telTitles4, 0x80) | ||
1368 | else output_if_between(usage, 0xaf, 0xc0, w, E_Notify, telTitles5, 0x80) | ||
1369 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1370 | } | ||
1371 | |||
1372 | void ReportDescParserBase::PrintConsumerPageUsage(uint16_t usage) { | ||
1373 | const char * const * w; | ||
1374 | E_Notify(pstrSpace, 0x80); | ||
1375 | |||
1376 | output_if_between(usage, 0x00, 0x07, w, E_Notify, consTitles0, 0x80) | ||
1377 | else output_if_between(usage, 0x1f, 0x23, w, E_Notify, consTitles1, 0x80) | ||
1378 | else output_if_between(usage, 0x2f, 0x37, w, E_Notify, consTitles2, 0x80) | ||
1379 | else output_if_between(usage, 0x3f, 0x49, w, E_Notify, consTitles3, 0x80) | ||
1380 | else output_if_between(usage, 0x5f, 0x67, w, E_Notify, consTitles4, 0x80) | ||
1381 | else output_if_between(usage, 0x7f, 0xa5, w, E_Notify, consTitles5, 0x80) | ||
1382 | else output_if_between(usage, 0xaf, 0xcf, w, E_Notify, consTitles6, 0x80) | ||
1383 | else output_if_between(usage, 0xdf, 0xeb, w, E_Notify, consTitles7, 0x80) | ||
1384 | else output_if_between(usage, 0xef, 0xf6, w, E_Notify, consTitles8, 0x80) | ||
1385 | else output_if_between(usage, 0xff, 0x10e, w, E_Notify, consTitles9, 0x80) | ||
1386 | else output_if_between(usage, 0x14f, 0x156, w, E_Notify, consTitlesA, 0x80) | ||
1387 | else output_if_between(usage, 0x15f, 0x16b, w, E_Notify, consTitlesB, 0x80) | ||
1388 | else output_if_between(usage, 0x16f, 0x175, w, E_Notify, consTitlesC, 0x80) | ||
1389 | else output_if_between(usage, 0x17f, 0x1c8, w, E_Notify, consTitlesD, 0x80) | ||
1390 | else output_if_between(usage, 0x1ff, 0x29d, w, E_Notify, consTitlesE, 0x80) | ||
1391 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1392 | } | ||
1393 | |||
1394 | void ReportDescParserBase::PrintDigitizerPageUsage(uint16_t usage) { | ||
1395 | const char * const * w; | ||
1396 | E_Notify(pstrSpace, 0x80); | ||
1397 | |||
1398 | output_if_between(usage, 0x00, 0x0e, w, E_Notify, digitTitles0, 0x80) | ||
1399 | else output_if_between(usage, 0x1f, 0x23, w, E_Notify, digitTitles1, 0x80) | ||
1400 | else output_if_between(usage, 0x2f, 0x47, w, E_Notify, digitTitles2, 0x80) | ||
1401 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1402 | } | ||
1403 | |||
1404 | void ReportDescParserBase::PrintAlphanumDisplayPageUsage(uint16_t usage) { | ||
1405 | const char * const * w; | ||
1406 | E_Notify(pstrSpace, 0x80); | ||
1407 | |||
1408 | output_if_between(usage, 0x00, 0x03, w, E_Notify, aplphanumTitles0, 0x80) | ||
1409 | else output_if_between(usage, 0x1f, 0x4e, w, E_Notify, aplphanumTitles1, 0x80) | ||
1410 | else output_if_between(usage, 0x7f, 0x96, w, E_Notify, digitTitles2, 0x80) | ||
1411 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1412 | } | ||
1413 | |||
1414 | void ReportDescParserBase::PrintMedicalInstrumentPageUsage(uint16_t usage) { | ||
1415 | const char * const * w; | ||
1416 | E_Notify(pstrSpace, 0x80); | ||
1417 | |||
1418 | if(usage == 1) E_Notify(pstrUsageMedicalUltrasound, 0x80); | ||
1419 | else if(usage == 0x70) | ||
1420 | E_Notify(pstrUsageDepthGainCompensation, 0x80); | ||
1421 | else output_if_between(usage, 0x1f, 0x28, w, E_Notify, medInstrTitles0, 0x80) | ||
1422 | else output_if_between(usage, 0x3f, 0x45, w, E_Notify, medInstrTitles1, 0x80) | ||
1423 | else output_if_between(usage, 0x5f, 0x62, w, E_Notify, medInstrTitles2, 0x80) | ||
1424 | else output_if_between(usage, 0x7f, 0x8a, w, E_Notify, medInstrTitles3, 0x80) | ||
1425 | else output_if_between(usage, 0x9f, 0xa2, w, E_Notify, medInstrTitles4, 0x80) | ||
1426 | else E_Notify(pstrUsagePageUndefined, 0x80); | ||
1427 | } | ||
1428 | |||
1429 | uint8_t ReportDescParser2::ParseItem(uint8_t **pp, uint16_t *pcntdn) { | ||
1430 | //uint8_t ret = enErrorSuccess; | ||
1431 | |||
1432 | switch(itemParseState) { | ||
1433 | case 0: | ||
1434 | if(**pp == HID_LONG_ITEM_PREFIX) | ||
1435 | USBTRACE("\r\nLONG\r\n"); | ||
1436 | else { | ||
1437 | uint8_t size = ((**pp) & DATA_SIZE_MASK); | ||
1438 | itemPrefix = (**pp); | ||
1439 | itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size); | ||
1440 | } | ||
1441 | (*pp)++; | ||
1442 | (*pcntdn)--; | ||
1443 | itemSize--; | ||
1444 | itemParseState = 1; | ||
1445 | |||
1446 | if(!itemSize) | ||
1447 | break; | ||
1448 | |||
1449 | if(!pcntdn) | ||
1450 | return enErrorIncomplete; | ||
1451 | case 1: | ||
1452 | theBuffer.valueSize = itemSize; | ||
1453 | valParser.Initialize(&theBuffer); | ||
1454 | itemParseState = 2; | ||
1455 | case 2: | ||
1456 | if(!valParser.Parse(pp, pcntdn)) | ||
1457 | return enErrorIncomplete; | ||
1458 | itemParseState = 3; | ||
1459 | case 3: | ||
1460 | { | ||
1461 | uint8_t data = *((uint8_t*)varBuffer); | ||
1462 | |||
1463 | switch(itemPrefix & (TYPE_MASK | TAG_MASK)) { | ||
1464 | case (TYPE_LOCAL | TAG_LOCAL_USAGE): | ||
1465 | if(pfUsage) { | ||
1466 | if(theBuffer.valueSize > 1) { | ||
1467 | uint16_t* ui16 = reinterpret_cast<uint16_t *>(varBuffer); | ||
1468 | pfUsage(*ui16); | ||
1469 | } else | ||
1470 | pfUsage(data); | ||
1471 | } | ||
1472 | break; | ||
1473 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE): | ||
1474 | rptSize = data; | ||
1475 | break; | ||
1476 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT): | ||
1477 | rptCount = data; | ||
1478 | break; | ||
1479 | case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID): | ||
1480 | rptId = data; | ||
1481 | break; | ||
1482 | case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN): | ||
1483 | useMin = data; | ||
1484 | break; | ||
1485 | case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX): | ||
1486 | useMax = data; | ||
1487 | break; | ||
1488 | case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE): | ||
1489 | SetUsagePage(data); | ||
1490 | break; | ||
1491 | case (TYPE_MAIN | TAG_MAIN_OUTPUT): | ||
1492 | case (TYPE_MAIN | TAG_MAIN_FEATURE): | ||
1493 | rptSize = 0; | ||
1494 | rptCount = 0; | ||
1495 | useMin = 0; | ||
1496 | useMax = 0; | ||
1497 | break; | ||
1498 | case (TYPE_MAIN | TAG_MAIN_INPUT): | ||
1499 | OnInputItem(data); | ||
1500 | |||
1501 | totalSize += (uint16_t)rptSize * (uint16_t)rptCount; | ||
1502 | |||
1503 | rptSize = 0; | ||
1504 | rptCount = 0; | ||
1505 | useMin = 0; | ||
1506 | useMax = 0; | ||
1507 | break; | ||
1508 | } // switch (**pp & (TYPE_MASK | TAG_MASK)) | ||
1509 | } | ||
1510 | } // switch (itemParseState) | ||
1511 | itemParseState = 0; | ||
1512 | return enErrorSuccess; | ||
1513 | } | ||
1514 | |||
1515 | void ReportDescParser2::OnInputItem(uint8_t itm) { | ||
1516 | uint8_t byte_offset = (totalSize >> 3); // calculate offset to the next unhandled byte i = (int)(totalCount / 8); | ||
1517 | uint32_t tmp = (byte_offset << 3); | ||
1518 | uint8_t bit_offset = totalSize - tmp; // number of bits in the current byte already handled | ||
1519 | uint8_t *p = pBuf + byte_offset; // current byte pointer | ||
1520 | |||
1521 | if(bit_offset) | ||
1522 | *p >>= bit_offset; | ||
1523 | |||
1524 | uint8_t usage = useMin; | ||
1525 | |||
1526 | bool print_usemin_usemax = ((useMin < useMax) && ((itm & 3) == 2) && pfUsage) ? true : false; | ||
1527 | |||
1528 | uint8_t bits_of_byte = 8; | ||
1529 | |||
1530 | // for each field in field array defined by rptCount | ||
1531 | for(uint8_t field = 0; field < rptCount; field++, usage++) { | ||
1532 | |||
1533 | union { | ||
1534 | uint8_t bResult[4]; | ||
1535 | uint16_t wResult[2]; | ||
1536 | uint32_t dwResult; | ||
1537 | } result; | ||
1538 | |||
1539 | result.dwResult = 0; | ||
1540 | uint8_t mask = 0; | ||
1541 | |||
1542 | if(print_usemin_usemax) | ||
1543 | pfUsage(usage); | ||
1544 | |||
1545 | // bits_left - number of bits in the field(array of fields, depending on Report Count) left to process | ||
1546 | // bits_of_byte - number of bits in current byte left to process | ||
1547 | // bits_to_copy - number of bits to copy to result buffer | ||
1548 | |||
1549 | // for each bit in a field | ||
1550 | for(uint8_t bits_left = rptSize, bits_to_copy = 0; bits_left; | ||
1551 | bits_left -= bits_to_copy) { | ||
1552 | bits_to_copy = (bits_left > bits_of_byte) ? bits_of_byte : bits_left; | ||
1553 | |||
1554 | result.dwResult <<= bits_to_copy; // Result buffer is shifted by the number of bits to be copied into it | ||
1555 | |||
1556 | uint8_t val = *p; | ||
1557 | |||
1558 | val >>= (8 - bits_of_byte); // Shift by the number of bits already processed | ||
1559 | |||
1560 | mask = 0; | ||
1561 | |||
1562 | for(uint8_t j = bits_to_copy; j; j--) { | ||
1563 | mask <<= 1; | ||
1564 | mask |= 1; | ||
1565 | } | ||
1566 | |||
1567 | result.bResult[0] = (result.bResult[0] | (val & mask)); | ||
1568 | |||
1569 | bits_of_byte -= bits_to_copy; | ||
1570 | |||
1571 | if(bits_of_byte < 1) { | ||
1572 | bits_of_byte = 8; | ||
1573 | p++; | ||
1574 | } | ||
1575 | } | ||
1576 | PrintByteValue(result.dwResult); | ||
1577 | } | ||
1578 | E_Notify(PSTR("\r\n"), 0x80); | ||
1579 | } | ||
1580 | |||
1581 | void UniversalReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { | ||
1582 | ReportDescParser2 prs(len, buf); | ||
1583 | |||
1584 | uint8_t ret = hid->GetReportDescr(0, &prs); | ||
1585 | |||
1586 | if(ret) | ||
1587 | ErrorMessage<uint8_t > (PSTR("GetReportDescr-2"), ret); | ||
1588 | } | ||