StephaneLenclud@35: //
StephaneLenclud@35: // Copyright (C) 2014-2015 Stéphane Lenclud.
StephaneLenclud@35: //
StephaneLenclud@35: // This file is part of MiniDisplay.
StephaneLenclud@35: //
StephaneLenclud@35: // MiniDisplay is free software: you can redistribute it and/or modify
StephaneLenclud@35: // it under the terms of the GNU General Public License as published by
StephaneLenclud@35: // the Free Software Foundation, either version 3 of the License, or
StephaneLenclud@35: // (at your option) any later version.
StephaneLenclud@35: //
StephaneLenclud@35: // MiniDisplay is distributed in the hope that it will be useful,
StephaneLenclud@35: // but WITHOUT ANY WARRANTY; without even the implied warranty of
StephaneLenclud@35: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
StephaneLenclud@35: // GNU General Public License for more details.
StephaneLenclud@35: //
StephaneLenclud@35: // You should have received a copy of the GNU General Public License
StephaneLenclud@35: // along with MiniDisplay. If not, see .
StephaneLenclud@35: //
StephaneLenclud@35:
StephaneLenclud@35:
sl@0: #ifndef HID_REPORT_H
sl@0: #define HID_REPORT_H
sl@0:
sl@0: #include
sl@0:
sl@0: /**
sl@0: Define an HID report.
sl@0: Can be used as input and output.
sl@0: */
sl@0: template
sl@0: class HidReport
sl@0: {
sl@0: public:
sl@0: HidReport(){Reset();}
sl@0: void Reset();
sl@0: inline unsigned char& operator[](int aIndex){return iBuffer[aIndex];}
sl@0: const unsigned char* Buffer() const {return iBuffer;}
sl@0: unsigned char* Buffer() {return iBuffer;}
sl@0: int Size() {return S;}
sl@0: protected:
sl@0: unsigned char iBuffer[S];
sl@0: };
sl@0:
sl@0: template
sl@0: void HidReport::Reset()
sl@0: {
sl@0: memset(iBuffer,0,sizeof(iBuffer));
sl@0: }
sl@0:
sl@0:
sl@0: #endif